From 306e1b867ab62ebfa6d9c11c9bbbc50d7ea3fcfc Mon Sep 17 00:00:00 2001 From: Naomi Black Date: Wed, 11 Nov 2015 14:02:44 -0800 Subject: [PATCH] v2.0.0-alpha.46 --- 2.0.0-alpha.46/angular2.dev.js | 38876 +++++++++++++++++ 2.0.0-alpha.46/angular2.js | 38876 +++++++++++++++++ 2.0.0-alpha.46/angular2.min.js | 26 + 2.0.0-alpha.46/angular2.sfx.dev.js | 42639 +++++++++++++++++++ 2.0.0-alpha.46/http.dev.js | 1179 + 2.0.0-alpha.46/http.js | 1179 + 2.0.0-alpha.46/http.min.js | 1 + 2.0.0-alpha.46/http.sfx.dev.js | 36931 ++++++++++++++++ 2.0.0-alpha.46/router.dev.js | 2411 ++ 2.0.0-alpha.46/router.js | 2411 ++ 2.0.0-alpha.46/testing.js | 2063 + 2.0.0-alpha.46/testing.js.map | 1 + 2.0.0-alpha.46/web_worker/ui.dev.js | 35828 ++++++++++++++++ 2.0.0-alpha.46/web_worker/worker.dev.js | 48794 ++++++++++++++++++++++ 14 files changed, 251215 insertions(+) create mode 100644 2.0.0-alpha.46/angular2.dev.js create mode 100644 2.0.0-alpha.46/angular2.js create mode 100644 2.0.0-alpha.46/angular2.min.js create mode 100644 2.0.0-alpha.46/angular2.sfx.dev.js create mode 100644 2.0.0-alpha.46/http.dev.js create mode 100644 2.0.0-alpha.46/http.js create mode 100644 2.0.0-alpha.46/http.min.js create mode 100644 2.0.0-alpha.46/http.sfx.dev.js create mode 100644 2.0.0-alpha.46/router.dev.js create mode 100644 2.0.0-alpha.46/router.js create mode 100644 2.0.0-alpha.46/testing.js create mode 100644 2.0.0-alpha.46/testing.js.map create mode 100644 2.0.0-alpha.46/web_worker/ui.dev.js create mode 100644 2.0.0-alpha.46/web_worker/worker.dev.js diff --git a/2.0.0-alpha.46/angular2.dev.js b/2.0.0-alpha.46/angular2.dev.js new file mode 100644 index 0000000000..e9f1a540b3 --- /dev/null +++ b/2.0.0-alpha.46/angular2.dev.js @@ -0,0 +1,38876 @@ +/** + @license +Copyright 2014-2015 Google, Inc. http://angularjs.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + */ + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + +// TODO(vicb): remove '!isFirefox' when the bug gets fixed: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1162013 +if (hasNativePromise && !isFirefox) { + // When available use a native Promise to schedule microtasks. + // When not available, es6-promise fallback will be used + var resolvedPromise = Promise.resolve(); + es6Promise._setScheduler(function(fn) { + resolvedPromise.then(fn); + }); +} + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"es6-promise":17}],5:[function(require,module,exports){ +(function (global){ +'use strict'; + +var fnPatch = require('./functions'); +var promisePatch = require('./promise'); +var mutationObserverPatch = require('./mutation-observer'); +var definePropertyPatch = require('./define-property'); +var registerElementPatch = require('./register-element'); +var webSocketPatch = require('./websocket'); +var eventTargetPatch = require('./event-target'); +var propertyDescriptorPatch = require('./property-descriptor'); +var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); + +function apply() { + fnPatch.patchSetClearFunction(global, [ + 'timeout', + 'interval', + 'immediate' + ]); + + fnPatch.patchRequestAnimationFrame(global, [ + 'requestAnimationFrame', + 'mozRequestAnimationFrame', + 'webkitRequestAnimationFrame' + ]); + + fnPatch.patchFunction(global, [ + 'alert', + 'prompt' + ]); + + eventTargetPatch.apply(); + + propertyDescriptorPatch.apply(); + + promisePatch.apply(); + + mutationObserverPatch.patchClass('MutationObserver'); + mutationObserverPatch.patchClass('WebKitMutationObserver'); + + definePropertyPatch.apply(); + + registerElementPatch.apply(); + + geolocationPatch.apply(); + + fileReaderPatch.apply(); +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(require,module,exports){ +'use strict'; + +var keys = require('../keys'); + +// might need similar for object.freeze +// i regret nothing + +var _defineProperty = Object.defineProperty; +var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); + +function apply() { + Object.defineProperty = function (obj, prop, desc) { + if (isUnconfigurable(obj, prop)) { + throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); + } + if (prop !== 'prototype') { + desc = rewriteDescriptor(obj, prop, desc); + } + return _defineProperty(obj, prop, desc); + }; + + Object.defineProperties = function (obj, props) { + Object.keys(props).forEach(function (prop) { + Object.defineProperty(obj, prop, props[prop]); + }); + return obj; + }; + + Object.create = function (obj, proto) { + if (typeof proto === 'object') { + Object.keys(proto).forEach(function (prop) { + proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); + }); + } + return _create(obj, proto); + }; + + Object.getOwnPropertyDescriptor = function (obj, prop) { + var desc = _getOwnPropertyDescriptor(obj, prop); + if (isUnconfigurable(obj, prop)) { + desc.configurable = false; + } + return desc; + }; +}; + +function _redefineProperty(obj, prop, desc) { + desc = rewriteDescriptor(obj, prop, desc); + return _defineProperty(obj, prop, desc); +}; + +function isUnconfigurable (obj, prop) { + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; +} + +function rewriteDescriptor (obj, prop, desc) { + desc.configurable = true; + if (!desc.configurable) { + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); + } + obj[unconfigurablesKey][prop] = true; + } + return desc; +} + +module.exports = { + apply: apply, + _redefineProperty: _redefineProperty +}; + + + +},{"../keys":3}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + // patched properties depend on addEventListener, so this needs to come first + if (global.EventTarget) { + utils.patchEventTargetMethods(global.EventTarget.prototype); + + // Note: EventTarget is not available in all browsers, + // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget + } else { + var apis = [ + 'ApplicationCache', + 'EventSource', + 'FileReader', + 'InputMethodContext', + 'MediaController', + 'MessagePort', + 'Node', + 'Performance', + 'SVGElementInstance', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebKitNamedFlow', + 'Worker', + 'WorkerGlobalScope', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload' + ]; + + apis.forEach(function(api) { + var proto = global[api] && global[api].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (proto && proto.addEventListener) { + utils.patchEventTargetMethods(proto); + } + }); + + // Patch the methods on `window` instead of `Window.prototype` + // `Window` is not accessible on Android 4.3 + if (typeof(window) !== 'undefined') { + utils.patchEventTargetMethods(window); + } + } +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":16}],9:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function patchSetClearFunction(obj, fnNames) { + fnNames.map(function (name) { + return name[0].toUpperCase() + name.substr(1); + }).forEach(function (name) { + var setName = 'set' + name; + var delegate = obj[setName]; + + if (delegate) { + var clearName = 'clear' + name; + var ids = {}; + + var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce; + + global.zone[setName] = function (fn) { + var id, fnRef = fn; + arguments[0] = function () { + delete ids[id]; + return fnRef.apply(this, arguments); + }; + var args = bindArgs(arguments); + id = delegate.apply(obj, args); + ids[id] = true; + return id; + }; + + obj[setName] = function () { + return global.zone[setName].apply(this, arguments); + }; + + var clearDelegate = obj[clearName]; + + global.zone[clearName] = function (id) { + if (ids[id]) { + delete ids[id]; + global.zone.dequeueTask(); + } + return clearDelegate.apply(this, arguments); + }; + + obj[clearName] = function () { + return global.zone[clearName].apply(this, arguments); + }; + } + }); +}; + + +/** + * requestAnimationFrame is typically recursively called from within the callback function + * that it executes. To handle this case, only fork a zone if this is executed + * within the root zone. + */ +function patchRequestAnimationFrame(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + global.zone[name] = function (fn) { + var callZone = global.zone.isRootZone() ? global.zone.fork() : global.zone; + if (fn) { + arguments[0] = function () { + return callZone.run(fn, this, arguments); + }; + } + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchSetFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + + if (delegate) { + global.zone[name] = function (fn) { + arguments[0] = function () { + return fn.apply(this, arguments); + }; + var args = utils.bindArgumentsOnce(arguments); + return delegate.apply(obj, args); + }; + + obj[name] = function () { + return zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + global.zone[name] = function () { + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + }); +}; + + +module.exports = { + patchSetClearFunction: patchSetClearFunction, + patchSetFunction: patchSetFunction, + patchRequestAnimationFrame: patchRequestAnimationFrame, + patchFunction: patchFunction +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + if (global.navigator && global.navigator.geolocation) { + utils.patchPrototype(global.navigator.geolocation, [ + 'getCurrentPosition', + 'watchPosition' + ]); + } +} + +module.exports = { + apply: apply +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],11:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function (fn) { + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); + // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks + this[creationZoneKey] = global.zone; + }; + + var instance = new OriginalClass(function () {}); + + global[className].prototype.disconnect = function () { + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; + } + return result; + }; + + global[className].prototype.observe = function () { + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; + } + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); + }; + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof global[className].prototype !== undefined) { + return; + } + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } +}; + +module.exports = { + patchClass: patchClass +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3}],12:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +/* + * Patches a function that returns a Promise-like instance. + * + * This function must be used when either: + * - Native Promises are not available, + * - The function returns a Promise-like object. + * + * This is required because zones rely on a Promise monkey patch that could not be applied when + * Promise is not natively available or when the returned object is not an instance of Promise. + * + * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work + * with minimal overhead. + * + * ``` + * var boundFunction = bindPromiseFn(FunctionReturningAPromise); + * + * boundFunction.then(successHandler, errorHandler); + * ``` + */ +var bindPromiseFn; + +if (global.Promise) { + bindPromiseFn = function (delegate) { + return function() { + var delegatePromise = delegate.apply(this, arguments); + + // if the delegate returned an instance of Promise, forward it. + if (delegatePromise instanceof Promise) { + return delegatePromise; + } + + // Otherwise wrap the Promise-like in a global Promise + return new Promise(function(resolve, reject) { + delegatePromise.then(resolve, reject); + }); + }; + }; +} else { + bindPromiseFn = function (delegate) { + return function () { + return _patchThenable(delegate.apply(this, arguments)); + }; + }; +} + + +function _patchPromiseFnsOnObject(objectPath, fnNames) { + var obj = global; + + var exists = objectPath.every(function (segment) { + obj = obj[segment]; + return obj; + }); + + if (!exists) { + return; + } + + fnNames.forEach(function (name) { + var fn = obj[name]; + if (fn) { + obj[name] = bindPromiseFn(fn); + } + }); +} + +function _patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = utils.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + var ocatch = thenable.catch; + thenable.catch = function () { + var args = utils.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + return thenable; +} + + +function apply() { + // Patch .then() and .catch() on native Promises to execute callbacks in the zone where + // those functions are called. + if (global.Promise) { + utils.patchPrototype(Promise.prototype, [ + 'then', + 'catch' + ]); + + // Patch browser APIs that return a Promise + var patchFns = [ + // fetch + [[], ['fetch']], + [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']] + ]; + + patchFns.forEach(function(objPathAndFns) { + _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]); + }); + } +} + +module.exports = { + apply: apply, + bindPromiseFn: bindPromiseFn +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],13:[function(require,module,exports){ +(function (global){ +'use strict'; + +var webSocketPatch = require('./websocket'); +var utils = require('../utils'); +var keys = require('../keys'); + +var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); + +function apply() { + if (utils.isWebWorker()){ + // on WebWorker so don't apply patch + return; + } + + var supportsWebSocket = typeof WebSocket !== 'undefined'; + if (canPatchViaPropertyDescriptor()) { + // for browsers that we can patch the descriptor: Chrome & Firefox + var onEventNames = eventNames.map(function (property) { + return 'on' + property; + }); + utils.patchProperties(HTMLElement.prototype, onEventNames); + utils.patchProperties(XMLHttpRequest.prototype); + if (supportsWebSocket) { + utils.patchProperties(WebSocket.prototype); + } + } else { + // Safari, Android browsers (Jelly Bean) + patchViaCapturingAllTheEvents(); + utils.patchClass('XMLHttpRequest'); + if (supportsWebSocket) { + webSocketPatch.apply(); + } + } +} + +function canPatchViaPropertyDescriptor() { + if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { + // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 + // IDL interface attributes are not configurable + var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); + if (desc && !desc.configurable) return false; + } + + Object.defineProperty(HTMLElement.prototype, 'onclick', { + get: function () { + return true; + } + }); + var elt = document.createElement('div'); + var result = !!elt.onclick; + Object.defineProperty(HTMLElement.prototype, 'onclick', {}); + return result; +}; + +var unboundKey = keys.create('unbound'); + +// Whenever any event fires, we check the event target and all parents +// for `onwhatever` properties and replace them with zone-bound functions +// - Chrome (for now) +function patchViaCapturingAllTheEvents() { + eventNames.forEach(function (property) { + var onproperty = 'on' + property; + document.addEventListener(property, function (event) { + var elt = event.target, bound; + while (elt) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { + bound = global.zone.bind(elt[onproperty]); + bound[unboundKey] = elt[onproperty]; + elt[onproperty] = bound; + } + elt = elt.parentElement; + } + }, true); + }); +}; + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(require,module,exports){ +(function (global){ +'use strict'; + +var _redefineProperty = require('./define-property')._redefineProperty; +var utils = require("../utils"); + +function apply() { + if (utils.isWebWorker() || !('registerElement' in global.document)) { + return; + } + + var _registerElement = document.registerElement; + var callbacks = [ + 'createdCallback', + 'attachedCallback', + 'detachedCallback', + 'attributeChangedCallback' + ]; + + document.registerElement = function (name, opts) { + if (opts && opts.prototype) { + callbacks.forEach(function (callback) { + if (opts.prototype.hasOwnProperty(callback)) { + var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = global.zone.bind(descriptor.value); + _redefineProperty(opts.prototype, callback, descriptor); + } else { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + } else if (opts.prototype[callback]) { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + }); + } + + return _registerElement.apply(document, [name, opts]); + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16,"./define-property":6}],15:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +// we have to patch the instance since the proto is non-configurable +function apply() { + var WS = global.WebSocket; + utils.patchEventTargetMethods(WS.prototype); + global.WebSocket = function(a, b) { + var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); + var proxySocket; + + // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance + var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); + if (onmessageDesc && onmessageDesc.configurable === false) { + proxySocket = Object.create(socket); + ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) { + proxySocket[propName] = function() { + return socket[propName].apply(socket, arguments); + }; + }); + } else { + // we can patch the real socket + proxySocket = socket; + } + + utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']); + + return proxySocket; + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],16:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('./keys'); + +function bindArguments(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bind(args[i]); + } + } + return args; +}; + +function bindArgumentsOnce(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bindOnce(args[i]); + } + } + return args; +}; + +function patchPrototype(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + obj[name] = function () { + return delegate.apply(this, bindArguments(arguments)); + }; + } + }); +}; + +function isWebWorker() { + return (typeof document === "undefined"); +} + +function patchProperty(obj, prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop) || { + enumerable: true, + configurable: true + }; + + // A property descriptor cannot have getter/setter and be writable + // deleting the writable and value properties avoids this error: + // + // TypeError: property descriptors must not specify a value or be writable when a + // getter or setter has been specified + delete desc.writable; + delete desc.value; + + // substr(2) cuz 'onclick' -> 'click', etc + var eventName = prop.substr(2); + var _prop = '_' + prop; + + desc.set = function (fn) { + if (this[_prop]) { + this.removeEventListener(eventName, this[_prop]); + } + + if (typeof fn === 'function') { + this[_prop] = fn; + this.addEventListener(eventName, fn, false); + } else { + this[_prop] = null; + } + }; + + desc.get = function () { + return this[_prop]; + }; + + Object.defineProperty(obj, prop, desc); +}; + +function patchProperties(obj, properties) { + (properties || (function () { + var props = []; + for (var prop in obj) { + props.push(prop); + } + return props; + }()). + filter(function (propertyName) { + return propertyName.substr(0,2) === 'on'; + })). + forEach(function (eventName) { + patchProperty(obj, eventName); + }); +}; + +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + +function patchEventTargetMethods(obj) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + var fn; + //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 + if (handler.toString() !== "[object FunctionWrapper]") { + if (handler.handleEvent) { + // Have to pass in 'handler' reference as an argument here, otherwise it gets clobbered in + // IE9 by the arguments[1] assignment at end of this function. + fn = (function(handler) { + return function() { + handler.handleEvent.apply(handler, arguments); + }; + })(handler); + } else { + fn = handler; + } + + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` (= `self`) + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + return global.zone.addEventListener.apply(target, arguments); + }; + + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + var result = global.zone.removeEventListener.apply(target, arguments); + global.zone.dequeueTask(handler[originalFnKey]); + return result; + }; +}; + +var originalInstanceKey = keys.create('originalInstance'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function () { + var a = bindArguments(arguments); + switch (a.length) { + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; + default: throw new Error('what are you even doing?'); + } + }; + + var instance = new OriginalClass(); + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } + + for (prop in OriginalClass) { + if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { + global[className][prop] = OriginalClass[prop]; + } + } +}; + +module.exports = { + bindArguments: bindArguments, + bindArgumentsOnce: bindArgumentsOnce, + patchPrototype: patchPrototype, + patchProperty: patchProperty, + patchProperties: patchProperties, + patchEventTargetMethods: patchEventTargetMethods, + patchClass: patchClass, + isWebWorker: isWebWorker +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./keys":3}],17:[function(require,module,exports){ +(function (process,global){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 3.0.2 + */ + +(function() { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x === 'function' || (typeof x === 'object' && x !== null); + } + + function lib$es6$promise$utils$$isFunction(x) { + return typeof x === 'function'; + } + + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } + + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + lib$es6$promise$utils$$_isArray = Array.isArray; + } + + var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len = 0; + var lib$es6$promise$asap$$toString = {}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + + var lib$es6$promise$asap$$asap = function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg; + lib$es6$promise$asap$$len += 2; + if (lib$es6$promise$asap$$len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + } + + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn = scheduleFn; + } + + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap = asapFn; + } + + var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + // test for web worker but not in IE10 + var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && + typeof importScripts !== 'undefined' && + typeof MessageChannel !== 'undefined'; + + // node + function lib$es6$promise$asap$$useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function() { + process.nextTick(lib$es6$promise$asap$$flush); + }; + } + + // vertx + function lib$es6$promise$asap$$useVertxTimer() { + return function() { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + + function lib$es6$promise$asap$$useMutationObserver() { + var iterations = 0; + var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function() { + node.data = (iterations = ++iterations % 2); + }; + } + + // web worker + function lib$es6$promise$asap$$useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + + function lib$es6$promise$asap$$useSetTimeout() { + return function() { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + + var lib$es6$promise$asap$$queue = new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) { + var callback = lib$es6$promise$asap$$queue[i]; + var arg = lib$es6$promise$asap$$queue[i+1]; + + callback(arg); + + lib$es6$promise$asap$$queue[i] = undefined; + lib$es6$promise$asap$$queue[i+1] = undefined; + } + + lib$es6$promise$asap$$len = 0; + } + + function lib$es6$promise$asap$$attemptVertx() { + try { + var r = require; + var vertx = r('vertx'); + lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } catch(e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + + var lib$es6$promise$asap$$scheduleFlush; + // Decide what async method to use to triggering processing of queued callbacks: + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick(); + } else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver(); + } else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); + } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); + } else { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); + } + + function lib$es6$promise$$internal$$noop() {} + + var lib$es6$promise$$internal$$PENDING = void 0; + var lib$es6$promise$$internal$$FULFILLED = 1; + var lib$es6$promise$$internal$$REJECTED = 2; + + var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } catch(error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error = error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } + } + + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function(promise) { + var sealed = false; + var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + lib$es6$promise$$internal$$resolve(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function(reason) { + if (sealed) { return; } + sealed = true; + + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor === promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } else { + var then = lib$es6$promise$$internal$$getThen(maybeThenable); + + if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } else if (then === undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); + } else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + lib$es6$promise$$internal$$publish(promise); + } + + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + + promise._result = value; + promise._state = lib$es6$promise$$internal$$FULFILLED; + + if (promise._subscribers.length !== 0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + promise._state = lib$es6$promise$$internal$$REJECTED; + promise._result = reason; + + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onerror = null; + + subscribers[length] = child; + subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment; + subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection; + + if (length === 0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + + function lib$es6$promise$$internal$$publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { return; } + + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; + } + + function lib$es6$promise$$internal$$ErrorObject() { + this.error = null; + } + + var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback = lib$es6$promise$utils$$isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = lib$es6$promise$$internal$$tryCatch(callback, detail); + + if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } + + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + + } else { + value = detail; + succeeded = true; + } + + if (promise._state !== lib$es6$promise$$internal$$PENDING) { + // noop + } else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } else if (settled === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value){ + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } catch(e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator = this; + + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; + + enumerator._init(); + + if (enumerator.length === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } else { + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) { + return lib$es6$promise$utils$$isArray(input); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._init = function() { + this._result = new Array(this.length); + }; + + var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator; + + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() { + var enumerator = this; + + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { + var enumerator = this; + var c = enumerator._instanceConstructor; + + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) { + entry._onerror = null; + enumerator._settledAt(entry._state, i, entry._result); + } else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } else { + enumerator._remaining--; + enumerator._result[i] = entry; + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { + var enumerator = this; + var promise = enumerator.promise; + + if (promise._state === lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + + if (state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } else { + enumerator._result[i] = value; + } + } + + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; + + lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; + } + var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject; + + var lib$es6$promise$promise$$counter = 0; + + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + var lib$es6$promise$promise$$default = lib$es6$promise$promise$$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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {function} resolver + Useful for tooling. + @constructor + */ + function lib$es6$promise$promise$$Promise(resolver) { + this._id = lib$es6$promise$promise$$counter++; + this._state = undefined; + this._result = undefined; + this._subscribers = []; + + if (lib$es6$promise$$internal$$noop !== resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + + lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap; + + lib$es6$promise$promise$$Promise.prototype = { + constructor: lib$es6$promise$promise$$Promise, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + then: function(onFulfillment, onRejection) { + var parent = this; + var state = parent._state; + + if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + + var child = new this.constructor(lib$es6$promise$$internal$$noop); + var result = parent._result; + + if (state) { + var callback = arguments[state - 1]; + lib$es6$promise$asap$$asap(function(){ + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + + return child; + }, + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + 'catch': function(onRejection) { + return this.then(null, onRejection); + } + }; + function lib$es6$promise$polyfill$$polyfill() { + var local; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) { + return; + } + + local.Promise = lib$es6$promise$promise$$default; + } + var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill; + + var lib$es6$promise$umd$$ES6Promise = { + 'Promise': lib$es6$promise$promise$$default, + 'polyfill': lib$es6$promise$polyfill$$default + }; + + /* global define:true module:true window: true */ + if (typeof define === 'function' && define['amd']) { + define(function() { return lib$es6$promise$umd$$ES6Promise; }); + } else if (typeof module !== 'undefined' && module['exports']) { + module['exports'] = lib$es6$promise$umd$$ES6Promise; + } else if (typeof this !== 'undefined') { + this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise; + } + + lib$es6$promise$polyfill$$default(); +}).call(this); + + +}).call(this,{},typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + if (IsUndefined(metadataMap)) { + return false; + } + if (!metadataMap.delete(metadataKey)) { + return false; + } + if (metadataMap.size > 0) { + return true; + } + var targetMetadata = __Metadata__.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) { + return true; + } + __Metadata__.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) { + throw new TypeError(); + } + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) { + throw new TypeError(); + } + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = __Metadata__.get(target); + if (!targetMetadata) { + if (!create) { + return undefined; + } + targetMetadata = new _Map(); + __Metadata__.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) { + return undefined; + } + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return true; + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryHasMetadata(MetadataKey, parent, P); + } + return false; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return false; + } + return Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryGetMetadata(MetadataKey, parent, P); + } + return undefined; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return undefined; + } + return metadataMap.get(MetadataKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) { + return ownKeys; + } + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) { + return ownKeys; + } + if (ownKeys.length <= 0) { + return parentKeys; + } + var set = new _Set(); + var keys = []; + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) { + metadataMap.forEach(function (_, key) { return keys.push(key); }); + } + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray(x); + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + if (IsSymbol(value)) { + return value; + } + return String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) { + return proto; + } + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) { + return proto; + } + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) { + return proto; + } + // if the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") { + return proto; + } + // if we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) { + return proto; + } + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + function Map() { + this._keys = []; + this._values = []; + this._cache = cacheSentinel; + } + Map.prototype = { + get size() { + return this._keys.length; + }, + has: function (key) { + if (key === this._cache) { + return true; + } + if (this._find(key) >= 0) { + this._cache = key; + return true; + } + return false; + }, + get: function (key) { + var index = this._find(key); + if (index >= 0) { + this._cache = key; + return this._values[index]; + } + return undefined; + }, + set: function (key, value) { + this.delete(key); + this._keys.push(key); + this._values.push(value); + this._cache = key; + return this; + }, + delete: function (key) { + var index = this._find(key); + if (index >= 0) { + this._keys.splice(index, 1); + this._values.splice(index, 1); + this._cache = cacheSentinel; + return true; + } + return false; + }, + clear: function () { + this._keys.length = 0; + this._values.length = 0; + this._cache = cacheSentinel; + }, + forEach: function (callback, thisArg) { + var size = this.size; + for (var i = 0; i < size; ++i) { + var key = this._keys[i]; + var value = this._values[i]; + this._cache = key; + callback.call(this, value, key, this); + } + }, + _find: function (key) { + var keys = this._keys; + var size = keys.length; + for (var i = 0; i < size; ++i) { + if (keys[i] === key) { + return i; + } + } + return -1; + } + }; + return Map; + } + // naive Set shim + function CreateSetPolyfill() { + var cacheSentinel = {}; + function Set() { + this._map = new _Map(); + } + Set.prototype = { + get size() { + return this._map.length; + }, + has: function (value) { + return this._map.has(value); + }, + add: function (value) { + this._map.set(value, value); + return this; + }, + delete: function (value) { + return this._map.delete(value); + }, + clear: function () { + this._map.clear(); + }, + forEach: function (callback, thisArg) { + this._map.forEach(callback, thisArg); + } + }; + return Set; + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; + var nodeCrypto = isNode && require("crypto"); + var hasOwn = Object.prototype.hasOwnProperty; + var keys = {}; + var rootKey = CreateUniqueKey(); + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype = { + has: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return this._key in table; + } + return false; + }, + get: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return table[this._key]; + } + return undefined; + }, + set: function (target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }, + delete: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table && this._key in table) { + return delete table[this._key]; + } + return false; + }, + clear: function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + } + }; + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) { + buffer[i] = Math.random() * 255 | 0; + } + } + function GenRandomBytes(size) { + if (nodeCrypto) { + var data = nodeCrypto.randomBytes(size); + return data; + } + else if (typeof Uint8Array === "function") { + var data = new Uint8Array(size); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(data); + } + else if (typeof msCrypto !== "undefined") { + msCrypto.getRandomValues(data); + } + else { + FillRandomBytes(data, size); + } + return data; + } + else { + var data = new Array(size); + FillRandomBytes(data, size); + return data; + } + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) { + result += "-"; + } + if (byte < 16) { + result += "0"; + } + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do { + key = "@@WeakMap@@" + CreateUUID(); + } while (hasOwn.call(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) { + return undefined; + } + Object.defineProperty(target, rootKey, { value: Object.create(null) }); + } + return target[rootKey]; + } + return WeakMap; + } + // hook global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + __global.Reflect[p] = Reflect[p]; + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURLDisabled=Reflect.js.map +"format register"; +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Class = decorators_1.Class; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var _EMPTY_ATTR_VALUE = ''; + var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); + var CssSelector = (function() { + function CssSelector() { + this.element = null; + this.classNames = []; + this.attrs = []; + this.notSelectors = []; + } + CssSelector.parse = function(selector) { + var results = []; + var _addResult = function(res, cssSel) { + if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { + cssSel.element = "*"; + } + res.push(cssSel); + }; + var cssSelector = new CssSelector(); + var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); + var match; + var current = cssSelector; + var inNot = false; + while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { + if (lang_1.isPresent(match[1])) { + if (inNot) { + throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); + } + inNot = true; + current = new CssSelector(); + cssSelector.notSelectors.push(current); + } + if (lang_1.isPresent(match[2])) { + current.setElement(match[2]); + } + if (lang_1.isPresent(match[3])) { + current.addClassName(match[3]); + } + if (lang_1.isPresent(match[4])) { + current.addAttribute(match[4], match[5]); + } + if (lang_1.isPresent(match[6])) { + inNot = false; + current = cssSelector; + } + if (lang_1.isPresent(match[7])) { + if (inNot) { + throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); + } + _addResult(results, cssSelector); + cssSelector = current = new CssSelector(); + } + } + _addResult(results, cssSelector); + return results; + }; + CssSelector.prototype.isElementSelector = function() { + return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; + }; + CssSelector.prototype.setElement = function(element) { + if (element === void 0) { + element = null; + } + if (lang_1.isPresent(element)) { + element = element.toLowerCase(); + } + this.element = element; + }; + CssSelector.prototype.getMatchingElementTemplate = function() { + var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; + var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; + var attrs = ''; + for (var i = 0; i < this.attrs.length; i += 2) { + var attrName = this.attrs[i]; + var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; + attrs += " " + attrName + attrValue; + } + return "<" + tagName + classAttr + attrs + ">"; + }; + CssSelector.prototype.addAttribute = function(name, value) { + if (value === void 0) { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(name.toLowerCase()); + if (lang_1.isPresent(value)) { + value = value.toLowerCase(); + } else { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(value); + }; + CssSelector.prototype.addClassName = function(name) { + this.classNames.push(name.toLowerCase()); + }; + CssSelector.prototype.toString = function() { + var res = ''; + if (lang_1.isPresent(this.element)) { + res += this.element; + } + if (lang_1.isPresent(this.classNames)) { + for (var i = 0; i < this.classNames.length; i++) { + res += '.' + this.classNames[i]; + } + } + if (lang_1.isPresent(this.attrs)) { + for (var i = 0; i < this.attrs.length; ) { + var attrName = this.attrs[i++]; + var attrValue = this.attrs[i++]; + res += '[' + attrName; + if (attrValue.length > 0) { + res += '=' + attrValue; + } + res += ']'; + } + } + this.notSelectors.forEach(function(notSelector) { + return res += ":not(" + notSelector + ")"; + }); + return res; + }; + return CssSelector; + })(); + exports.CssSelector = CssSelector; + var SelectorMatcher = (function() { + function SelectorMatcher() { + this._elementMap = new collection_1.Map(); + this._elementPartialMap = new collection_1.Map(); + this._classMap = new collection_1.Map(); + this._classPartialMap = new collection_1.Map(); + this._attrValueMap = new collection_1.Map(); + this._attrValuePartialMap = new collection_1.Map(); + this._listContexts = []; + } + SelectorMatcher.createNotMatcher = function(notSelectors) { + var notMatcher = new SelectorMatcher(); + notMatcher.addSelectables(notSelectors, null); + return notMatcher; + }; + SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { + var listContext = null; + if (cssSelectors.length > 1) { + listContext = new SelectorListContext(cssSelectors); + this._listContexts.push(listContext); + } + for (var i = 0; i < cssSelectors.length; i++) { + this._addSelectable(cssSelectors[i], callbackCtxt, listContext); + } + }; + SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { + var matcher = this; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); + if (lang_1.isPresent(element)) { + var isTerminal = attrs.length === 0 && classNames.length === 0; + if (isTerminal) { + this._addTerminal(matcher._elementMap, element, selectable); + } else { + matcher = this._addPartial(matcher._elementPartialMap, element); + } + } + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var isTerminal = attrs.length === 0 && index === classNames.length - 1; + var className = classNames[index]; + if (isTerminal) { + this._addTerminal(matcher._classMap, className, selectable); + } else { + matcher = this._addPartial(matcher._classPartialMap, className); + } + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var isTerminal = index === attrs.length - 2; + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + if (isTerminal) { + var terminalMap = matcher._attrValueMap; + var terminalValuesMap = terminalMap.get(attrName); + if (lang_1.isBlank(terminalValuesMap)) { + terminalValuesMap = new collection_1.Map(); + terminalMap.set(attrName, terminalValuesMap); + } + this._addTerminal(terminalValuesMap, attrValue, selectable); + } else { + var parttialMap = matcher._attrValuePartialMap; + var partialValuesMap = parttialMap.get(attrName); + if (lang_1.isBlank(partialValuesMap)) { + partialValuesMap = new collection_1.Map(); + parttialMap.set(attrName, partialValuesMap); + } + matcher = this._addPartial(partialValuesMap, attrValue); + } + } + } + }; + SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { + var terminalList = map.get(name); + if (lang_1.isBlank(terminalList)) { + terminalList = []; + map.set(name, terminalList); + } + terminalList.push(selectable); + }; + SelectorMatcher.prototype._addPartial = function(map, name) { + var matcher = map.get(name); + if (lang_1.isBlank(matcher)) { + matcher = new SelectorMatcher(); + map.set(name, matcher); + } + return matcher; + }; + SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { + var result = false; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + for (var i = 0; i < this._listContexts.length; i++) { + this._listContexts[i].alreadyMatched = false; + } + result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var className = classNames[index]; + result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + var terminalValuesMap = this._attrValueMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; + var partialValuesMap = this._attrValuePartialMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; + } + } + return result; + }; + SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var selectables = map.get(name); + var starSelectables = map.get("*"); + if (lang_1.isPresent(starSelectables)) { + selectables = selectables.concat(starSelectables); + } + if (lang_1.isBlank(selectables)) { + return false; + } + var selectable; + var result = false; + for (var index = 0; index < selectables.length; index++) { + selectable = selectables[index]; + result = selectable.finalize(cssSelector, matchedCallback) || result; + } + return result; + }; + SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var nestedSelector = map.get(name); + if (lang_1.isBlank(nestedSelector)) { + return false; + } + return nestedSelector.match(cssSelector, matchedCallback); + }; + return SelectorMatcher; + })(); + exports.SelectorMatcher = SelectorMatcher; + var SelectorListContext = (function() { + function SelectorListContext(selectors) { + this.selectors = selectors; + this.alreadyMatched = false; + } + return SelectorListContext; + })(); + exports.SelectorListContext = SelectorListContext; + var SelectorContext = (function() { + function SelectorContext(selector, cbContext, listContext) { + this.selector = selector; + this.cbContext = cbContext; + this.listContext = listContext; + this.notSelectors = selector.notSelectors; + } + SelectorContext.prototype.finalize = function(cssSelector, callback) { + var result = true; + if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); + result = !notMatcher.match(cssSelector, null); + } + if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + if (lang_1.isPresent(this.listContext)) { + this.listContext.alreadyMatched = true; + } + callback(this.selector, this.cbContext); + } + return result; + }; + return SelectorContext; + })(); + exports.SelectorContext = SelectorContext; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\$/g; + var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\$/g; + exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + function escapeSingleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; + } + exports.escapeSingleQuoteString = escapeSingleQuoteString; + function escapeDoubleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; + } + exports.escapeDoubleQuoteString = escapeDoubleQuoteString; + function escapeString(input, re) { + return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { + if (match[0] == '$') { + return lang_1.IS_DART ? '\\$' : '$'; + } else if (match[0] == '\n') { + return '\\n'; + } else { + return "\\" + match[0]; + } + }); + } + function codeGenExportVariable(name) { + if (lang_1.IS_DART) { + return "const " + name + " = "; + } else { + return "var " + name + " = exports['" + name + "'] = "; + } + } + exports.codeGenExportVariable = codeGenExportVariable; + function codeGenConstConstructorCall(name) { + if (lang_1.IS_DART) { + return "const " + name; + } else { + return "new " + name; + } + } + exports.codeGenConstConstructorCall = codeGenConstConstructorCall; + function codeGenValueFn(params, value, fnName) { + if (fnName === void 0) { + fnName = ''; + } + if (lang_1.IS_DART) { + return fnName + "(" + params.join(',') + ") => " + value; + } else { + return "function " + fnName + "(" + params.join(',') + ") { return " + value + "; }"; + } + } + exports.codeGenValueFn = codeGenValueFn; + function codeGenToString(expr) { + if (lang_1.IS_DART) { + return "'${" + expr + "}'"; + } else { + return expr; + } + } + exports.codeGenToString = codeGenToString; + function splitAtColon(input, defaultValues) { + var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); + if (parts.length > 1) { + return parts; + } else { + return defaultValues; + } + } + exports.splitAtColon = splitAtColon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; + function moduleRef(moduleUrl) { + return "#MODULE[" + moduleUrl + "]"; + } + exports.moduleRef = moduleRef; + var SourceModule = (function() { + function SourceModule(moduleUrl, sourceWithModuleRefs) { + this.moduleUrl = moduleUrl; + this.sourceWithModuleRefs = sourceWithModuleRefs; + } + SourceModule.prototype.getSourceWithImports = function() { + var _this = this; + var moduleAliases = {}; + var imports = []; + var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { + var moduleUrl = match[1]; + var alias = moduleAliases[moduleUrl]; + if (lang_1.isBlank(alias)) { + if (moduleUrl == _this.moduleUrl) { + alias = ''; + } else { + alias = "import" + imports.length; + imports.push([moduleUrl, alias]); + } + moduleAliases[moduleUrl] = alias; + } + return alias.length > 0 ? alias + "." : ''; + }); + return new SourceWithImports(newSource, imports); + }; + return SourceModule; + })(); + exports.SourceModule = SourceModule; + var SourceExpression = (function() { + function SourceExpression(declarations, expression) { + this.declarations = declarations; + this.expression = expression; + } + return SourceExpression; + })(); + exports.SourceExpression = SourceExpression; + var SourceExpressions = (function() { + function SourceExpressions(declarations, expressions) { + this.declarations = declarations; + this.expressions = expressions; + } + return SourceExpressions; + })(); + exports.SourceExpressions = SourceExpressions; + var SourceWithImports = (function() { + function SourceWithImports(source, imports) { + this.source = source; + this.imports = imports; + } + return SourceWithImports; + })(); + exports.SourceWithImports = SourceWithImports; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var TextAst = (function() { + function TextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + TextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return TextAst; + })(); + exports.TextAst = TextAst; + var BoundTextAst = (function() { + function BoundTextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + BoundTextAst.prototype.visit = function(visitor, context) { + return visitor.visitBoundText(this, context); + }; + return BoundTextAst; + })(); + exports.BoundTextAst = BoundTextAst; + var AttrAst = (function() { + function AttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + AttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return AttrAst; + })(); + exports.AttrAst = AttrAst; + var BoundElementPropertyAst = (function() { + function BoundElementPropertyAst(name, type, value, unit, sourceInfo) { + this.name = name; + this.type = type; + this.value = value; + this.unit = unit; + this.sourceInfo = sourceInfo; + } + BoundElementPropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitElementProperty(this, context); + }; + return BoundElementPropertyAst; + })(); + exports.BoundElementPropertyAst = BoundElementPropertyAst; + var BoundEventAst = (function() { + function BoundEventAst(name, target, handler, sourceInfo) { + this.name = name; + this.target = target; + this.handler = handler; + this.sourceInfo = sourceInfo; + } + BoundEventAst.prototype.visit = function(visitor, context) { + return visitor.visitEvent(this, context); + }; + Object.defineProperty(BoundEventAst.prototype, "fullName", { + get: function() { + if (lang_1.isPresent(this.target)) { + return this.target + ":" + this.name; + } else { + return this.name; + } + }, + enumerable: true, + configurable: true + }); + return BoundEventAst; + })(); + exports.BoundEventAst = BoundEventAst; + var VariableAst = (function() { + function VariableAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + VariableAst.prototype.visit = function(visitor, context) { + return visitor.visitVariable(this, context); + }; + return VariableAst; + })(); + exports.VariableAst = VariableAst; + var ElementAst = (function() { + function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.inputs = inputs; + this.outputs = outputs; + this.exportAsVars = exportAsVars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + ElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + ElementAst.prototype.isBound = function() { + return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); + }; + ElementAst.prototype.getComponent = function() { + return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; + }; + return ElementAst; + })(); + exports.ElementAst = ElementAst; + var EmbeddedTemplateAst = (function() { + function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceInfo) { + this.attrs = attrs; + this.outputs = outputs; + this.vars = vars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + EmbeddedTemplateAst.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return EmbeddedTemplateAst; + })(); + exports.EmbeddedTemplateAst = EmbeddedTemplateAst; + var BoundDirectivePropertyAst = (function() { + function BoundDirectivePropertyAst(directiveName, templateName, value, sourceInfo) { + this.directiveName = directiveName; + this.templateName = templateName; + this.value = value; + this.sourceInfo = sourceInfo; + } + BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitDirectiveProperty(this, context); + }; + return BoundDirectivePropertyAst; + })(); + exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; + var DirectiveAst = (function() { + function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceInfo) { + this.directive = directive; + this.inputs = inputs; + this.hostProperties = hostProperties; + this.hostEvents = hostEvents; + this.exportAsVars = exportAsVars; + this.sourceInfo = sourceInfo; + } + DirectiveAst.prototype.visit = function(visitor, context) { + return visitor.visitDirective(this, context); + }; + return DirectiveAst; + })(); + exports.DirectiveAst = DirectiveAst; + var NgContentAst = (function() { + function NgContentAst(index, ngContentIndex, sourceInfo) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + NgContentAst.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return NgContentAst; + })(); + exports.NgContentAst = NgContentAst; + (function(PropertyBindingType) { + PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; + PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; + PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; + PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; + })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); + var PropertyBindingType = exports.PropertyBindingType; + function templateVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.templateVisitAll = templateVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Codegen = (function() { + function Codegen(moduleAlias) {} + Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { + throw "Not implemented in JS"; + }; + Codegen.prototype.toString = function() { + throw "Not implemented in JS"; + }; + return Codegen; + })(); + exports.Codegen = Codegen; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var ShadowCss = (function() { + function ShadowCss() { + this.strictStyling = true; + } + ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { + if (hostSelector === void 0) { + hostSelector = ''; + } + cssText = stripComments(cssText); + cssText = this._insertDirectives(cssText); + return this._scopeCssText(cssText, selector, hostSelector); + }; + ShadowCss.prototype._insertDirectives = function(cssText) { + cssText = this._insertPolyfillDirectivesInCssText(cssText); + return this._insertPolyfillRulesInCssText(cssText); + }; + ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { + return m[1] + '{'; + }); + }; + ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[1], ''); + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + return m[3] + rule; + }); + }; + ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { + var unscoped = this._extractUnscopedRulesFromCssText(cssText); + cssText = this._insertPolyfillHostInCssText(cssText); + cssText = this._convertColonHost(cssText); + cssText = this._convertColonHostContext(cssText); + cssText = this._convertShadowDOMSelectors(cssText); + if (lang_1.isPresent(scopeSelector)) { + cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); + } + cssText = cssText + '\n' + unscoped; + return cssText.trim(); + }; + ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { + var r = '', + m; + var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); + while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); + r += rule + '\n\n'; + } + return r; + }; + ShadowCss.prototype._convertColonHost = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); + }; + ShadowCss.prototype._convertColonHostContext = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); + }; + ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { + return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { + if (lang_1.isPresent(m[2])) { + var parts = m[2].split(','), + r = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + if (lang_1.isBlank(p)) + break; + p = p.trim(); + r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); + } + return r.join(','); + } else { + return _polyfillHostNoCombinator + m[3]; + } + }); + }; + ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { + if (lang_1.StringWrapper.contains(part, _polyfillHost)) { + return this._colonHostPartReplacer(host, part, suffix); + } else { + return host + part + suffix + ', ' + part + ' ' + host + suffix; + } + }; + ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { + return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; + }; + ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { + for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { + cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); + } + return cssText; + }; + ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { + var _this = this; + return processRules(cssText, function(rule) { + var selector = rule.selector; + var content = rule.content; + if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { + selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); + } else if (rule.selector.startsWith('@media')) { + content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); + } + return new CssRule(selector, content); + }); + }; + ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { + var r = [], + parts = selector.split(','); + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + p = p.trim(); + if (this._selectorNeedsScoping(p, scopeSelector)) { + p = strict && !lang_1.StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector); + } + r.push(p); + } + return r.join(', '); + }; + ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { + var re = this._makeScopeMatcher(scopeSelector); + return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); + }; + ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { + var lre = /\[/g; + var rre = /\]/g; + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); + return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); + }; + ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { + return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); + }; + ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { + if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { + var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; + selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); + return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); + } else { + return scopeSelector + ' ' + selector; + } + }; + ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { + var isRe = /\[is=([^\]]*)\]/g; + scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { + return m[1]; + }); + var splits = [' ', '>', '+', '~'], + scoped = selector, + attrName = '[' + scopeSelector + ']'; + for (var i = 0; i < splits.length; i++) { + var sep = splits[i]; + var parts = scoped.split(sep); + scoped = parts.map(function(p) { + var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); + if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { + var re = /([^:]*)(:*)(.*)/g; + var m = lang_1.RegExpWrapper.firstMatch(re, t); + if (lang_1.isPresent(m)) { + p = m[1] + attrName + m[2] + m[3]; + } + } + return p; + }).join(sep); + } + return scoped; + }; + ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); + return selector; + }; + return ShadowCss; + })(); + exports.ShadowCss = ShadowCss; + var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; + var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _polyfillHost = '-shadowcsshost'; + var _polyfillHostContext = '-shadowcsscontext'; + var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; + var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); + var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); + var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; + var _shadowDOMSelectorsRe = [/>>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow-deep\//g, /\/shadow\//g]; + var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; + var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); + var _colonHostRe = /:host/gim; + var _colonHostContextRe = /:host-context/gim; + var _commentRe = /\/\*[\s\S]*?\*\//g; + function stripComments(input) { + return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { + return ''; + }); + } + var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; + var _curlyRe = /([{}])/g; + var OPEN_CURLY = '{'; + var CLOSE_CURLY = '}'; + var BLOCK_PLACEHOLDER = '%BLOCK%'; + var CssRule = (function() { + function CssRule(selector, content) { + this.selector = selector; + this.content = content; + } + return CssRule; + })(); + exports.CssRule = CssRule; + function processRules(input, ruleCallback) { + var inputWithEscapedBlocks = escapeBlocks(input); + var nextBlockIndex = 0; + return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { + var selector = m[2]; + var content = ''; + var suffix = m[4]; + var contentPrefix = ''; + if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { + content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; + suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); + contentPrefix = '{'; + } + var rule = ruleCallback(new CssRule(selector, content)); + return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; + }); + } + exports.processRules = processRules; + var StringWithEscapedBlocks = (function() { + function StringWithEscapedBlocks(escapedString, blocks) { + this.escapedString = escapedString; + this.blocks = blocks; + } + return StringWithEscapedBlocks; + })(); + function escapeBlocks(input) { + var inputParts = lang_1.StringWrapper.split(input, _curlyRe); + var resultParts = []; + var escapedBlocks = []; + var bracketCount = 0; + var currentBlockParts = []; + for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { + var part = inputParts[partIndex]; + if (part == CLOSE_CURLY) { + bracketCount--; + } + if (bracketCount > 0) { + currentBlockParts.push(part); + } else { + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + currentBlockParts = []; + } + resultParts.push(part); + } + if (part == OPEN_CURLY) { + bracketCount++; + } + } + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + } + return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var StyleWithImports = (function() { + function StyleWithImports(style, styleUrls) { + this.style = style; + this.styleUrls = styleUrls; + } + return StyleWithImports; + })(); + exports.StyleWithImports = StyleWithImports; + function isStyleUrlResolvable(url) { + if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') + return false; + var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); + return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; + } + exports.isStyleUrlResolvable = isStyleUrlResolvable; + function extractStyleUrls(resolver, baseUrl, cssText) { + var foundUrls = []; + var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { + var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; + if (!isStyleUrlResolvable(url)) { + return m[0]; + } + foundUrls.push(resolver.resolve(baseUrl, url)); + return ''; + }); + return new StyleWithImports(modifiedCssText, foundUrls); + } + exports.extractStyleUrls = extractStyleUrls; + var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; + var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/command_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/template_commands", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + exports.TEMPLATE_COMMANDS_MODULE_REF = source_module_1.moduleRef("package:angular2/src/core/linker/template_commands" + util_1.MODULE_SUFFIX); + var IMPLICIT_TEMPLATE_VAR = '\$implicit'; + var CLASS_ATTR = 'class'; + var STYLE_ATTR = 'style'; + var CommandCompiler = (function() { + function CommandCompiler() {} + CommandCompiler.prototype.compileComponentRuntime = function(component, template, changeDetectorFactories, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories), 0); + template_ast_1.templateVisitAll(visitor, template); + return visitor.result; + }; + CommandCompiler.prototype.compileComponentCodeGen = function(component, template, changeDetectorFactoryExpressions, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions), 0); + template_ast_1.templateVisitAll(visitor, template); + return new source_module_1.SourceExpression([], codeGenArray(visitor.result)); + }; + CommandCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], CommandCompiler); + return CommandCompiler; + })(); + exports.CommandCompiler = CommandCompiler; + var RuntimeCommandFactory = (function() { + function RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactories = changeDetectorFactories; + } + RuntimeCommandFactory.prototype._mapDirectives = function(directives) { + return directives.map(function(directive) { + return directive.type.runtime; + }); + }; + RuntimeCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new template_commands_1.TextCmd(value, isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new template_commands_1.NgContentCmd(index, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + return new template_commands_1.BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createEndElement = function() { + return new template_commands_1.EndElementCmd(); + }; + RuntimeCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var nestedTemplateAccessor = this.componentTemplateFactory(directives[0]); + return new template_commands_1.BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), encapsulation, ngContentIndex, nestedTemplateAccessor); + }; + RuntimeCommandFactory.prototype.createEndComponent = function() { + return new template_commands_1.EndComponentCmd(); + }; + RuntimeCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new template_commands_1.EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, this._mapDirectives(directives), isMerged, ngContentIndex, this.changeDetectorFactories[embeddedTemplateIndex], children); + }; + return RuntimeCommandFactory; + })(); + var CodegenCommandFactory = (function() { + function CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactoryExpressions = changeDetectorFactoryExpressions; + } + CodegenCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'TextCmd') + "(" + util_1.escapeSingleQuoteString(value) + ", " + isBound + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'NgContentCmd') + "(" + index + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginElementCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + isBound + ", " + ngContentIndex + ")")); + }; + CodegenCommandFactory.prototype.createEndElement = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndElementCmd') + "()"); + }; + CodegenCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginComponentCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + codeGenViewEncapsulation(encapsulation) + ", " + ngContentIndex + ", " + this.componentTemplateFactory(directives[0]) + ")")); + }; + CodegenCommandFactory.prototype.createEndComponent = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndComponentCmd') + "()"); + }; + CodegenCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EmbeddedTemplateCmd') + "(" + codeGenArray(attrNameAndValues) + ", " + codeGenArray(variableNameAndValues) + ", ") + (codeGenDirectivesArray(directives) + ", " + isMerged + ", " + ngContentIndex + ", " + this.changeDetectorFactoryExpressions[embeddedTemplateIndex] + ", " + codeGenArray(children) + ")")); + }; + return CodegenCommandFactory; + })(); + function visitAndReturnContext(visitor, asts, context) { + template_ast_1.templateVisitAll(visitor, asts, context); + return context; + } + var CommandBuilderVisitor = (function() { + function CommandBuilderVisitor(commandFactory, embeddedTemplateIndex) { + this.commandFactory = commandFactory; + this.embeddedTemplateIndex = embeddedTemplateIndex; + this.result = []; + this.transitiveNgContentCount = 0; + } + CommandBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { + var attrs = keyValueArrayToMap(visitAndReturnContext(this, attrAsts, [])); + directives.forEach(function(directiveMeta) { + collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { + var prevValue = attrs[name]; + attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; + }); + }); + return mapToKeyValueArray(attrs); + }; + CommandBuilderVisitor.prototype.visitNgContent = function(ast, context) { + this.transitiveNgContentCount++; + this.result.push(this.commandFactory.createNgContent(ast.index, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + var _this = this; + this.embeddedTemplateIndex++; + var childVisitor = new CommandBuilderVisitor(this.commandFactory, this.embeddedTemplateIndex); + template_ast_1.templateVisitAll(childVisitor, ast.children); + var isMerged = childVisitor.transitiveNgContentCount > 0; + var variableNameAndValues = []; + ast.vars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR); + }); + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, [], [], directives)); + }); + this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex, this._readAttrNameAndValues(directives, ast.attrs), variableNameAndValues, directives, isMerged, ast.ngContentIndex, childVisitor.result)); + this.transitiveNgContentCount += childVisitor.transitiveNgContentCount; + this.embeddedTemplateIndex = childVisitor.embeddedTemplateIndex; + return null; + }; + CommandBuilderVisitor.prototype.visitElement = function(ast, context) { + var _this = this; + var component = ast.getComponent(); + var eventTargetAndNames = visitAndReturnContext(this, ast.outputs, []); + var variableNameAndValues = []; + if (lang_1.isBlank(component)) { + ast.exportAsVars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(null); + }); + } + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, eventTargetAndNames, variableNameAndValues, directives)); + }); + eventTargetAndNames = removeKeyValueArrayDuplicates(eventTargetAndNames); + var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); + if (lang_1.isPresent(component)) { + this.result.push(this.commandFactory.createBeginComponent(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, component.template.encapsulation, ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndComponent()); + } else { + this.result.push(this.commandFactory.createBeginElement(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, ast.isBound(), ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndElement()); + } + return null; + }; + CommandBuilderVisitor.prototype.visitVariable = function(ast, ctx) { + return null; + }; + CommandBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { + attrNameAndValues.push(ast.name); + attrNameAndValues.push(ast.value); + return null; + }; + CommandBuilderVisitor.prototype.visitBoundText = function(ast, context) { + this.result.push(this.commandFactory.createText(null, true, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitText = function(ast, context) { + this.result.push(this.commandFactory.createText(ast.value, false, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitDirective = function(ast, ctx) { + ctx.targetDirectives.push(ast.directive); + template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.eventTargetAndNames); + ast.exportAsVars.forEach(function(varAst) { + ctx.targetVariableNameAndValues.push(varAst.name); + ctx.targetVariableNameAndValues.push(ctx.index); + }); + return null; + }; + CommandBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { + eventTargetAndNames.push(ast.target); + eventTargetAndNames.push(ast.name); + return null; + }; + CommandBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { + return null; + }; + CommandBuilderVisitor.prototype.visitElementProperty = function(ast, context) { + return null; + }; + return CommandBuilderVisitor; + })(); + function removeKeyValueArrayDuplicates(keyValueArray) { + var knownPairs = new Set(); + var resultKeyValueArray = []; + for (var i = 0; i < keyValueArray.length; i += 2) { + var key = keyValueArray[i]; + var value = keyValueArray[i + 1]; + var pairId = key + ":" + value; + if (!collection_1.SetWrapper.has(knownPairs, pairId)) { + resultKeyValueArray.push(key); + resultKeyValueArray.push(value); + knownPairs.add(pairId); + } + } + return resultKeyValueArray; + } + function keyValueArrayToMap(keyValueArr) { + var data = {}; + for (var i = 0; i < keyValueArr.length; i += 2) { + data[keyValueArr[i]] = keyValueArr[i + 1]; + } + return data; + } + function mapToKeyValueArray(data) { + var entryArray = []; + collection_1.StringMapWrapper.forEach(data, function(value, name) { + entryArray.push([name, value]); + }); + collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + var keyValueArray = []; + entryArray.forEach(function(entry) { + keyValueArray.push(entry[0]); + keyValueArray.push(entry[1]); + }); + return keyValueArray; + } + function mergeAttributeValue(attrName, attrValue1, attrValue2) { + if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { + return attrValue1 + " " + attrValue2; + } else { + return attrValue2; + } + } + var DirectiveContext = (function() { + function DirectiveContext(index, eventTargetAndNames, targetVariableNameAndValues, targetDirectives) { + this.index = index; + this.eventTargetAndNames = eventTargetAndNames; + this.targetVariableNameAndValues = targetVariableNameAndValues; + this.targetDirectives = targetDirectives; + } + return DirectiveContext; + })(); + var Expression = (function() { + function Expression(value) { + this.value = value; + } + return Expression; + })(); + function escapeValue(value) { + if (value instanceof Expression) { + return value.value; + } else if (lang_1.isString(value)) { + return util_1.escapeSingleQuoteString(value); + } else if (lang_1.isBlank(value)) { + return 'null'; + } else { + return "" + value; + } + } + function codeGenArray(data) { + var base = "[" + data.map(escapeValue).join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenDirectivesArray(directives) { + var expressions = directives.map(function(directiveType) { + return ("" + source_module_1.moduleRef(directiveType.type.moduleUrl) + directiveType.type.name); + }); + var base = "[" + expressions.join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenViewEncapsulation(value) { + if (lang_1.IS_DART) { + return "" + exports.TEMPLATE_COMMANDS_MODULE_REF + value; + } else { + return "" + value; + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var HtmlTextAst = (function() { + function HtmlTextAst(value, sourceInfo) { + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlTextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return HtmlTextAst; + })(); + exports.HtmlTextAst = HtmlTextAst; + var HtmlAttrAst = (function() { + function HtmlAttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlAttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return HtmlAttrAst; + })(); + exports.HtmlAttrAst = HtmlAttrAst; + var HtmlElementAst = (function() { + function HtmlElementAst(name, attrs, children, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.children = children; + this.sourceInfo = sourceInfo; + } + HtmlElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + return HtmlElementAst; + })(); + exports.HtmlElementAst = HtmlElementAst; + function htmlVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.htmlVisitAll = htmlVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var NG_CONTENT_SELECT_ATTR = 'select'; + var NG_CONTENT_ELEMENT = 'ng-content'; + var LINK_ELEMENT = 'link'; + var LINK_STYLE_REL_ATTR = 'rel'; + var LINK_STYLE_HREF_ATTR = 'href'; + var LINK_STYLE_REL_VALUE = 'stylesheet'; + var STYLE_ELEMENT = 'style'; + var SCRIPT_ELEMENT = 'script'; + var NG_NON_BINDABLE_ATTR = 'ng-non-bindable'; + function preparseElement(ast) { + var selectAttr = null; + var hrefAttr = null; + var relAttr = null; + var nonBindable = false; + ast.attrs.forEach(function(attr) { + if (attr.name == NG_CONTENT_SELECT_ATTR) { + selectAttr = attr.value; + } else if (attr.name == LINK_STYLE_HREF_ATTR) { + hrefAttr = attr.value; + } else if (attr.name == LINK_STYLE_REL_ATTR) { + relAttr = attr.value; + } else if (attr.name == NG_NON_BINDABLE_ATTR) { + nonBindable = true; + } + }); + selectAttr = normalizeNgContentSelect(selectAttr); + var nodeName = ast.name; + var type = PreparsedElementType.OTHER; + if (nodeName == NG_CONTENT_ELEMENT) { + type = PreparsedElementType.NG_CONTENT; + } else if (nodeName == STYLE_ELEMENT) { + type = PreparsedElementType.STYLE; + } else if (nodeName == SCRIPT_ELEMENT) { + type = PreparsedElementType.SCRIPT; + } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { + type = PreparsedElementType.STYLESHEET; + } + return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable); + } + exports.preparseElement = preparseElement; + (function(PreparsedElementType) { + PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; + PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; + PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; + PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; + PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; + })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); + var PreparsedElementType = exports.PreparsedElementType; + var PreparsedElement = (function() { + function PreparsedElement(type, selectAttr, hrefAttr, nonBindable) { + this.type = type; + this.selectAttr = selectAttr; + this.hrefAttr = hrefAttr; + this.nonBindable = nonBindable; + } + return PreparsedElement; + })(); + exports.PreparsedElement = PreparsedElement; + function normalizeNgContentSelect(selectAttr) { + if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { + return '*'; + } + return selectAttr; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var TemplateNormalizer = (function() { + function TemplateNormalizer(_xhr, _urlResolver, _domParser) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._domParser = _domParser; + } + TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { + var _this = this; + if (lang_1.isPresent(template.template)) { + return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); + } else if (lang_1.isPresent(template.templateUrl)) { + var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); + return this._xhr.get(sourceAbsUrl).then(function(templateContent) { + return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); + }); + } else { + throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); + } + }; + TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { + var _this = this; + var domNodes = this._domParser.parse(template, directiveType.name); + var visitor = new TemplatePreparseVisitor(); + html_ast_1.htmlVisitAll(visitor, domNodes); + var allStyles = templateMeta.styles.concat(visitor.styles); + var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(templateAbsUrl, url); + }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(directiveType.moduleUrl, url); + })); + var allResolvedStyles = allStyles.map(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); + styleWithImports.styleUrls.forEach(function(styleUrl) { + return allStyleAbsUrls.push(styleUrl); + }); + return styleWithImports.style; + }); + var encapsulation = templateMeta.encapsulation; + if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { + encapsulation = view_1.ViewEncapsulation.None; + } + return new directive_metadata_1.CompileTemplateMetadata({ + encapsulation: encapsulation, + template: template, + templateUrl: templateAbsUrl, + styles: allResolvedStyles, + styleUrls: allStyleAbsUrls, + ngContentSelectors: visitor.ngContentSelectors + }); + }; + TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); + return TemplateNormalizer; + })(); + exports.TemplateNormalizer = TemplateNormalizer; + var TemplatePreparseVisitor = (function() { + function TemplatePreparseVisitor() { + this.ngContentSelectors = []; + this.styles = []; + this.styleUrls = []; + this.ngNonBindableStackCount = 0; + } + TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { + var preparsedElement = template_preparser_1.preparseElement(ast); + switch (preparsedElement.type) { + case template_preparser_1.PreparsedElementType.NG_CONTENT: + if (this.ngNonBindableStackCount === 0) { + this.ngContentSelectors.push(preparsedElement.selectAttr); + } + break; + case template_preparser_1.PreparsedElementType.STYLE: + var textContent = ''; + ast.children.forEach(function(child) { + if (child instanceof html_ast_1.HtmlTextAst) { + textContent += child.value; + } + }); + this.styles.push(textContent); + break; + case template_preparser_1.PreparsedElementType.STYLESHEET: + this.styleUrls.push(preparsedElement.hrefAttr); + break; + } + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount++; + } + html_ast_1.htmlVisitAll(this, ast.children); + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount--; + } + return null; + }; + TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + TemplatePreparseVisitor.prototype.visitText = function(ast, context) { + return null; + }; + return TemplatePreparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cpl = require("angular2/src/compiler/directive_metadata"); + var md = require("angular2/src/core/metadata/directives"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var di_2 = require("angular2/src/core/di"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var util_1 = require("angular2/src/compiler/util"); + var RuntimeMetadataResolver = (function() { + function RuntimeMetadataResolver(_directiveResolver, _viewResolver, _platformDirectives) { + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._platformDirectives = _platformDirectives; + this._cache = new Map(); + } + RuntimeMetadataResolver.prototype.getMetadata = function(directiveType) { + var meta = this._cache.get(directiveType); + if (lang_1.isBlank(meta)) { + var dirMeta = this._directiveResolver.resolve(directiveType); + var moduleUrl = calcModuleUrl(directiveType, dirMeta); + var templateMeta = null; + var changeDetectionStrategy = null; + if (dirMeta instanceof md.ComponentMetadata) { + var cmpMeta = dirMeta; + var viewMeta = this._viewResolver.resolve(directiveType); + templateMeta = new cpl.CompileTemplateMetadata({ + encapsulation: viewMeta.encapsulation, + template: viewMeta.template, + templateUrl: viewMeta.templateUrl, + styles: viewMeta.styles, + styleUrls: viewMeta.styleUrls + }); + changeDetectionStrategy = cmpMeta.changeDetection; + } + meta = cpl.CompileDirectiveMetadata.create({ + selector: dirMeta.selector, + exportAs: dirMeta.exportAs, + isComponent: lang_1.isPresent(templateMeta), + dynamicLoadable: true, + type: new cpl.CompileTypeMetadata({ + name: lang_1.stringify(directiveType), + moduleUrl: moduleUrl, + runtime: directiveType + }), + template: templateMeta, + changeDetection: changeDetectionStrategy, + inputs: dirMeta.inputs, + outputs: dirMeta.outputs, + host: dirMeta.host, + lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { + return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); + }) + }); + this._cache.set(directiveType, meta); + } + return meta; + }; + RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { + var _this = this; + var view = this._viewResolver.resolve(component); + var directives = flattenDirectives(view, this._platformDirectives); + for (var i = 0; i < directives.length; i++) { + if (!isValidDirective(directives[i])) { + throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); + } + } + return removeDuplicates(directives).map(function(type) { + return _this.getMetadata(type); + }); + }; + RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(2, di_2.Optional()), __param(2, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, Array])], RuntimeMetadataResolver); + return RuntimeMetadataResolver; + })(); + exports.RuntimeMetadataResolver = RuntimeMetadataResolver; + function removeDuplicates(items) { + var m = new Map(); + items.forEach(function(i) { + return m.set(i, null); + }); + return collection_1.MapWrapper.keys(m); + } + function flattenDirectives(view, platformDirectives) { + var directives = []; + if (lang_1.isPresent(platformDirectives)) { + flattenArray(platformDirectives, directives); + } + if (lang_1.isPresent(view.directives)) { + flattenArray(view.directives, directives); + } + return directives; + } + function flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + flattenArray(item, out); + } else { + out.push(item); + } + } + } + function isValidDirective(value) { + return lang_1.isPresent(value) && (value instanceof lang_1.Type); + } + function calcModuleUrl(type, dirMeta) { + if (lang_1.isPresent(dirMeta.moduleId)) { + return "package:" + dirMeta.moduleId + util_1.MODULE_SUFFIX; + } else { + return reflection_1.reflector.importUri(type); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var promise_1 = require("angular2/src/facade/promise"); + var lang_1 = require("angular2/src/facade/lang"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var XHRImpl = (function(_super) { + __extends(XHRImpl, _super); + function XHRImpl() { + _super.apply(this, arguments); + } + XHRImpl.prototype.get = function(url) { + var completer = promise_1.PromiseWrapper.completer(); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'text'; + xhr.onload = function() { + var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + if (200 <= status && status <= 300) { + completer.resolve(response); + } else { + completer.reject("Failed to load " + url, null); + } + }; + xhr.onerror = function() { + completer.reject("Failed to load " + url, null); + }; + xhr.send(); + return completer.promise; + }; + return XHRImpl; + })(xhr_1.XHR); + exports.XHRImpl = XHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/key_events", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var di_1 = require("angular2/src/core/di"); + var modifierKeys = ['alt', 'control', 'meta', 'shift']; + var modifierKeyGetters = { + 'alt': function(event) { + return event.altKey; + }, + 'control': function(event) { + return event.ctrlKey; + }, + 'meta': function(event) { + return event.metaKey; + }, + 'shift': function(event) { + return event.shiftKey; + } + }; + var KeyEventsPlugin = (function(_super) { + __extends(KeyEventsPlugin, _super); + function KeyEventsPlugin() { + _super.call(this); + } + KeyEventsPlugin.prototype.supports = function(eventName) { + return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); + }; + KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var parsedEvent = KeyEventsPlugin.parseEventName(eventName); + var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); + }); + }; + KeyEventsPlugin.parseEventName = function(eventName) { + var parts = eventName.toLowerCase().split('.'); + var domEventName = parts.shift(); + if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { + return null; + } + var key = KeyEventsPlugin._normalizeKey(parts.pop()); + var fullKey = ''; + modifierKeys.forEach(function(modifierName) { + if (collection_1.ListWrapper.contains(parts, modifierName)) { + collection_1.ListWrapper.remove(parts, modifierName); + fullKey += modifierName + '.'; + } + }); + fullKey += key; + if (parts.length != 0 || key.length === 0) { + return null; + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); + collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); + return result; + }; + KeyEventsPlugin.getEventFullKey = function(event) { + var fullKey = ''; + var key = dom_adapter_1.DOM.getEventKey(event); + key = key.toLowerCase(); + if (lang_1.StringWrapper.equals(key, ' ')) { + key = 'space'; + } else if (lang_1.StringWrapper.equals(key, '.')) { + key = 'dot'; + } + modifierKeys.forEach(function(modifierName) { + if (modifierName != key) { + var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); + if (modifierGetter(event)) { + fullKey += modifierName + '.'; + } + } + }); + fullKey += key; + return fullKey; + }; + KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { + return function(event) { + if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { + zone.run(function() { + return handler(event); + }); + } + }; + }; + KeyEventsPlugin._normalizeKey = function(keyName) { + switch (keyName) { + case 'esc': + return 'escape'; + default: + return keyName; + } + }; + KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); + return KeyEventsPlugin; + })(event_manager_1.EventManagerPlugin); + exports.KeyEventsPlugin = KeyEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_common", ["angular2/src/core/render/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var collection_1 = require("angular2/src/facade/collection"); + var _eventNames = { + 'pan': true, + 'panstart': true, + 'panmove': true, + 'panend': true, + 'pancancel': true, + 'panleft': true, + 'panright': true, + 'panup': true, + 'pandown': true, + 'pinch': true, + 'pinchstart': true, + 'pinchmove': true, + 'pinchend': true, + 'pinchcancel': true, + 'pinchin': true, + 'pinchout': true, + 'press': true, + 'pressup': true, + 'rotate': true, + 'rotatestart': true, + 'rotatemove': true, + 'rotateend': true, + 'rotatecancel': true, + 'swipe': true, + 'swipeleft': true, + 'swiperight': true, + 'swipeup': true, + 'swipedown': true, + 'tap': true + }; + var HammerGesturesPluginCommon = (function(_super) { + __extends(HammerGesturesPluginCommon, _super); + function HammerGesturesPluginCommon() { + _super.call(this); + } + HammerGesturesPluginCommon.prototype.supports = function(eventName) { + eventName = eventName.toLowerCase(); + return collection_1.StringMapWrapper.contains(_eventNames, eventName); + }; + return HammerGesturesPluginCommon; + })(event_manager_1.EventManagerPlugin); + exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_bindings", ["angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + exports.EXCEPTION_PROVIDER = di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(dom_adapter_1.DOM, false); + }, + deps: [] + }); + exports.EXCEPTION_BINDING = exports.EXCEPTION_PROVIDER; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function wtfInit() {} + exports.wtfInit = wtfInit; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/bootstrap", ["angular2/src/core/application"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var application_1 = require("angular2/src/core/application"); + exports.bootstrap = application_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services/title", ["angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Title = (function() { + function Title() {} + Title.prototype.getTitle = function() { + return dom_adapter_1.DOM.getTitle(); + }; + Title.prototype.setTitle = function(newTitle) { + dom_adapter_1.DOM.setTitle(newTitle); + }; + return Title; + })(); + exports.Title = Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_1 = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var DebugElement = (function() { + function DebugElement() {} + Object.defineProperty(DebugElement.prototype, "componentInstance", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "elementRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "componentViewChildren", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + DebugElement.prototype.query = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var results = this.queryAll(predicate, scope); + return results.length > 0 ? results[0] : null; + }; + DebugElement.prototype.queryAll = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var elementsInScope = scope(this); + return elementsInScope.filter(predicate); + }; + return DebugElement; + })(); + exports.DebugElement = DebugElement; + var DebugElement_ = (function(_super) { + __extends(DebugElement_, _super); + function DebugElement_(_parentView, _boundElementIndex) { + _super.call(this); + this._parentView = _parentView; + this._boundElementIndex = _boundElementIndex; + this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex]; + } + Object.defineProperty(DebugElement_.prototype, "componentInstance", { + get: function() { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.getComponent(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "nativeElement", { + get: function() { + return this.elementRef.nativeElement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "elementRef", { + get: function() { + return this._parentView.elementRefs[this._boundElementIndex]; + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.getDirectiveInstance = function(directiveIndex) { + return this._elementInjector.getDirectiveAtIndex(directiveIndex); + }; + Object.defineProperty(DebugElement_.prototype, "children", { + get: function() { + return this._getChildElements(this._parentView, this._boundElementIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "componentViewChildren", { + get: function() { + var shadowView = this._parentView.getNestedView(this._boundElementIndex); + if (!lang_1.isPresent(shadowView) || shadowView.proto.type !== view_1.ViewType.COMPONENT) { + return []; + } + return this._getChildElements(shadowView, null); + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.triggerEventHandler = function(eventName, eventObj) { + this._parentView.triggerEventHandlers(eventName, eventObj, this._boundElementIndex); + }; + DebugElement_.prototype.hasDirective = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return false; + } + return this._elementInjector.hasDirective(type); + }; + DebugElement_.prototype.inject = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.get(type); + }; + DebugElement_.prototype.getLocal = function(name) { + return this._parentView.locals.get(name); + }; + DebugElement_.prototype._getChildElements = function(view, parentBoundElementIndex) { + var _this = this; + var els = []; + var parentElementBinder = null; + if (lang_1.isPresent(parentBoundElementIndex)) { + parentElementBinder = view.proto.elementBinders[parentBoundElementIndex - view.elementOffset]; + } + for (var i = 0; i < view.proto.elementBinders.length; ++i) { + var binder = view.proto.elementBinders[i]; + if (binder.parent == parentElementBinder) { + els.push(new DebugElement_(view, view.elementOffset + i)); + var views = view.viewContainers[view.elementOffset + i]; + if (lang_1.isPresent(views)) { + views.views.forEach(function(nextView) { + els = els.concat(_this._getChildElements(nextView, null)); + }); + } + } + } + return els; + }; + return DebugElement_; + })(DebugElement); + exports.DebugElement_ = DebugElement_; + function inspectElement(elementRef) { + return new DebugElement_(view_ref_1.internalView(elementRef.parentView), elementRef.boundElementIndex); + } + exports.inspectElement = inspectElement; + function asNativeElements(arr) { + return arr.map(function(debugEl) { + return debugEl.nativeElement; + }); + } + exports.asNativeElements = asNativeElements; + var Scope = (function() { + function Scope() {} + Scope.all = function(debugElement) { + var scope = []; + scope.push(debugElement); + debugElement.children.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + debugElement.componentViewChildren.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + return scope; + }; + Scope.light = function(debugElement) { + var scope = []; + debugElement.children.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + Scope.view = function(debugElement) { + var scope = []; + debugElement.componentViewChildren.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + return Scope; + })(); + exports.Scope = Scope; + var By = (function() { + function By() {} + By.all = function() { + return function(debugElement) { + return true; + }; + }; + By.css = function(selector) { + return function(debugElement) { + return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; + }; + }; + By.directive = function(type) { + return function(debugElement) { + return debugElement.hasDirective(type); + }; + }; + return By; + })(); + exports.By = By; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element_view_listener", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/linker/view_listener", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/api", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var api_1 = require("angular2/src/core/render/api"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var NG_ID_PROPERTY = 'ngid'; + var INSPECT_GLOBAL_NAME = 'ng.probe'; + var NG_ID_SEPARATOR = '#'; + var _allIdsByView = new collection_1.Map(); + var _allViewsById = new collection_1.Map(); + var _nextId = 0; + function _setElementId(element, indices) { + if (lang_1.isPresent(element)) { + dom_adapter_1.DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); + } + } + function _getElementId(element) { + var elId = dom_adapter_1.DOM.getData(element, NG_ID_PROPERTY); + if (lang_1.isPresent(elId)) { + return elId.split(NG_ID_SEPARATOR).map(function(partStr) { + return lang_1.NumberWrapper.parseInt(partStr, 10); + }); + } else { + return null; + } + } + function inspectNativeElement(element) { + var elId = _getElementId(element); + if (lang_1.isPresent(elId)) { + var view = _allViewsById.get(elId[0]); + if (lang_1.isPresent(view)) { + return new debug_element_1.DebugElement_(view, elId[1]); + } + } + return null; + } + exports.inspectNativeElement = inspectNativeElement; + var DebugElementViewListener = (function() { + function DebugElementViewListener(_renderer) { + this._renderer = _renderer; + dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); + } + DebugElementViewListener.prototype.onViewCreated = function(view) { + var viewId = _nextId++; + _allViewsById.set(viewId, view); + _allIdsByView.set(view, viewId); + for (var i = 0; i < view.elementRefs.length; i++) { + var el = view.elementRefs[i]; + _setElementId(this._renderer.getNativeElementSync(el), [viewId, i]); + } + }; + DebugElementViewListener.prototype.onViewDestroyed = function(view) { + var viewId = _allIdsByView.get(view); + _allIdsByView.delete(view); + _allViewsById.delete(viewId); + }; + DebugElementViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [api_1.Renderer])], DebugElementViewListener); + return DebugElementViewListener; + })(); + exports.DebugElementViewListener = DebugElementViewListener; + exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([DebugElementViewListener, lang_1.CONST_EXPR(new di_1.Provider(view_listener_1.AppViewListener, {useExisting: DebugElementViewListener}))]); + exports.ELEMENT_PROBE_BINDINGS = exports.ELEMENT_PROBE_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.enableDevMode = lang_1.enableDevMode; + global.define = __define; + return module.exports; +}); + +System.register("angular2/profile", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var profile_1 = require("angular2/src/core/profile/profile"); + exports.wtfCreateScope = profile_1.wtfCreateScope; + exports.wtfLeave = profile_1.wtfLeave; + exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; + exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/lifecycle_hooks", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/bootstrap", ["angular2/src/core/bootstrap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var bootstrap_1 = require("angular2/src/core/bootstrap"); + exports.bootstrap = bootstrap_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/metadata", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var COMPONENT_SELECTOR = /^[\w|-]*$/; + var SKEWER_CASE = /-(\w)/g; + var directiveResolver = new angular2_1.DirectiveResolver(); + function getComponentInfo(type) { + var resolvedMetadata = directiveResolver.resolve(type); + var selector = resolvedMetadata.selector; + if (!selector.match(COMPONENT_SELECTOR)) { + throw new Error('Only selectors matching element names are supported, got: ' + selector); + } + var selector = selector.replace(SKEWER_CASE, function(all, letter) { + return letter.toUpperCase(); + }); + return { + type: type, + selector: selector, + inputs: parseFields(resolvedMetadata.inputs), + outputs: parseFields(resolvedMetadata.outputs) + }; + } + exports.getComponentInfo = getComponentInfo; + function parseFields(names) { + var attrProps = []; + if (names) { + for (var i = 0; i < names.length; i++) { + var parts = names[i].split(':'); + var prop = parts[0].trim(); + var attr = (parts[1] || parts[0]).trim(); + var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1); + attrProps.push({ + prop: prop, + attr: attr, + bracketAttr: "[" + attr + "]", + parenAttr: "(" + attr + ")", + bracketParenAttr: "[(" + attr + ")]", + onAttr: "on" + capitalAttr, + bindAttr: "bind" + capitalAttr, + bindonAttr: "bindon" + capitalAttr + }); + } + } + return attrProps; + } + exports.parseFields = parseFields; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function stringify(obj) { + if (typeof obj == 'function') + return obj.name || obj.toString(); + return '' + obj; + } + exports.stringify = stringify; + function onError(e) { + console.log(e, e.stack); + throw e; + } + exports.onError = onError; + function controllerKey(name) { + return '$' + name + 'Controller'; + } + exports.controllerKey = controllerKey; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager'; + exports.NG2_COMPILER = 'ng2.Compiler'; + exports.NG2_INJECTOR = 'ng2.Injector'; + exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap'; + exports.NG2_ZONE = 'ng2.NgZone'; + exports.NG1_CONTROLLER = '$controller'; + exports.NG1_SCOPE = '$scope'; + exports.NG1_ROOT_SCOPE = '$rootScope'; + exports.NG1_COMPILE = '$compile'; + exports.NG1_HTTP_BACKEND = '$httpBackend'; + exports.NG1_INJECTOR = '$injector'; + exports.NG1_PARSE = '$parse'; + exports.NG1_TEMPLATE_CACHE = '$templateCache'; + exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/angular2", "angular2/src/upgrade/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var DowngradeNg2ComponentAdapter = (function() { + function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) { + this.id = id; + this.info = info; + this.element = element; + this.attrs = attrs; + this.scope = scope; + this.parentInjector = parentInjector; + this.parse = parse; + this.viewManager = viewManager; + this.protoView = protoView; + this.component = null; + this.inputChangeCount = 0; + this.inputChanges = null; + this.hostViewRef = null; + this.changeDetector = null; + this.contentInserctionPoint = null; + this.element[0].id = id; + this.componentScope = scope.$new(); + this.childNodes = element.contents(); + } + DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() { + var childInjector = this.parentInjector.resolveAndCreateChild([angular2_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]); + this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector); + var renderer = this.hostViewRef.render; + var hostElement = this.viewManager.getHostElement(this.hostViewRef); + this.changeDetector = this.hostViewRef.changeDetectorRef; + this.component = this.viewManager.getComponent(hostElement); + this.contentInserctionPoint = renderer.rootContentInsertionPoints[0]; + }; + DowngradeNg2ComponentAdapter.prototype.setupInputs = function() { + var _this = this; + var attrs = this.attrs; + var inputs = this.info.inputs; + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + var expr = null; + if (attrs.hasOwnProperty(input.attr)) { + var observeFn = (function(prop) { + var prevValue = INITIAL_VALUE; + return function(value) { + if (_this.inputChanges !== null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue); + prevValue = value; + } + _this.component[prop] = value; + }; + })(input.prop); + attrs.$observe(input.attr, observeFn); + } else if (attrs.hasOwnProperty(input.bindAttr)) { + expr = attrs[input.bindAttr]; + } else if (attrs.hasOwnProperty(input.bracketAttr)) { + expr = attrs[input.bracketAttr]; + } else if (attrs.hasOwnProperty(input.bindonAttr)) { + expr = attrs[input.bindonAttr]; + } else if (attrs.hasOwnProperty(input.bracketParenAttr)) { + expr = attrs[input.bracketParenAttr]; + } + if (expr != null) { + var watchFn = (function(prop) { + return function(value, prevValue) { + if (_this.inputChanges != null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(prevValue, value); + } + _this.component[prop] = value; + }; + })(input.prop); + this.componentScope.$watch(expr, watchFn); + } + } + var prototype = this.info.type.prototype; + if (prototype && prototype.onChanges) { + this.inputChanges = {}; + this.componentScope.$watch(function() { + return _this.inputChangeCount; + }, function() { + var inputChanges = _this.inputChanges; + _this.inputChanges = {}; + _this.component.onChanges(inputChanges); + }); + } + this.componentScope.$watch(function() { + return _this.changeDetector && _this.changeDetector.detectChanges(); + }); + }; + DowngradeNg2ComponentAdapter.prototype.projectContent = function() { + var childNodes = this.childNodes; + if (this.contentInserctionPoint) { + var parent = this.contentInserctionPoint.parentNode; + for (var i = 0, + ii = childNodes.length; i < ii; i++) { + parent.insertBefore(childNodes[i], this.contentInserctionPoint); + } + } + }; + DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() { + var _this = this; + var attrs = this.attrs; + var outputs = this.info.outputs; + for (var j = 0; j < outputs.length; j++) { + var output = outputs[j]; + var expr = null; + var assignExpr = false; + var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null; + var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null; + if (attrs.hasOwnProperty(output.onAttr)) { + expr = attrs[output.onAttr]; + } else if (attrs.hasOwnProperty(output.parenAttr)) { + expr = attrs[output.parenAttr]; + } else if (attrs.hasOwnProperty(bindonAttr)) { + expr = attrs[bindonAttr]; + assignExpr = true; + } else if (attrs.hasOwnProperty(bracketParenAttr)) { + expr = attrs[bracketParenAttr]; + assignExpr = true; + } + if (expr != null && assignExpr != null) { + var getter = this.parse(expr); + var setter = getter.assign; + if (assignExpr && !setter) { + throw new Error("Expression '" + expr + "' is not assignable!"); + } + var emitter = this.component[output.prop]; + if (emitter) { + emitter.subscribe({next: assignExpr ? (function(setter) { + return function(value) { + return setter(_this.scope, value); + }; + })(setter) : (function(getter) { + return function(value) { + return getter(_this.scope, {$event: value}); + }; + })(getter)}); + } else { + throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!"); + } + } + } + }; + DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() { + var _this = this; + this.element.bind('$remove', function() { + return _this.viewManager.destroyRootHostView(_this.hostViewRef); + }); + }; + return DowngradeNg2ComponentAdapter; + })(); + exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter; + var Ng1Change = (function() { + function Ng1Change(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + Ng1Change.prototype.isFirstChange = function() { + return this.previousValue === this.currentValue; + }; + return Ng1Change; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function noNg() { + throw new Error('AngularJS v1.x is not loaded!'); + } + var angular = { + bootstrap: noNg, + module: noNg, + element: noNg, + version: noNg + }; + try { + if (window.hasOwnProperty('angular')) { + angular = window.angular; + } + } catch (e) {} + exports.bootstrap = angular.bootstrap; + exports.module = angular.module; + exports.element = angular.element; + exports.version = angular.version; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +/** + @license + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Netflix, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_1 = require("angular2/src/core/metadata/view"); + var selector_1 = require("angular2/src/compiler/selector"); + var util_1 = require("angular2/src/compiler/util"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; + var CompileTypeMetadata = (function() { + function CompileTypeMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + runtime = _b.runtime, + name = _b.name, + moduleUrl = _b.moduleUrl, + isHost = _b.isHost; + this.runtime = runtime; + this.name = name; + this.moduleUrl = moduleUrl; + this.isHost = lang_1.normalizeBool(isHost); + } + CompileTypeMetadata.fromJson = function(data) { + return new CompileTypeMetadata({ + name: data['name'], + moduleUrl: data['moduleUrl'], + isHost: data['isHost'] + }); + }; + CompileTypeMetadata.prototype.toJson = function() { + return { + 'name': this.name, + 'moduleUrl': this.moduleUrl, + 'isHost': this.isHost + }; + }; + return CompileTypeMetadata; + })(); + exports.CompileTypeMetadata = CompileTypeMetadata; + var CompileTemplateMetadata = (function() { + function CompileTemplateMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + encapsulation = _b.encapsulation, + template = _b.template, + templateUrl = _b.templateUrl, + styles = _b.styles, + styleUrls = _b.styleUrls, + ngContentSelectors = _b.ngContentSelectors; + this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; + this.template = template; + this.templateUrl = templateUrl; + this.styles = lang_1.isPresent(styles) ? styles : []; + this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; + this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; + } + CompileTemplateMetadata.fromJson = function(data) { + return new CompileTemplateMetadata({ + encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], + template: data['template'], + templateUrl: data['templateUrl'], + styles: data['styles'], + styleUrls: data['styleUrls'], + ngContentSelectors: data['ngContentSelectors'] + }); + }; + CompileTemplateMetadata.prototype.toJson = function() { + return { + 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, + 'template': this.template, + 'templateUrl': this.templateUrl, + 'styles': this.styles, + 'styleUrls': this.styleUrls, + 'ngContentSelectors': this.ngContentSelectors + }; + }; + return CompileTemplateMetadata; + })(); + exports.CompileTemplateMetadata = CompileTemplateMetadata; + var CompileDirectiveMetadata = (function() { + function CompileDirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + hostListeners = _b.hostListeners, + hostProperties = _b.hostProperties, + hostAttributes = _b.hostAttributes, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + this.type = type; + this.isComponent = isComponent; + this.dynamicLoadable = dynamicLoadable; + this.selector = selector; + this.exportAs = exportAs; + this.changeDetection = changeDetection; + this.inputs = inputs; + this.outputs = outputs; + this.hostListeners = hostListeners; + this.hostProperties = hostProperties; + this.hostAttributes = hostAttributes; + this.lifecycleHooks = lifecycleHooks; + this.template = template; + } + CompileDirectiveMetadata.create = function(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + host = _b.host, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + var hostListeners = {}; + var hostProperties = {}; + var hostAttributes = {}; + if (lang_1.isPresent(host)) { + collection_1.StringMapWrapper.forEach(host, function(value, key) { + var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); + if (lang_1.isBlank(matches)) { + hostAttributes[key] = value; + } else if (lang_1.isPresent(matches[1])) { + hostProperties[matches[1]] = value; + } else if (lang_1.isPresent(matches[2])) { + hostListeners[matches[2]] = value; + } + }); + } + var inputsMap = {}; + if (lang_1.isPresent(inputs)) { + inputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + inputsMap[parts[0]] = parts[1]; + }); + } + var outputsMap = {}; + if (lang_1.isPresent(outputs)) { + outputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + outputsMap[parts[0]] = parts[1]; + }); + } + return new CompileDirectiveMetadata({ + type: type, + isComponent: lang_1.normalizeBool(isComponent), + dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), + selector: selector, + exportAs: exportAs, + changeDetection: changeDetection, + inputs: inputsMap, + outputs: outputsMap, + hostListeners: hostListeners, + hostProperties: hostProperties, + hostAttributes: hostAttributes, + lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], + template: template + }); + }; + CompileDirectiveMetadata.fromJson = function(data) { + return new CompileDirectiveMetadata({ + isComponent: data['isComponent'], + dynamicLoadable: data['dynamicLoadable'], + selector: data['selector'], + exportAs: data['exportAs'], + type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], + changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], + inputs: data['inputs'], + outputs: data['outputs'], + hostListeners: data['hostListeners'], + hostProperties: data['hostProperties'], + hostAttributes: data['hostAttributes'], + lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { + return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; + }), + template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'] + }); + }; + CompileDirectiveMetadata.prototype.toJson = function() { + return { + 'isComponent': this.isComponent, + 'dynamicLoadable': this.dynamicLoadable, + 'selector': this.selector, + 'exportAs': this.exportAs, + 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, + 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, + 'inputs': this.inputs, + 'outputs': this.outputs, + 'hostListeners': this.hostListeners, + 'hostProperties': this.hostProperties, + 'hostAttributes': this.hostAttributes, + 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { + return lang_1.serializeEnum(hook); + }), + 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template + }; + }; + return CompileDirectiveMetadata; + })(); + exports.CompileDirectiveMetadata = CompileDirectiveMetadata; + function createHostComponentMeta(componentType, componentSelector) { + var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); + return CompileDirectiveMetadata.create({ + type: new CompileTypeMetadata({ + runtime: Object, + name: "Host" + componentType.name, + moduleUrl: componentType.moduleUrl, + isHost: true + }), + template: new CompileTemplateMetadata({ + template: template, + templateUrl: '', + styles: [], + styleUrls: [], + ngContentSelectors: [] + }), + changeDetection: change_detection_1.ChangeDetectionStrategy.Default, + inputs: [], + outputs: [], + host: {}, + lifecycleHooks: [], + isComponent: true, + dynamicLoadable: false, + selector: '*' + }); + } + exports.createHostComponentMeta = createHostComponentMeta; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { + var pvVisitors = []; + var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); + template_ast_1.templateVisitAll(visitor, parsedTemplate); + return createChangeDefinitions(pvVisitors, componentType, genConfig); + } + exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; + var ProtoViewVisitor = (function() { + function ProtoViewVisitor(parent, allVisitors, strategy) { + this.parent = parent; + this.allVisitors = allVisitors; + this.strategy = strategy; + this.boundTextCount = 0; + this.boundElementCount = 0; + this.variableNames = []; + this.bindingRecords = []; + this.eventRecords = []; + this.directiveRecords = []; + this.viewIndex = allVisitors.length; + allVisitors.push(this); + } + ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + this.boundElementCount++; + template_ast_1.templateVisitAll(this, ast.outputs); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); + template_ast_1.templateVisitAll(childVisitor, ast.vars); + template_ast_1.templateVisitAll(childVisitor, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitElement = function(ast, context) { + if (ast.isBound()) { + this.boundElementCount++; + } + template_ast_1.templateVisitAll(this, ast.inputs, null); + template_ast_1.templateVisitAll(this, ast.outputs); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + template_ast_1.templateVisitAll(this, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitVariable = function(ast, context) { + this.variableNames.push(ast.name); + return null; + }; + ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { + var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); + this.eventRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { + var boundElementIndex = this.boundElementCount - 1; + var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; + var bindingRecord; + if (ast.type === template_ast_1.PropertyBindingType.Property) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Class) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Style) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); + } + this.bindingRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { + var boundTextIndex = this.boundTextCount++; + this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, boundTextIndex)); + return null; + }; + ProtoViewVisitor.prototype.visitText = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { + var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); + var directiveMetadata = ast.directive; + var directiveRecord = new change_detection_1.DirectiveRecord({ + directiveIndex: directiveIndex, + callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, + callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, + callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, + callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, + callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, + callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, + callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, + changeDetection: directiveMetadata.changeDetection + }); + this.directiveRecords.push(directiveRecord); + template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); + var bindingRecords = this.bindingRecords; + if (directiveRecord.callOnChanges) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); + } + if (directiveRecord.callOnInit) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); + } + if (directiveRecord.callDoCheck) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); + } + template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); + template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + return null; + }; + ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { + var setter = reflection_1.reflector.setter(ast.directiveName); + this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); + return null; + }; + return ProtoViewVisitor; + })(); + function createChangeDefinitions(pvVisitors, componentType, genConfig) { + var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); + return pvVisitors.map(function(pvVisitor) { + var id = componentType.name + "_" + pvVisitor.viewIndex; + return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); + }); + } + function _collectNestedProtoViewsVariableNames(pvVisitors) { + var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); + pvVisitors.forEach(function(pv) { + var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; + nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); + }); + return nestedPvVariableNames; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/core/render/view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var view_1 = require("angular2/src/core/metadata/view"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var shadow_css_1 = require("angular2/src/compiler/shadow_css"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var StyleCompiler = (function() { + function StyleCompiler(_xhr, _urlResolver) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._styleCache = new Map(); + this._shadowCss = new shadow_css_1.ShadowCss(); + } + StyleCompiler.prototype.compileComponentRuntime = function(template) { + var styles = template.styles; + var styleAbsUrls = template.styleUrls; + return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); + }; + StyleCompiler.prototype.compileComponentCodeGen = function(template) { + var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; + return this._styleCodeGen(template.styles, template.styleUrls, shim); + }; + StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); + return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; + }; + StyleCompiler.prototype.clearCache = function() { + this._styleCache.clear(); + }; + StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { + var _this = this; + var promises = absUrls.map(function(absUrl) { + var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); + var result = _this._styleCache.get(cacheKey); + if (lang_1.isBlank(result)) { + result = _this._xhr.get(absUrl).then(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); + return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); + }); + _this._styleCache.set(cacheKey, result); + } + return result; + }); + return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { + var result = plainStyles.map(function(plainStyle) { + return _this._shimIfNeeded(plainStyle, encapsulate); + }); + nestedStyles.forEach(function(styles) { + return result.push(styles); + }); + return result; + }); + }; + StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { + var _this = this; + var arrayPrefix = lang_1.IS_DART ? "const" : ''; + var styleExpressions = plainStyles.map(function(plainStyle) { + return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); + }); + for (var i = 0; i < absUrls.length; i++) { + var moduleUrl = this._createModuleUrl(absUrls[i], shim); + styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); + } + var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; + return new source_module_1.SourceExpression([], expressionSource); + }; + StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { + var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; + return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); + }; + StyleCompiler.prototype._shimIfNeeded = function(style, shim) { + return shim ? this._shadowCss.shimCssText(style, view_factory_1.CONTENT_ATTR, view_factory_1.HOST_ATTR) : style; + }; + StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { + return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + }; + StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); + return StyleCompiler; + })(); + exports.StyleCompiler = StyleCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/html_ast", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var HtmlParser = (function() { + function HtmlParser() {} + HtmlParser.prototype.parse = function(template, sourceInfo) { + var root = dom_adapter_1.DOM.createTemplate(template); + return parseChildNodes(root, sourceInfo); + }; + HtmlParser.prototype.unparse = function(nodes) { + var visitor = new UnparseVisitor(); + var parts = []; + html_ast_1.htmlVisitAll(visitor, nodes, parts); + return parts.join(''); + }; + HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); + return HtmlParser; + })(); + exports.HtmlParser = HtmlParser; + function parseText(text, indexInParent, parentSourceInfo) { + var value = dom_adapter_1.DOM.getText(text); + return new html_ast_1.HtmlTextAst(value, parentSourceInfo + " > #text(" + value + "):nth-child(" + indexInParent + ")"); + } + function parseAttr(element, parentSourceInfo, attrName, attrValue) { + return new html_ast_1.HtmlAttrAst(attrName, attrValue, parentSourceInfo + "[" + attrName + "=" + attrValue + "]"); + } + function parseElement(element, indexInParent, parentSourceInfo) { + var nodeName = dom_adapter_1.DOM.nodeName(element).toLowerCase(); + var sourceInfo = parentSourceInfo + " > " + nodeName + ":nth-child(" + indexInParent + ")"; + var attrs = parseAttrs(element, sourceInfo); + var childNodes = parseChildNodes(element, sourceInfo); + return new html_ast_1.HtmlElementAst(nodeName, attrs, childNodes, sourceInfo); + } + function parseAttrs(element, elementSourceInfo) { + var attrMap = dom_adapter_1.DOM.attributeMap(element); + var attrList = []; + attrMap.forEach(function(value, name) { + return attrList.push([name, value]); + }); + attrList.sort(function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + return attrList.map(function(entry) { + return parseAttr(element, elementSourceInfo, entry[0], entry[1]); + }); + } + function parseChildNodes(element, parentSourceInfo) { + var root = dom_adapter_1.DOM.templateAwareRoot(element); + var childNodes = dom_adapter_1.DOM.childNodesAsList(root); + var result = []; + var index = 0; + childNodes.forEach(function(childNode) { + var childResult = null; + if (dom_adapter_1.DOM.isTextNode(childNode)) { + var text = childNode; + childResult = parseText(text, index, parentSourceInfo); + } else if (dom_adapter_1.DOM.isElementNode(childNode)) { + var el = childNode; + childResult = parseElement(el, index, parentSourceInfo); + } + if (lang_1.isPresent(childResult)) { + result.push(childResult); + } + index++; + }); + return result; + } + var UnparseVisitor = (function() { + function UnparseVisitor() {} + UnparseVisitor.prototype.visitElement = function(ast, parts) { + parts.push("<" + ast.name); + var attrs = []; + html_ast_1.htmlVisitAll(this, ast.attrs, attrs); + if (ast.attrs.length > 0) { + parts.push(' '); + parts.push(attrs.join(' ')); + } + parts.push(">"); + html_ast_1.htmlVisitAll(this, ast.children, parts); + parts.push(""); + return null; + }; + UnparseVisitor.prototype.visitAttr = function(ast, parts) { + parts.push(ast.name + "=" + util_1.escapeDoubleQuoteString(ast.value)); + return null; + }; + UnparseVisitor.prototype.visitText = function(ast, parts) { + parts.push(ast.value); + return null; + }; + return UnparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var GenericBrowserDomAdapter = (function(_super) { + __extends(GenericBrowserDomAdapter, _super); + function GenericBrowserDomAdapter() { + var _this = this; + _super.call(this); + this._animationPrefix = null; + this._transitionEnd = null; + try { + var element = this.createElement('div', this.defaultDoc()); + if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { + this._animationPrefix = ''; + } else { + var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; + for (var i = 0; i < domPrefixes.length; i++) { + if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { + this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; + break; + } + } + } + var transEndEventNames = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { + if (lang_1.isPresent(_this.getStyle(element, key))) { + _this._transitionEnd = value; + } + }); + } catch (e) { + this._animationPrefix = null; + this._transitionEnd = null; + } + } + GenericBrowserDomAdapter.prototype.getXHR = function() { + return xhr_impl_1.XHRImpl; + }; + GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { + return el.getDistributedNodes(); + }; + GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + el.href = href == null ? baseUrl : baseUrl + '/../' + href; + }; + GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { + return true; + }; + GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { + return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); + }; + GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { + return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; + }; + GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { + return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; + }; + GenericBrowserDomAdapter.prototype.supportsAnimation = function() { + return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); + }; + return GenericBrowserDomAdapter; + })(dom_adapter_1.DomAdapter); + exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/browser_testability", ["angular2/src/core/testability/testability", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var testability_1 = require("angular2/src/core/testability/testability"); + var lang_1 = require("angular2/src/facade/lang"); + var PublicTestability = (function() { + function PublicTestability(testability) { + this._testability = testability; + } + PublicTestability.prototype.isStable = function() { + return this._testability.isStable(); + }; + PublicTestability.prototype.whenStable = function(callback) { + this._testability.whenStable(callback); + }; + PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { + return this.findProviders(using, provider, exactMatch); + }; + PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { + return this._testability.findBindings(using, provider, exactMatch); + }; + return PublicTestability; + })(); + var BrowserGetTestability = (function() { + function BrowserGetTestability() {} + BrowserGetTestability.init = function() { + testability_1.setTestabilityGetter(new BrowserGetTestability()); + }; + BrowserGetTestability.prototype.addToWindow = function(registry) { + lang_1.global.getAngularTestability = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + var testability = registry.findTestabilityInTree(elem, findInAncestors); + if (testability == null) { + throw new Error('Could not find testability for element.'); + } + return new PublicTestability(testability); + }; + lang_1.global.getAllAngularTestabilities = function() { + var testabilities = registry.getAllTestabilities(); + return testabilities.map(function(testability) { + return new PublicTestability(testability); + }); + }; + }; + return BrowserGetTestability; + })(); + exports.BrowserGetTestability = BrowserGetTestability; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_gestures", ["angular2/src/core/render/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var hammer_common_1 = require("angular2/src/core/render/dom/events/hammer_common"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var di_1 = require("angular2/src/core/di"); + var HammerGesturesPlugin = (function(_super) { + __extends(HammerGesturesPlugin, _super); + function HammerGesturesPlugin() { + _super.apply(this, arguments); + } + HammerGesturesPlugin.prototype.supports = function(eventName) { + if (!_super.prototype.supports.call(this, eventName)) + return false; + if (!lang_1.isPresent(window['Hammer'])) { + throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); + } + return true; + }; + HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + eventName = eventName.toLowerCase(); + zone.runOutsideAngular(function() { + var mc = new Hammer(element); + mc.get('pinch').set({enable: true}); + mc.get('rotate').set({enable: true}); + mc.on(eventName, function(eventObj) { + zone.run(function() { + handler(eventObj); + }); + }); + }); + }; + HammerGesturesPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HammerGesturesPlugin); + return HammerGesturesPlugin; + })(hammer_common_1.HammerGesturesPluginCommon); + exports.HammerGesturesPlugin = HammerGesturesPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services", ["angular2/src/compiler/app_root_url", "angular2/src/compiler/url_resolver", "angular2/src/core/services/title"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + exports.AppRootUrl = app_root_url_1.AppRootUrl; + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + exports.UrlResolver = url_resolver_1.UrlResolver; + var title_1 = require("angular2/src/core/services/title"); + exports.Title = title_1.Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug", ["angular2/src/core/debug/debug_element", "angular2/src/core/debug/debug_element_view_listener"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + exports.DebugElement = debug_element_1.DebugElement; + exports.asNativeElements = debug_element_1.asNativeElements; + exports.By = debug_element_1.By; + exports.Scope = debug_element_1.Scope; + exports.inspectElement = debug_element_1.inspectElement; + var debug_element_view_listener_1 = require("angular2/src/core/debug/debug_element_view_listener"); + exports.inspectNativeElement = debug_element_view_listener_1.inspectNativeElement; + exports.ELEMENT_PROBE_PROVIDERS = debug_element_view_listener_1.ELEMENT_PROBE_PROVIDERS; + exports.ELEMENT_PROBE_BINDINGS = debug_element_view_listener_1.ELEMENT_PROBE_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/angular2", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var util_1 = require("angular2/src/upgrade/util"); + var angular = require("angular2/src/upgrade/angular_js"); + var CAMEL_CASE = /([A-Z])/g; + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var NOT_SUPPORTED = 'NOT_SUPPORTED'; + var UpgradeNg1ComponentAdapterBuilder = (function() { + function UpgradeNg1ComponentAdapterBuilder(name) { + this.name = name; + this.inputs = []; + this.inputsRename = []; + this.outputs = []; + this.outputsRename = []; + this.propertyOutputs = []; + this.checkProperties = []; + this.propertyMap = {}; + this.linkFn = null; + this.directive = null; + this.$controller = null; + var selector = name.replace(CAMEL_CASE, function(all, next) { + return '-' + next.toLowerCase(); + }); + var self = this; + this.type = angular2_1.Directive({ + selector: selector, + inputs: this.inputsRename, + outputs: this.outputsRename + }).Class({ + constructor: [new angular2_1.Inject(constants_1.NG1_SCOPE), angular2_1.ElementRef, function(scope, elementRef) { + return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap); + }], + onChanges: function() {}, + doCheck: function() {} + }); + } + UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) { + var directives = injector.get(this.name + 'Directive'); + if (directives.length > 1) { + throw new Error('Only support single directive definition for: ' + this.name); + } + var directive = directives[0]; + if (directive.replace) + this.notSupported('replace'); + if (directive.terminal) + this.notSupported('terminal'); + var link = directive.link; + if (typeof link == 'object') { + if (link.post) + this.notSupported('link.post'); + } + return directive; + }; + UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) { + throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'."); + }; + UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() { + var scope = this.directive.scope; + if (typeof scope == 'object') { + for (var name in scope) { + if (scope.hasOwnProperty(name)) { + var localName = scope[name]; + var type = localName.charAt(0); + localName = localName.substr(1) || name; + var outputName = 'output_' + name; + var outputNameRename = outputName + ': ' + name; + var outputNameRenameChange = outputName + ': ' + name + 'Change'; + var inputName = 'input_' + name; + var inputNameRename = inputName + ': ' + name; + switch (type) { + case '=': + this.propertyOutputs.push(outputName); + this.checkProperties.push(localName); + this.outputs.push(outputName); + this.outputsRename.push(outputNameRenameChange); + this.propertyMap[outputName] = localName; + case '@': + this.inputs.push(inputName); + this.inputsRename.push(inputNameRename); + this.propertyMap[inputName] = localName; + break; + case '&': + this.outputs.push(outputName); + this.outputsRename.push(outputNameRename); + this.propertyMap[outputName] = localName; + break; + default: + var json = JSON.stringify(scope); + throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive."); + } + } + } + } + }; + UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) { + var _this = this; + if (this.directive.template) { + this.linkFn = compileHtml(this.directive.template); + } else if (this.directive.templateUrl) { + var url = this.directive.templateUrl; + var html = templateCache.get(url); + if (html !== undefined) { + this.linkFn = compileHtml(html); + } else { + return new Promise(function(resolve, err) { + httpBackend('GET', url, null, function(status, response) { + if (status == 200) { + resolve(_this.linkFn = compileHtml(templateCache.put(url, response))); + } else { + err("GET " + url + " returned " + status + ": " + response); + } + }); + }); + } + } else { + throw new Error("Directive '" + this.name + "' is not a component, it is missing template."); + } + return null; + function compileHtml(html) { + var div = document.createElement('div'); + div.innerHTML = html; + return compile(div.childNodes); + } + }; + UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) { + var promises = []; + var compile = injector.get(constants_1.NG1_COMPILE); + var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE); + var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND); + var $controller = injector.get(constants_1.NG1_CONTROLLER); + for (var name in exportedComponents) { + if (exportedComponents.hasOwnProperty(name)) { + var exportedComponent = exportedComponents[name]; + exportedComponent.directive = exportedComponent.extractDirective(injector); + exportedComponent.$controller = $controller; + exportedComponent.extractBindings(); + var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend); + if (promise) + promises.push(promise); + } + } + return Promise.all(promises); + }; + return UpgradeNg1ComponentAdapterBuilder; + })(); + exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder; + var UpgradeNg1ComponentAdapter = (function() { + function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) { + this.directive = directive; + this.inputs = inputs; + this.outputs = outputs; + this.propOuts = propOuts; + this.checkProperties = checkProperties; + this.propertyMap = propertyMap; + this.destinationObj = null; + this.checkLastValues = []; + var element = elementRef.nativeElement; + var childNodes = []; + var childNode; + while (childNode = element.firstChild) { + element.removeChild(childNode); + childNodes.push(childNode); + } + var componentScope = scope.$new(!!directive.scope); + var $element = angular.element(element); + var controllerType = directive.controller; + var controller = null; + if (controllerType) { + var locals = { + $scope: componentScope, + $element: $element + }; + controller = $controller(controllerType, locals, null, directive.controllerAs); + $element.data(util_1.controllerKey(directive.name), controller); + } + var link = directive.link; + if (typeof link == 'object') + link = link.pre; + if (link) { + var attrs = NOT_SUPPORTED; + var transcludeFn = NOT_SUPPORTED; + var linkController = this.resolveRequired($element, directive.require); + directive.link(componentScope, $element, attrs, linkController, transcludeFn); + } + this.destinationObj = directive.bindToController && controller ? controller : componentScope; + linkFn(componentScope, function(clonedElement, scope) { + for (var i = 0, + ii = clonedElement.length; i < ii; i++) { + element.appendChild(clonedElement[i]); + } + }, {parentBoundTranscludeFn: function(scope, cloneAttach) { + cloneAttach(childNodes); + }}); + for (var i = 0; i < inputs.length; i++) { + this[inputs[i]] = null; + } + for (var j = 0; j < outputs.length; j++) { + var emitter = this[outputs[j]] = new angular2_1.EventEmitter(); + this.setComponentProperty(outputs[j], (function(emitter) { + return function(value) { + return emitter.next(value); + }; + })(emitter)); + } + for (var k = 0; k < propOuts.length; k++) { + this[propOuts[k]] = new angular2_1.EventEmitter(); + this.checkLastValues.push(INITIAL_VALUE); + } + } + UpgradeNg1ComponentAdapter.prototype.onChanges = function(changes) { + for (var name in changes) { + if (changes.hasOwnProperty(name)) { + var change = changes[name]; + this.setComponentProperty(name, change.currentValue); + } + } + }; + UpgradeNg1ComponentAdapter.prototype.doCheck = function() { + var count = 0; + var destinationObj = this.destinationObj; + var lastValues = this.checkLastValues; + var checkProperties = this.checkProperties; + for (var i = 0; i < checkProperties.length; i++) { + var value = destinationObj[checkProperties[i]]; + var last = lastValues[i]; + if (value !== last) { + if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else { + var eventEmitter = this[this.propOuts[i]]; + eventEmitter.next(lastValues[i] = value); + } + } + } + return count; + }; + UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) { + this.destinationObj[this.propertyMap[name]] = value; + }; + UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) { + if (!require) { + return undefined; + } else if (typeof require == 'string') { + var name = require; + var isOptional = false; + var startParent = false; + var searchParents = false; + var ch; + if (name.charAt(0) == '?') { + isOptional = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + searchParents = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + startParent = true; + name = name.substr(1); + } + var key = util_1.controllerKey(name); + if (startParent) + $element = $element.parent(); + var dep = searchParents ? $element.inheritedData(key) : $element.data(key); + if (!dep && !isOptional) { + throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'."); + } + return dep; + } else if (require instanceof Array) { + var deps = []; + for (var i = 0; i < require.length; i++) { + deps.push(this.resolveRequired($element, require[i])); + } + return deps; + } + throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require); + }; + return UpgradeNg1ComponentAdapter; + })(); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); + var lang_1 = require("angular2/src/facade/lang"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; + var UTIL = "ChangeDetectionUtil"; + var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; + var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); + var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); + var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); + var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); + var ChangeDetectionCompiler = (function() { + function ChangeDetectionCompiler(_genConfig) { + this._genConfig = _genConfig; + } + ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { + var _this = this; + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + return changeDetectorDefinitions.map(function(definition) { + return _this._createChangeDetectorFactory(definition); + }); + }; + ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { + if (lang_1.IS_DART || !this._genConfig.useJit) { + var proto = new change_detection_1.DynamicProtoChangeDetector(definition); + return function(dispatcher) { + return proto.instantiate(dispatcher); + }; + } else { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR, CHANGE_DETECTOR_STATE).generate(); + } + }; + ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + var factories = []; + var index = 0; + var sourceParts = changeDetectorDefinitions.map(function(definition) { + var codegen; + var sourcePart; + if (lang_1.IS_DART) { + codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); + var className = "_" + definition.id; + var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; + codegen.generate(typeRef, className, definition); + factories.push(className + ".newChangeDetector"); + sourcePart = codegen.toString(); + } else { + codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); + factories.push("function(dispatcher) { return new " + codegen.typeName + "(dispatcher); }"); + sourcePart = codegen.generateSource(); + } + index++; + return sourcePart; + }); + return new source_module_1.SourceExpressions(sourceParts, factories); + }; + ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); + return ChangeDetectionCompiler; + })(); + exports.ChangeDetectionCompiler = ChangeDetectionCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var selector_1 = require("angular2/src/compiler/selector"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = new RegExp('\\.'); + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + } + TemplateParser.prototype.parse = function(template, directives, sourceInfo) { + var parseVisitor = new TemplateParseVisitor(directives, this._exprParser, this._schemaRegistry); + var result = html_ast_1.htmlVisitAll(parseVisitor, this._htmlParser.parse(template, sourceInfo), EMPTY_COMPONENT); + if (parseVisitor.errors.length > 0) { + var errorString = parseVisitor.errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result; + }; + TemplateParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser])], TemplateParser); + return TemplateParser; + })(); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(directives, _exprParser, _schemaRegistry) { + var _this = this; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + } + TemplateParseVisitor.prototype._reportError = function(message) { + this.errors.push(message); + }; + TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceInfo) { + try { + return this._exprParser.parseInterpolation(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseAction = function(value, sourceInfo) { + try { + return this._exprParser.parseAction(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseBinding = function(value, sourceInfo) { + try { + return this._exprParser.parseBinding(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceInfo) { + try { + return this._exprParser.parseTemplateBindings(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return []; + } + }; + TemplateParseVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + var expr = this._parseInterpolation(ast.value, ast.sourceInfo); + if (lang_1.isPresent(expr)) { + return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceInfo); + } else { + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + } + }; + TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + TemplateParseVisitor.prototype.visitElement = function(element, component) { + var _this = this; + var nodeName = element.name; + var preparsedElement = template_preparser_1.preparseElement(element); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { + return null; + } + if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { + return null; + } + var matchableAttrs = []; + var elementOrDirectiveProps = []; + var vars = []; + var events = []; + var templateElementOrDirectiveProps = []; + var templateVars = []; + var templateMatchableAttrs = []; + var hasInlineTemplates = false; + var attrs = []; + element.attrs.forEach(function(attr) { + matchableAttrs.push([attr.name, attr.value]); + var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); + var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); + if (!hasBinding && !hasTemplateBinding) { + attrs.push(_this.visitAttr(attr, null)); + } + if (hasTemplateBinding) { + hasInlineTemplates = true; + } + }); + var isTemplateElement = nodeName == TEMPLATE_ELEMENT; + var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); + var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceInfo); + var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); + var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); + var elementNgContentIndex = hasInlineTemplates ? null : component.findNgContentIndex(elementCssSelector); + var parsedElement; + if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { + parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, elementNgContentIndex, element.sourceInfo); + } else if (isTemplateElement) { + this._assertAllEventsPublishedByDirectives(directives, events, element.sourceInfo); + this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, elementNgContentIndex, element.sourceInfo); + } else { + this._assertOnlyOneComponent(directives, element.sourceInfo); + var elementExportAsVars = vars.filter(function(varAst) { + return varAst.value.length === 0; + }); + parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, elementNgContentIndex, element.sourceInfo); + } + if (hasInlineTemplates) { + var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); + var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceInfo); + var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); + this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], component.findNgContentIndex(templateCssSelector), element.sourceInfo); + } + return parsedElement; + }; + TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { + var templateBindingsSource = null; + if (attr.name == TEMPLATE_ATTR) { + templateBindingsSource = attr.value; + } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { + var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; + } + if (lang_1.isPresent(templateBindingsSource)) { + var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceInfo); + for (var i = 0; i < bindings.length; i++) { + var binding = bindings[i]; + var dashCaseKey = util_1.camelCaseToDashCase(binding.key); + if (binding.keyIsVar) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(binding.key), binding.name, attr.sourceInfo)); + targetMatchableAttrs.push([dashCaseKey, binding.name]); + } else if (lang_1.isPresent(binding.expression)) { + this._parsePropertyAst(dashCaseKey, binding.expression, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else { + targetMatchableAttrs.push([dashCaseKey, '']); + this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps); + } + } + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { + var attrName = this._normalizeAttributeName(attr.name); + var attrValue = attr.value; + var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); + var hasBinding = false; + if (lang_1.isPresent(bindParts)) { + hasBinding = true; + if (lang_1.isPresent(bindParts[1])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[2])) { + var identifier = bindParts[5]; + this._parseVariable(identifier, attrValue, attr.sourceInfo, targetVars); + } else if (lang_1.isPresent(bindParts[3])) { + this._parseEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[4])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[6])) { + this._parseProperty(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[7])) { + this._parseProperty(bindParts[7], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[8])) { + this._parseEvent(bindParts[8], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } + } else { + hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } + if (!hasBinding) { + this._parseLiteralAttr(attrName, attrValue, attr.sourceInfo, targetProps); + } + return hasBinding; + }; + TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { + return attrName.startsWith('data-') ? attrName.substring(5) : attrName; + }; + TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceInfo, targetVars) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(identifier), value, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceInfo, targetMatchableAttrs, targetProps) { + this._parsePropertyAst(name, this._parseBinding(expression, sourceInfo), sourceInfo, targetMatchableAttrs, targetProps); + }; + TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceInfo, targetMatchableAttrs, targetProps) { + var expr = this._parseInterpolation(value, sourceInfo); + if (lang_1.isPresent(expr)) { + this._parsePropertyAst(name, expr, sourceInfo, targetMatchableAttrs, targetProps); + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceInfo, targetMatchableAttrs, targetProps) { + targetMatchableAttrs.push([name, ast.source]); + targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + this._parseEvent(name + "-change", expression + "=$event", sourceInfo, targetMatchableAttrs, targetEvents); + }; + TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + var parts = util_1.splitAtColon(name, [null, name]); + var target = parts[0]; + var eventName = parts[1]; + targetEvents.push(new template_ast_1.BoundEventAst(util_1.dashCaseToCamelCase(eventName), target, this._parseAction(expression, sourceInfo), sourceInfo)); + }; + TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceInfo, targetProps) { + targetProps.push(new BoundElementOrDirectiveProperty(util_1.dashCaseToCamelCase(name), this._exprParser.wrapLiteralPrimitive(value, sourceInfo), true, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { + var _this = this; + var directives = []; + selectorMatcher.match(elementCssSelector, function(selector, directive) { + directives.push(directive); + }); + collection_1.ListWrapper.sort(directives, function(dir1, dir2) { + var dir1Comp = dir1.isComponent; + var dir2Comp = dir2.isComponent; + if (dir1Comp && !dir2Comp) { + return -1; + } else if (!dir1Comp && dir2Comp) { + return 1; + } else { + return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); + } + }); + return directives; + }; + TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceInfo) { + var _this = this; + var matchedVariables = new Set(); + var directiveAsts = directives.map(function(directive) { + var hostProperties = []; + var hostEvents = []; + var directiveProperties = []; + _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceInfo, hostProperties); + _this._createDirectiveHostEventAsts(directive.hostListeners, sourceInfo, hostEvents); + _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); + var exportAsVars = []; + possibleExportAsVars.forEach(function(varAst) { + if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { + exportAsVars.push(varAst); + matchedVariables.add(varAst.name); + } + }); + return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceInfo); + }); + possibleExportAsVars.forEach(function(varAst) { + if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { + _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\" at " + varAst.sourceInfo); + } + }); + return directiveAsts; + }; + TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceInfo, targetPropertyAsts) { + var _this = this; + if (lang_1.isPresent(hostProps)) { + collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { + var exprAst = _this._parseBinding(expression, sourceInfo); + targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceInfo)); + }); + } + }; + TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceInfo, targetEventAsts) { + var _this = this; + if (lang_1.isPresent(hostListeners)) { + collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { + _this._parseEvent(propName, expression, sourceInfo, [], targetEventAsts); + }); + } + }; + TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { + if (lang_1.isPresent(directiveProperties)) { + var boundPropsByName = new Map(); + boundProps.forEach(function(boundProp) { + var key = util_1.dashCaseToCamelCase(boundProp.name); + var prevValue = boundPropsByName.get(boundProp.name); + if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { + boundPropsByName.set(key, boundProp); + } + }); + collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { + elProp = util_1.dashCaseToCamelCase(elProp); + var boundProp = boundPropsByName.get(elProp); + if (lang_1.isPresent(boundProp)) { + targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceInfo)); + } + }); + } + }; + TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { + var _this = this; + var boundElementProps = []; + var boundDirectivePropsIndex = new Map(); + directives.forEach(function(directive) { + directive.inputs.forEach(function(prop) { + boundDirectivePropsIndex.set(prop.templateName, prop); + }); + }); + props.forEach(function(prop) { + if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { + boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceInfo)); + } + }); + return boundElementProps; + }; + TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceInfo) { + var unit = null; + var bindingType; + var boundPropertyName; + var parts = lang_1.StringWrapper.split(name, PROPERTY_PARTS_SEPARATOR); + if (parts.length === 1) { + boundPropertyName = this._schemaRegistry.getMappedPropName(util_1.dashCaseToCamelCase(parts[0])); + bindingType = template_ast_1.PropertyBindingType.Property; + if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { + this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property in " + sourceInfo); + } + } else if (parts[0] == ATTRIBUTE_PREFIX) { + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Attribute; + } else if (parts[0] == CLASS_PREFIX) { + boundPropertyName = parts[1]; + bindingType = template_ast_1.PropertyBindingType.Class; + } else if (parts[0] == STYLE_PREFIX) { + unit = parts.length > 2 ? parts[2] : null; + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Style; + } else { + this._reportError("Invalid property name " + name + " in " + sourceInfo); + bindingType = null; + } + return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceInfo); + }; + TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { + var componentTypeNames = []; + directives.forEach(function(directive) { + var typeName = directive.directive.type.name; + if (directive.directive.isComponent) { + componentTypeNames.push(typeName); + } + }); + return componentTypeNames; + }; + TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceInfo) { + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 1) { + this._reportError("More than one component: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + }; + TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceInfo) { + var _this = this; + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 0) { + this._reportError("Components on an embedded template: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + elementProps.forEach(function(prop) { + _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template in " + prop.sourceInfo); + }); + }; + TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events, sourceInfo) { + var _this = this; + var allDirectiveEvents = new Set(); + directives.forEach(function(directive) { + collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { + allDirectiveEvents.add(eventName); + }); + }); + events.forEach(function(event) { + if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { + _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template in " + sourceInfo); + } + }); + }; + return TemplateParseVisitor; + })(); + var NonBindableVisitor = (function() { + function NonBindableVisitor() {} + NonBindableVisitor.prototype.visitElement = function(ast, component) { + var preparsedElement = template_preparser_1.preparseElement(ast); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { + return null; + } + var attrNameAndValues = ast.attrs.map(function(attrAst) { + return [attrAst.name, attrAst.value]; + }); + var selector = createElementCssSelector(ast.name, attrNameAndValues); + var ngContentIndex = component.findNgContentIndex(selector); + var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); + return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitAttr = function(ast, context) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + }; + return NonBindableVisitor; + })(); + var BoundElementOrDirectiveProperty = (function() { + function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceInfo) { + this.name = name; + this.expression = expression; + this.isLiteral = isLiteral; + this.sourceInfo = sourceInfo; + } + return BoundElementOrDirectiveProperty; + })(); + function splitClasses(classAttrValue) { + return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); + } + exports.splitClasses = splitClasses; + var Component = (function() { + function Component(ngContentIndexMatcher, wildcardNgContentIndex) { + this.ngContentIndexMatcher = ngContentIndexMatcher; + this.wildcardNgContentIndex = wildcardNgContentIndex; + } + Component.create = function(directives) { + if (directives.length === 0 || !directives[0].directive.isComponent) { + return EMPTY_COMPONENT; + } + var matcher = new selector_1.SelectorMatcher(); + var ngContentSelectors = directives[0].directive.template.ngContentSelectors; + var wildcardNgContentIndex = null; + for (var i = 0; i < ngContentSelectors.length; i++) { + var selector = ngContentSelectors[i]; + if (lang_1.StringWrapper.equals(selector, '*')) { + wildcardNgContentIndex = i; + } else { + matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); + } + } + return new Component(matcher, wildcardNgContentIndex); + }; + Component.prototype.findNgContentIndex = function(selector) { + var ngContentIndices = []; + this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { + ngContentIndices.push(ngContentIndex); + }); + collection_1.ListWrapper.sort(ngContentIndices); + if (lang_1.isPresent(this.wildcardNgContentIndex)) { + ngContentIndices.push(this.wildcardNgContentIndex); + } + return ngContentIndices.length > 0 ? ngContentIndices[0] : null; + }; + return Component; + })(); + function createElementCssSelector(elementName, matchableAttrs) { + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(elementName); + for (var i = 0; i < matchableAttrs.length; i++) { + var attrName = matchableAttrs[i][0].toLowerCase(); + var attrValue = matchableAttrs[i][1]; + cssSelector.addAttribute(attrName, attrValue); + if (attrName == CLASS_ATTR) { + var classes = splitClasses(attrValue); + classes.forEach(function(className) { + return cssSelector.addClassName(className); + }); + } + } + return cssSelector; + } + var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); + var NON_BINDABLE_VISITOR = new NonBindableVisitor(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/core/dom/generic_browser_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var generic_browser_adapter_1 = require("angular2/src/core/dom/generic_browser_adapter"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var DOM_KEY_LOCATION_NUMPAD = 3; + var _keyMap = { + '\b': 'Backspace', + '\t': 'Tab', + '\x7F': 'Delete', + '\x1B': 'Escape', + 'Del': 'Delete', + 'Esc': 'Escape', + 'Left': 'ArrowLeft', + 'Right': 'ArrowRight', + 'Up': 'ArrowUp', + 'Down': 'ArrowDown', + 'Menu': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'Win': 'OS' + }; + var _chromeNumKeyPadMap = { + 'A': '1', + 'B': '2', + 'C': '3', + 'D': '4', + 'E': '5', + 'F': '6', + 'G': '7', + 'H': '8', + 'I': '9', + 'J': '*', + 'K': '+', + 'M': '-', + 'N': '.', + 'O': '/', + '\x60': '0', + '\x90': 'NumLock' + }; + var BrowserDomAdapter = (function(_super) { + __extends(BrowserDomAdapter, _super); + function BrowserDomAdapter() { + _super.apply(this, arguments); + } + BrowserDomAdapter.prototype.parse = function(templateHtml) { + throw new Error("parse not implemented"); + }; + BrowserDomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); + }; + BrowserDomAdapter.prototype.hasProperty = function(element, name) { + return name in element; + }; + BrowserDomAdapter.prototype.setProperty = function(el, name, value) { + el[name] = value; + }; + BrowserDomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { + el[methodName].apply(el, args); + }; + BrowserDomAdapter.prototype.logError = function(error) { + if (window.console.error) { + window.console.error(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.log = function(error) { + window.console.log(error); + }; + BrowserDomAdapter.prototype.logGroup = function(error) { + if (window.console.group) { + window.console.group(error); + this.logError(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.logGroupEnd = function() { + if (window.console.groupEnd) { + window.console.groupEnd(); + } + }; + Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + BrowserDomAdapter.prototype.query = function(selector) { + return document.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelector = function(el, selector) { + return el.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { + return el.querySelectorAll(selector); + }; + BrowserDomAdapter.prototype.on = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + }; + BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + return function() { + el.removeEventListener(evt, listener, false); + }; + }; + BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { + el.dispatchEvent(evt); + }; + BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { + var evt = document.createEvent('MouseEvent'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.createEvent = function(eventType) { + var evt = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.preventDefault = function(evt) { + evt.preventDefault(); + evt.returnValue = false; + }; + BrowserDomAdapter.prototype.isPrevented = function(evt) { + return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + BrowserDomAdapter.prototype.getInnerHTML = function(el) { + return el.innerHTML; + }; + BrowserDomAdapter.prototype.getOuterHTML = function(el) { + return el.outerHTML; + }; + BrowserDomAdapter.prototype.nodeName = function(node) { + return node.nodeName; + }; + BrowserDomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + BrowserDomAdapter.prototype.type = function(node) { + return node.type; + }; + BrowserDomAdapter.prototype.content = function(node) { + if (this.hasProperty(node, "content")) { + return node.content; + } else { + return node; + } + }; + BrowserDomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + BrowserDomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + BrowserDomAdapter.prototype.parentElement = function(el) { + return el.parentNode; + }; + BrowserDomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + BrowserDomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + BrowserDomAdapter.prototype.clearNodes = function(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }; + BrowserDomAdapter.prototype.appendChild = function(el, node) { + el.appendChild(node); + }; + BrowserDomAdapter.prototype.removeChild = function(el, node) { + el.removeChild(node); + }; + BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { + el.replaceChild(newChild, oldChild); + }; + BrowserDomAdapter.prototype.remove = function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + return node; + }; + BrowserDomAdapter.prototype.insertBefore = function(el, node) { + el.parentNode.insertBefore(node, el); + }; + BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { + nodes.forEach(function(n) { + return el.parentNode.insertBefore(n, el); + }); + }; + BrowserDomAdapter.prototype.insertAfter = function(el, node) { + el.parentNode.insertBefore(node, el.nextSibling); + }; + BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { + el.innerHTML = value; + }; + BrowserDomAdapter.prototype.getText = function(el) { + return el.textContent; + }; + BrowserDomAdapter.prototype.setText = function(el, value) { + el.textContent = value; + }; + BrowserDomAdapter.prototype.getValue = function(el) { + return el.value; + }; + BrowserDomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + BrowserDomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + BrowserDomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + BrowserDomAdapter.prototype.createComment = function(text) { + return document.createComment(text); + }; + BrowserDomAdapter.prototype.createTemplate = function(html) { + var t = document.createElement('template'); + t.innerHTML = html; + return t; + }; + BrowserDomAdapter.prototype.createElement = function(tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElement(tagName); + }; + BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElementNS(ns, tagName); + }; + BrowserDomAdapter.prototype.createTextNode = function(text, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createTextNode(text); + }; + BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { + if (doc === void 0) { + doc = document; + } + var el = doc.createElement('SCRIPT'); + el.setAttribute(attrName, attrValue); + return el; + }; + BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { + if (doc === void 0) { + doc = document; + } + var style = doc.createElement('style'); + this.appendChild(style, this.createTextNode(css)); + return style; + }; + BrowserDomAdapter.prototype.createShadowRoot = function(el) { + return el.createShadowRoot(); + }; + BrowserDomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + BrowserDomAdapter.prototype.getHost = function(el) { + return el.host; + }; + BrowserDomAdapter.prototype.clone = function(node) { + return node.cloneNode(true); + }; + BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { + return element.getElementsByClassName(name); + }; + BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { + return element.getElementsByTagName(name); + }; + BrowserDomAdapter.prototype.classList = function(element) { + return Array.prototype.slice.call(element.classList, 0); + }; + BrowserDomAdapter.prototype.addClass = function(element, classname) { + element.classList.add(classname); + }; + BrowserDomAdapter.prototype.removeClass = function(element, classname) { + element.classList.remove(classname); + }; + BrowserDomAdapter.prototype.hasClass = function(element, classname) { + return element.classList.contains(classname); + }; + BrowserDomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + element.style[stylename] = stylevalue; + }; + BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { + element.style[stylename] = null; + }; + BrowserDomAdapter.prototype.getStyle = function(element, stylename) { + return element.style[stylename]; + }; + BrowserDomAdapter.prototype.tagName = function(element) { + return element.tagName; + }; + BrowserDomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = element.attributes; + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.hasAttribute(attribute); + }; + BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { + return element.getAttribute(attribute); + }; + BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { + element.setAttribute(name, value); + }; + BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { + element.setAttributeNS(ns, name, value); + }; + BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { + element.removeAttribute(attribute); + }; + BrowserDomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + BrowserDomAdapter.prototype.createHtmlDocument = function() { + return document.implementation.createHTMLDocument('fakeTitle'); + }; + BrowserDomAdapter.prototype.defaultDoc = function() { + return document; + }; + BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { + try { + return el.getBoundingClientRect(); + } catch (e) { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; + } + }; + BrowserDomAdapter.prototype.getTitle = function() { + return document.title; + }; + BrowserDomAdapter.prototype.setTitle = function(newTitle) { + document.title = newTitle || ''; + }; + BrowserDomAdapter.prototype.elementMatches = function(n, selector) { + var matches = false; + if (n instanceof HTMLElement) { + if (n.matches) { + matches = n.matches(selector); + } else if (n.msMatchesSelector) { + matches = n.msMatchesSelector(selector); + } else if (n.webkitMatchesSelector) { + matches = n.webkitMatchesSelector(selector); + } + } + return matches; + }; + BrowserDomAdapter.prototype.isTemplateElement = function(el) { + return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; + }; + BrowserDomAdapter.prototype.isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + BrowserDomAdapter.prototype.isCommentNode = function(node) { + return node.nodeType === Node.COMMENT_NODE; + }; + BrowserDomAdapter.prototype.isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + BrowserDomAdapter.prototype.hasShadowRoot = function(node) { + return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); + }; + BrowserDomAdapter.prototype.isShadowRoot = function(node) { + return node instanceof DocumentFragment; + }; + BrowserDomAdapter.prototype.importIntoDoc = function(node) { + var toImport = node; + if (this.isTemplateElement(node)) { + toImport = this.content(node); + } + return document.importNode(toImport, true); + }; + BrowserDomAdapter.prototype.adoptNode = function(node) { + return document.adoptNode(node); + }; + BrowserDomAdapter.prototype.getHref = function(el) { + return el.href; + }; + BrowserDomAdapter.prototype.getEventKey = function(event) { + var key = event.key; + if (lang_1.isBlank(key)) { + key = event.keyIdentifier; + if (lang_1.isBlank(key)) { + return 'Unidentified'; + } + if (key.startsWith('U+')) { + key = String.fromCharCode(parseInt(key.substring(2), 16)); + if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { + key = _chromeNumKeyPadMap[key]; + } + } + } + if (_keyMap.hasOwnProperty(key)) { + key = _keyMap[key]; + } + return key; + }; + BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return window; + } else if (target == "document") { + return document; + } else if (target == "body") { + return document.body; + } + }; + BrowserDomAdapter.prototype.getHistory = function() { + return window.history; + }; + BrowserDomAdapter.prototype.getLocation = function() { + return window.location; + }; + BrowserDomAdapter.prototype.getBaseHref = function() { + var href = getBaseElementHref(); + if (lang_1.isBlank(href)) { + return null; + } + return relativePath(href); + }; + BrowserDomAdapter.prototype.resetBaseElement = function() { + baseElement = null; + }; + BrowserDomAdapter.prototype.getUserAgent = function() { + return window.navigator.userAgent; + }; + BrowserDomAdapter.prototype.setData = function(element, name, value) { + this.setAttribute(element, 'data-' + name, value); + }; + BrowserDomAdapter.prototype.getData = function(element, name) { + return this.getAttribute(element, 'data-' + name); + }; + BrowserDomAdapter.prototype.getComputedStyle = function(element) { + return getComputedStyle(element); + }; + BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { + return window.requestAnimationFrame(callback); + }; + BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { + window.cancelAnimationFrame(id); + }; + BrowserDomAdapter.prototype.performanceNow = function() { + if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { + return window.performance.now(); + } else { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + } + }; + return BrowserDomAdapter; + })(generic_browser_adapter_1.GenericBrowserDomAdapter); + exports.BrowserDomAdapter = BrowserDomAdapter; + var baseElement = null; + function getBaseElementHref() { + if (lang_1.isBlank(baseElement)) { + baseElement = document.querySelector('base'); + if (lang_1.isBlank(baseElement)) { + return null; + } + } + return baseElement.getAttribute('href'); + } + var urlParsingNode = null; + function relativePath(url) { + if (lang_1.isBlank(urlParsingNode)) { + urlParsingNode = document.createElement("a"); + } + urlParsingNode.setAttribute('href', url); + return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/angular2", "angular2/src/core/application_common", "angular2/src/core/application_ref", "angular2/src/compiler/compiler", "angular2/src/facade/async", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/upgrade/metadata"); + var util_1 = require("angular2/src/upgrade/util"); + var constants_1 = require("angular2/src/upgrade/constants"); + var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter"); + var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter"); + var angular = require("angular2/src/upgrade/angular_js"); + var upgradeCount = 0; + var UpgradeAdapter = (function() { + function UpgradeAdapter() { + this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_"; + this.upgradedComponents = []; + this.downgradedComponents = {}; + this.providers = []; + } + UpgradeAdapter.prototype.downgradeNg2Component = function(type) { + this.upgradedComponents.push(type); + var info = metadata_1.getComponentInfo(type); + return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c"); + }; + UpgradeAdapter.prototype.upgradeNg1Component = function(name) { + if (this.downgradedComponents.hasOwnProperty(name)) { + return this.downgradedComponents[name].type; + } else { + return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type; + } + }; + UpgradeAdapter.prototype.bootstrap = function(element, modules, config) { + var _this = this; + var upgrade = new UpgradeAdapterRef(); + var ng1Injector = null; + var platformRef = angular2_1.platform(); + var applicationRef = platformRef.application([application_ref_1.applicationCommonProviders(), application_common_1.applicationDomProviders(), compiler_1.compilerProviders(), angular2_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() { + return ng1Injector; + }}), angular2_1.provide(constants_1.NG1_COMPILE, {useFactory: function() { + return ng1Injector.get(constants_1.NG1_COMPILE); + }}), this.providers]); + var injector = applicationRef.injector; + var ngZone = injector.get(angular2_1.NgZone); + var compiler = injector.get(angular2_1.Compiler); + var delayApplyExps = []; + var original$applyFn; + var rootScopePrototype; + var rootScope; + var protoViewRefMap = {}; + var ng1Module = angular.module(this.idPrefix, modules); + var ng1compilePromise = null; + ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(angular2_1.AppViewManager)).config(['$provide', function(provide) { + provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) { + rootScopePrototype = rootScopeDelegate.constructor.prototype; + if (rootScopePrototype.hasOwnProperty('$apply')) { + original$applyFn = rootScopePrototype.$apply; + rootScopePrototype.$apply = function(exp) { + return delayApplyExps.push(exp); + }; + } else { + throw new Error("Failed to find '$apply' on '$rootScope'!"); + } + return rootScope = rootScopeDelegate; + }]); + }]).run(['$injector', '$rootScope', function(injector, rootScope) { + ng1Injector = injector; + async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) { + ngZone.run(function() { + return rootScope.$apply(); + }); + }); + ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector); + }]); + angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector); + ngZone.run(function() { + angular.bootstrap(element, [_this.idPrefix], config); + }); + Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() { + ngZone.run(function() { + if (rootScopePrototype) { + rootScopePrototype.$apply = original$applyFn; + while (delayApplyExps.length) { + rootScope.$apply(delayApplyExps.shift()); + } + upgrade._bootstrapDone(applicationRef, ng1Injector); + rootScopePrototype = null; + } + }); + }, util_1.onError); + return upgrade; + }; + UpgradeAdapter.prototype.addProvider = function(provider) { + this.providers.push(provider); + }; + UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) { + var token = options && options.asToken || name; + this.providers.push(angular2_1.provide(token, { + useFactory: function(ng1Injector) { + return ng1Injector.get(name); + }, + deps: [constants_1.NG1_INJECTOR] + })); + }; + UpgradeAdapter.prototype.downgradeNg2Provider = function(token) { + var factory = function(injector) { + return injector.get(token); + }; + factory.$inject = [constants_1.NG2_INJECTOR]; + return factory; + }; + UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) { + var _this = this; + var promises = []; + var types = this.upgradedComponents; + for (var i = 0; i < types.length; i++) { + promises.push(compiler.compileInHost(types[i])); + } + return Promise.all(promises).then(function(protoViews) { + var types = _this.upgradedComponents; + for (var i = 0; i < protoViews.length; i++) { + protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i]; + } + return protoViewRefMap; + }, util_1.onError); + }; + return UpgradeAdapter; + })(); + exports.UpgradeAdapter = UpgradeAdapter; + function ng1ComponentDirective(info, idPrefix) { + directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE]; + function directiveFactory(protoViewRefMap, viewManager, parse) { + var protoView = protoViewRefMap[info.selector]; + if (!protoView) + throw new Error('Expecting ProtoViewRef for: ' + info.selector); + var idCount = 0; + return { + restrict: 'E', + require: constants_1.REQUIRE_INJECTOR, + link: {post: function(scope, element, attrs, parentInjector, transclude) { + var domElement = element[0]; + var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView); + facade.setupInputs(); + facade.bootstrapNg2(); + facade.projectContent(); + facade.setupOutputs(); + facade.registerCleanup(); + }} + }; + } + return directiveFactory; + } + var UpgradeAdapterRef = (function() { + function UpgradeAdapterRef() { + this._readyFn = null; + this.ng1RootScope = null; + this.ng1Injector = null; + this.ng2ApplicationRef = null; + this.ng2Injector = null; + } + UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) { + this.ng2ApplicationRef = applicationRef; + this.ng2Injector = applicationRef.injector; + this.ng1Injector = ng1Injector; + this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE); + this._readyFn && this._readyFn(this); + }; + UpgradeAdapterRef.prototype.ready = function(fn) { + this._readyFn = fn; + }; + UpgradeAdapterRef.prototype.dispose = function() { + this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy(); + this.ng2ApplicationRef.dispose(); + }; + return UpgradeAdapterRef; + })(); + exports.UpgradeAdapterRef = UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/linker/template_commands", "angular2/src/compiler/directive_metadata", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/command_compiler", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var di_1 = require("angular2/src/core/di"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var command_compiler_2 = require("angular2/src/compiler/command_compiler"); + var util_1 = require("angular2/src/compiler/util"); + var TemplateCompiler = (function() { + function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _commandCompiler, _cdCompiler) { + this._runtimeMetadataResolver = _runtimeMetadataResolver; + this._templateNormalizer = _templateNormalizer; + this._templateParser = _templateParser; + this._styleCompiler = _styleCompiler; + this._commandCompiler = _commandCompiler; + this._cdCompiler = _cdCompiler; + this._hostCacheKeys = new Map(); + this._compiledTemplateCache = new Map(); + this._compiledTemplateDone = new Map(); + this._nextTemplateId = 0; + } + TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { + if (!directive.isComponent) { + return async_1.PromiseWrapper.resolve(directive); + } + return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { + return new directive_metadata_1.CompileDirectiveMetadata({ + type: directive.type, + isComponent: directive.isComponent, + dynamicLoadable: directive.dynamicLoadable, + selector: directive.selector, + exportAs: directive.exportAs, + changeDetection: directive.changeDetection, + inputs: directive.inputs, + outputs: directive.outputs, + hostListeners: directive.hostListeners, + hostProperties: directive.hostProperties, + hostAttributes: directive.hostAttributes, + lifecycleHooks: directive.lifecycleHooks, + template: normalizedTemplate + }); + }); + }; + TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { + var hostCacheKey = this._hostCacheKeys.get(type); + if (lang_1.isBlank(hostCacheKey)) { + hostCacheKey = new Object(); + this._hostCacheKeys.set(type, hostCacheKey); + var compMeta = this._runtimeMetadataResolver.getMetadata(type); + assertComponent(compMeta); + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], new Set()); + } + return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { + return new template_commands_1.CompiledHostTemplate(compiledTemplate); + }); + }; + TemplateCompiler.prototype.clearCache = function() { + this._hostCacheKeys.clear(); + this._styleCompiler.clearCache(); + this._compiledTemplateCache.clear(); + this._compiledTemplateDone.clear(); + }; + TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, compilingComponentCacheKeys) { + var _this = this; + var compiledTemplate = this._compiledTemplateCache.get(cacheKey); + var done = this._compiledTemplateDone.get(cacheKey); + if (lang_1.isBlank(compiledTemplate)) { + var styles = []; + var changeDetectorFactory; + var commands = []; + var templateId = lang_1.stringify(compMeta.type.runtime) + "Template" + this._nextTemplateId++; + compiledTemplate = new template_commands_1.CompiledComponentTemplate(templateId, function(dispatcher) { + return changeDetectorFactory(dispatcher); + }, commands, styles); + this._compiledTemplateCache.set(cacheKey, compiledTemplate); + compilingComponentCacheKeys.add(cacheKey); + done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(viewDirectives.map(function(dirMeta) { + return _this.normalizeDirectiveMetadata(dirMeta); + }))).then(function(stylesAndNormalizedViewDirMetas) { + var childPromises = []; + var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); + var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, compMeta.type.name); + var changeDetectorFactories = _this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); + changeDetectorFactory = changeDetectorFactories[0]; + var tmpStyles = stylesAndNormalizedViewDirMetas[0]; + tmpStyles.forEach(function(style) { + return styles.push(style); + }); + var tmpCommands = _this._compileCommandsRuntime(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises); + tmpCommands.forEach(function(cmd) { + return commands.push(cmd); + }); + return async_1.PromiseWrapper.all(childPromises); + }).then(function(_) { + collection_1.SetWrapper.delete(compilingComponentCacheKeys, cacheKey); + return compiledTemplate; + }); + this._compiledTemplateDone.set(cacheKey, done); + } + return compiledTemplate; + }; + TemplateCompiler.prototype._compileCommandsRuntime = function(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises) { + var _this = this; + var cmds = this._commandCompiler.compileComponentRuntime(compMeta, parsedTemplate, changeDetectorFactories, function(childComponentDir) { + var childCacheKey = childComponentDir.type.runtime; + var childViewDirectives = _this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); + var childIsRecursive = collection_1.SetWrapper.has(compilingComponentCacheKeys, childCacheKey); + var childTemplate = _this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, compilingComponentCacheKeys); + if (!childIsRecursive) { + childPromises.push(_this._compiledTemplateDone.get(childCacheKey)); + } + return function() { + return childTemplate; + }; + }); + cmds.forEach(function(cmd) { + if (cmd instanceof template_commands_1.BeginComponentCmd) { + cmd.templateGetter(); + } + }); + return cmds; + }; + TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { + var _this = this; + if (components.length === 0) { + throw new exceptions_1.BaseException('No components given'); + } + var declarations = []; + var templateArguments = []; + var componentMetas = []; + components.forEach(function(componentWithDirs) { + var compMeta = componentWithDirs.component; + assertComponent(compMeta); + componentMetas.push(compMeta); + _this._processTemplateCodeGen(compMeta, componentWithDirs.directives, declarations, templateArguments); + if (compMeta.dynamicLoadable) { + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + componentMetas.push(hostMeta); + _this._processTemplateCodeGen(hostMeta, [compMeta], declarations, templateArguments); + } + }); + collection_1.ListWrapper.forEachWithIndex(componentMetas, function(compMeta, index) { + var templateId = compMeta.type.moduleUrl + "|" + compMeta.type.name; + var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; + var compiledTemplateExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledComponentTemplate('" + templateId + "'," + templateArguments[index].join(',') + ")"; + var variableValueExpr; + if (compMeta.type.isHost) { + variableValueExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledHostTemplate(" + compiledTemplateExpr + ")"; + } else { + variableValueExpr = compiledTemplateExpr; + } + var varName = templateVariableName(compMeta.type); + declarations.push("" + util_1.codeGenExportVariable(varName) + variableValueExpr + ";"); + declarations.push(util_1.codeGenValueFn([], varName, templateGetterName(compMeta.type)) + ";"); + }); + var moduleUrl = components[0].component.type.moduleUrl; + return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); + }; + TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); + }; + TemplateCompiler.prototype._processTemplateCodeGen = function(compMeta, directives, targetDeclarations, targetTemplateArguments) { + var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); + var parsedTemplate = this._templateParser.parse(compMeta.template.template, directives, compMeta.type.name); + var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); + var commandsExpr = this._commandCompiler.compileComponentCodeGen(compMeta, parsedTemplate, changeDetectorsExprs.expressions, codeGenComponentTemplateFactory); + addAll(styleExpr.declarations, targetDeclarations); + addAll(changeDetectorsExprs.declarations, targetDeclarations); + addAll(commandsExpr.declarations, targetDeclarations); + targetTemplateArguments.push([changeDetectorsExprs.expressions[0], commandsExpr.expression, styleExpr.expression]); + }; + TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler])], TemplateCompiler); + return TemplateCompiler; + })(); + exports.TemplateCompiler = TemplateCompiler; + var NormalizedComponentWithViewDirectives = (function() { + function NormalizedComponentWithViewDirectives(component, directives) { + this.component = component; + this.directives = directives; + } + return NormalizedComponentWithViewDirectives; + })(); + exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; + function assertComponent(meta) { + if (!meta.isComponent) { + throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); + } + } + function templateVariableName(type) { + return type.name + "Template"; + } + function templateGetterName(type) { + return templateVariableName(type) + "Getter"; + } + function templateModuleUrl(moduleUrl) { + var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); + return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; + } + function addAll(source, target) { + for (var i = 0; i < source.length; i++) { + target.push(source[i]); + } + } + function codeGenComponentTemplateFactory(nestedCompType) { + return "" + source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + templateGetterName(nestedCompType.type); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_common", ["angular2/src/common/forms", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/dom/browser_adapter", "angular2/src/core/testability/browser_testability", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr", "angular2/src/compiler/xhr_impl", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/events/key_events", "angular2/src/core/render/dom/events/hammer_gestures", "angular2/src/core/testability/testability", "angular2/src/core/render/api", "angular2/src/core/render/render", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/platform_bindings", "angular2/src/animate/animation_builder", "angular2/src/animate/browser_details", "angular2/src/core/profile/wtf_init", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var forms_1 = require("angular2/src/common/forms"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var browser_testability_1 = require("angular2/src/core/testability/browser_testability"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var key_events_1 = require("angular2/src/core/render/dom/events/key_events"); + var hammer_gestures_1 = require("angular2/src/core/render/dom/events/hammer_gestures"); + var testability_1 = require("angular2/src/core/testability/testability"); + var api_1 = require("angular2/src/core/render/api"); + var render_1 = require("angular2/src/core/render/render"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var platform_bindings_1 = require("angular2/src/core/platform_bindings"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); + var application_ref_1 = require("angular2/src/core/application_ref"); + function applicationDomProviders() { + if (lang_1.isBlank(dom_adapter_1.DOM)) { + throw "Must set a root DOM adapter first."; + } + return [di_1.provide(render_1.DOCUMENT, {useValue: dom_adapter_1.DOM.defaultDoc()}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: key_events_1.KeyEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: hammer_gestures_1.HammerGesturesPlugin, + multi: true + }), di_1.provide(render_1.DomRenderer, {useClass: render_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), shared_styles_host_1.DomSharedStylesHost, di_1.provide(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), platform_bindings_1.EXCEPTION_PROVIDER, di_1.provide(xhr_1.XHR, {useValue: new xhr_impl_1.XHRImpl()}), testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, forms_1.FORM_PROVIDERS]; + } + exports.applicationDomProviders = applicationDomProviders; + function platform(providers) { + return application_ref_1.platformCommon(providers, function() { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + wtf_init_1.wtfInit(); + browser_testability_1.BrowserGetTestability.init(); + }); + } + exports.platform = platform; + function commonBootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var p = platform(); + var bindings = [application_ref_1.applicationCommonProviders(), applicationDomProviders()]; + if (lang_1.isPresent(appProviders)) { + bindings.push(appProviders); + } + return p.application(bindings).bootstrap(appComponentType); + } + exports.commonBootstrap = commonBootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter"); + exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter; + exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/proto_view_factory", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var compiler_1 = require("angular2/src/core/linker/compiler"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + var di_1 = require("angular2/src/core/di"); + var RuntimeCompiler = (function(_super) { + __extends(RuntimeCompiler, _super); + function RuntimeCompiler() { + _super.apply(this, arguments); + } + return RuntimeCompiler; + })(compiler_1.Compiler); + exports.RuntimeCompiler = RuntimeCompiler; + var RuntimeCompiler_ = (function(_super) { + __extends(RuntimeCompiler_, _super); + function RuntimeCompiler_(_protoViewFactory, _templateCompiler) { + _super.call(this, _protoViewFactory); + this._templateCompiler = _templateCompiler; + } + RuntimeCompiler_.prototype.compileInHost = function(componentType) { + var _this = this; + return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(compiledHostTemplate) { + return compiler_1.internalCreateProtoView(_this, compiledHostTemplate); + }); + }; + RuntimeCompiler_.prototype.clearCache = function() { + _super.prototype.clearCache.call(this); + this._templateCompiler.clearCache(); + }; + RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory, template_compiler_1.TemplateCompiler])], RuntimeCompiler_); + return RuntimeCompiler_; + })(compiler_1.Compiler_); + exports.RuntimeCompiler_ = RuntimeCompiler_; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/compiler/app_root_url", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + exports.TemplateCompiler = template_compiler_1.TemplateCompiler; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; + exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; + exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; + var source_module_1 = require("angular2/src/compiler/source_module"); + exports.SourceModule = source_module_1.SourceModule; + exports.SourceWithImports = source_module_1.SourceWithImports; + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; + exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_compiler_2 = require("angular2/src/compiler/template_compiler"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); + function compilerProviders() { + return [change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_1.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler, di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true)}), template_compiler_2.TemplateCompiler, di_1.provide(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), di_1.provide(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), url_resolver_1.UrlResolver]; + } + exports.compilerProviders = compilerProviders; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application", ["angular2/src/facade/lang", "angular2/src/compiler/compiler", "angular2/src/core/application_common", "angular2/src/core/application_tokens", "angular2/src/core/application_common", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT; + exports.APP_ID = application_tokens_1.APP_ID; + var application_common_2 = require("angular2/src/core/application_common"); + exports.platform = application_common_2.platform; + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.PlatformRef = application_ref_1.PlatformRef; + exports.ApplicationRef = application_ref_1.ApplicationRef; + exports.applicationCommonProviders = application_ref_1.applicationCommonProviders; + exports.createNgZone = application_ref_1.createNgZone; + exports.platformCommon = application_ref_1.platformCommon; + exports.platformProviders = application_ref_1.platformProviders; + function bootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var providers = [compiler_1.compilerProviders()]; + if (lang_1.isPresent(appProviders)) { + providers.push(appProviders); + } + return application_common_1.commonBootstrap(appComponentType, providers); + } + exports.bootstrap = bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/di", "angular2/src/common/pipes", "angular2/src/facade/facade", "angular2/src/core/application", "angular2/src/core/bootstrap", "angular2/src/core/services", "angular2/src/core/linker", "angular2/src/core/application_ref", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/core/debug", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/dev_mode"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/metadata")); + __export(require("angular2/src/core/util")); + __export(require("angular2/src/core/di")); + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/application")); + __export(require("angular2/src/core/bootstrap")); + __export(require("angular2/src/core/services")); + __export(require("angular2/src/core/linker")); + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.ApplicationRef = application_ref_1.ApplicationRef; + __export(require("angular2/src/core/zone")); + __export(require("angular2/src/core/render")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/core/debug")); + __export(require("angular2/src/core/change_detection")); + __export(require("angular2/src/core/platform_directives_and_pipes")); + __export(require("angular2/src/core/dev_mode")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/angular2", ["angular2/common", "angular2/core", "angular2/profile", "angular2/lifecycle_hooks", "angular2/bootstrap", "angular2/upgrade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/common")); + __export(require("angular2/core")); + __export(require("angular2/profile")); + __export(require("angular2/lifecycle_hooks")); + __export(require("angular2/bootstrap")); + __export(require("angular2/upgrade")); + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=angular2.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/angular2.js b/2.0.0-alpha.46/angular2.js new file mode 100644 index 0000000000..ccae865e21 --- /dev/null +++ b/2.0.0-alpha.46/angular2.js @@ -0,0 +1,38876 @@ +/** + @license +Copyright 2014-2015 Google, Inc. http://angularjs.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + */ + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + +// TODO(vicb): remove '!isFirefox' when the bug gets fixed: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1162013 +if (hasNativePromise && !isFirefox) { + // When available use a native Promise to schedule microtasks. + // When not available, es6-promise fallback will be used + var resolvedPromise = Promise.resolve(); + es6Promise._setScheduler(function(fn) { + resolvedPromise.then(fn); + }); +} + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"es6-promise":17}],5:[function(require,module,exports){ +(function (global){ +'use strict'; + +var fnPatch = require('./functions'); +var promisePatch = require('./promise'); +var mutationObserverPatch = require('./mutation-observer'); +var definePropertyPatch = require('./define-property'); +var registerElementPatch = require('./register-element'); +var webSocketPatch = require('./websocket'); +var eventTargetPatch = require('./event-target'); +var propertyDescriptorPatch = require('./property-descriptor'); +var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); + +function apply() { + fnPatch.patchSetClearFunction(global, [ + 'timeout', + 'interval', + 'immediate' + ]); + + fnPatch.patchRequestAnimationFrame(global, [ + 'requestAnimationFrame', + 'mozRequestAnimationFrame', + 'webkitRequestAnimationFrame' + ]); + + fnPatch.patchFunction(global, [ + 'alert', + 'prompt' + ]); + + eventTargetPatch.apply(); + + propertyDescriptorPatch.apply(); + + promisePatch.apply(); + + mutationObserverPatch.patchClass('MutationObserver'); + mutationObserverPatch.patchClass('WebKitMutationObserver'); + + definePropertyPatch.apply(); + + registerElementPatch.apply(); + + geolocationPatch.apply(); + + fileReaderPatch.apply(); +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(require,module,exports){ +'use strict'; + +var keys = require('../keys'); + +// might need similar for object.freeze +// i regret nothing + +var _defineProperty = Object.defineProperty; +var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); + +function apply() { + Object.defineProperty = function (obj, prop, desc) { + if (isUnconfigurable(obj, prop)) { + throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); + } + if (prop !== 'prototype') { + desc = rewriteDescriptor(obj, prop, desc); + } + return _defineProperty(obj, prop, desc); + }; + + Object.defineProperties = function (obj, props) { + Object.keys(props).forEach(function (prop) { + Object.defineProperty(obj, prop, props[prop]); + }); + return obj; + }; + + Object.create = function (obj, proto) { + if (typeof proto === 'object') { + Object.keys(proto).forEach(function (prop) { + proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); + }); + } + return _create(obj, proto); + }; + + Object.getOwnPropertyDescriptor = function (obj, prop) { + var desc = _getOwnPropertyDescriptor(obj, prop); + if (isUnconfigurable(obj, prop)) { + desc.configurable = false; + } + return desc; + }; +}; + +function _redefineProperty(obj, prop, desc) { + desc = rewriteDescriptor(obj, prop, desc); + return _defineProperty(obj, prop, desc); +}; + +function isUnconfigurable (obj, prop) { + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; +} + +function rewriteDescriptor (obj, prop, desc) { + desc.configurable = true; + if (!desc.configurable) { + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); + } + obj[unconfigurablesKey][prop] = true; + } + return desc; +} + +module.exports = { + apply: apply, + _redefineProperty: _redefineProperty +}; + + + +},{"../keys":3}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + // patched properties depend on addEventListener, so this needs to come first + if (global.EventTarget) { + utils.patchEventTargetMethods(global.EventTarget.prototype); + + // Note: EventTarget is not available in all browsers, + // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget + } else { + var apis = [ + 'ApplicationCache', + 'EventSource', + 'FileReader', + 'InputMethodContext', + 'MediaController', + 'MessagePort', + 'Node', + 'Performance', + 'SVGElementInstance', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebKitNamedFlow', + 'Worker', + 'WorkerGlobalScope', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload' + ]; + + apis.forEach(function(api) { + var proto = global[api] && global[api].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (proto && proto.addEventListener) { + utils.patchEventTargetMethods(proto); + } + }); + + // Patch the methods on `window` instead of `Window.prototype` + // `Window` is not accessible on Android 4.3 + if (typeof(window) !== 'undefined') { + utils.patchEventTargetMethods(window); + } + } +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":16}],9:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function patchSetClearFunction(obj, fnNames) { + fnNames.map(function (name) { + return name[0].toUpperCase() + name.substr(1); + }).forEach(function (name) { + var setName = 'set' + name; + var delegate = obj[setName]; + + if (delegate) { + var clearName = 'clear' + name; + var ids = {}; + + var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce; + + global.zone[setName] = function (fn) { + var id, fnRef = fn; + arguments[0] = function () { + delete ids[id]; + return fnRef.apply(this, arguments); + }; + var args = bindArgs(arguments); + id = delegate.apply(obj, args); + ids[id] = true; + return id; + }; + + obj[setName] = function () { + return global.zone[setName].apply(this, arguments); + }; + + var clearDelegate = obj[clearName]; + + global.zone[clearName] = function (id) { + if (ids[id]) { + delete ids[id]; + global.zone.dequeueTask(); + } + return clearDelegate.apply(this, arguments); + }; + + obj[clearName] = function () { + return global.zone[clearName].apply(this, arguments); + }; + } + }); +}; + + +/** + * requestAnimationFrame is typically recursively called from within the callback function + * that it executes. To handle this case, only fork a zone if this is executed + * within the root zone. + */ +function patchRequestAnimationFrame(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + global.zone[name] = function (fn) { + var callZone = global.zone.isRootZone() ? global.zone.fork() : global.zone; + if (fn) { + arguments[0] = function () { + return callZone.run(fn, this, arguments); + }; + } + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchSetFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + + if (delegate) { + global.zone[name] = function (fn) { + arguments[0] = function () { + return fn.apply(this, arguments); + }; + var args = utils.bindArgumentsOnce(arguments); + return delegate.apply(obj, args); + }; + + obj[name] = function () { + return zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + global.zone[name] = function () { + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + }); +}; + + +module.exports = { + patchSetClearFunction: patchSetClearFunction, + patchSetFunction: patchSetFunction, + patchRequestAnimationFrame: patchRequestAnimationFrame, + patchFunction: patchFunction +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + if (global.navigator && global.navigator.geolocation) { + utils.patchPrototype(global.navigator.geolocation, [ + 'getCurrentPosition', + 'watchPosition' + ]); + } +} + +module.exports = { + apply: apply +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],11:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function (fn) { + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); + // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks + this[creationZoneKey] = global.zone; + }; + + var instance = new OriginalClass(function () {}); + + global[className].prototype.disconnect = function () { + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; + } + return result; + }; + + global[className].prototype.observe = function () { + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; + } + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); + }; + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof global[className].prototype !== undefined) { + return; + } + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } +}; + +module.exports = { + patchClass: patchClass +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3}],12:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +/* + * Patches a function that returns a Promise-like instance. + * + * This function must be used when either: + * - Native Promises are not available, + * - The function returns a Promise-like object. + * + * This is required because zones rely on a Promise monkey patch that could not be applied when + * Promise is not natively available or when the returned object is not an instance of Promise. + * + * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work + * with minimal overhead. + * + * ``` + * var boundFunction = bindPromiseFn(FunctionReturningAPromise); + * + * boundFunction.then(successHandler, errorHandler); + * ``` + */ +var bindPromiseFn; + +if (global.Promise) { + bindPromiseFn = function (delegate) { + return function() { + var delegatePromise = delegate.apply(this, arguments); + + // if the delegate returned an instance of Promise, forward it. + if (delegatePromise instanceof Promise) { + return delegatePromise; + } + + // Otherwise wrap the Promise-like in a global Promise + return new Promise(function(resolve, reject) { + delegatePromise.then(resolve, reject); + }); + }; + }; +} else { + bindPromiseFn = function (delegate) { + return function () { + return _patchThenable(delegate.apply(this, arguments)); + }; + }; +} + + +function _patchPromiseFnsOnObject(objectPath, fnNames) { + var obj = global; + + var exists = objectPath.every(function (segment) { + obj = obj[segment]; + return obj; + }); + + if (!exists) { + return; + } + + fnNames.forEach(function (name) { + var fn = obj[name]; + if (fn) { + obj[name] = bindPromiseFn(fn); + } + }); +} + +function _patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = utils.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + var ocatch = thenable.catch; + thenable.catch = function () { + var args = utils.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + return thenable; +} + + +function apply() { + // Patch .then() and .catch() on native Promises to execute callbacks in the zone where + // those functions are called. + if (global.Promise) { + utils.patchPrototype(Promise.prototype, [ + 'then', + 'catch' + ]); + + // Patch browser APIs that return a Promise + var patchFns = [ + // fetch + [[], ['fetch']], + [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']] + ]; + + patchFns.forEach(function(objPathAndFns) { + _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]); + }); + } +} + +module.exports = { + apply: apply, + bindPromiseFn: bindPromiseFn +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],13:[function(require,module,exports){ +(function (global){ +'use strict'; + +var webSocketPatch = require('./websocket'); +var utils = require('../utils'); +var keys = require('../keys'); + +var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); + +function apply() { + if (utils.isWebWorker()){ + // on WebWorker so don't apply patch + return; + } + + var supportsWebSocket = typeof WebSocket !== 'undefined'; + if (canPatchViaPropertyDescriptor()) { + // for browsers that we can patch the descriptor: Chrome & Firefox + var onEventNames = eventNames.map(function (property) { + return 'on' + property; + }); + utils.patchProperties(HTMLElement.prototype, onEventNames); + utils.patchProperties(XMLHttpRequest.prototype); + if (supportsWebSocket) { + utils.patchProperties(WebSocket.prototype); + } + } else { + // Safari, Android browsers (Jelly Bean) + patchViaCapturingAllTheEvents(); + utils.patchClass('XMLHttpRequest'); + if (supportsWebSocket) { + webSocketPatch.apply(); + } + } +} + +function canPatchViaPropertyDescriptor() { + if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { + // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 + // IDL interface attributes are not configurable + var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); + if (desc && !desc.configurable) return false; + } + + Object.defineProperty(HTMLElement.prototype, 'onclick', { + get: function () { + return true; + } + }); + var elt = document.createElement('div'); + var result = !!elt.onclick; + Object.defineProperty(HTMLElement.prototype, 'onclick', {}); + return result; +}; + +var unboundKey = keys.create('unbound'); + +// Whenever any event fires, we check the event target and all parents +// for `onwhatever` properties and replace them with zone-bound functions +// - Chrome (for now) +function patchViaCapturingAllTheEvents() { + eventNames.forEach(function (property) { + var onproperty = 'on' + property; + document.addEventListener(property, function (event) { + var elt = event.target, bound; + while (elt) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { + bound = global.zone.bind(elt[onproperty]); + bound[unboundKey] = elt[onproperty]; + elt[onproperty] = bound; + } + elt = elt.parentElement; + } + }, true); + }); +}; + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(require,module,exports){ +(function (global){ +'use strict'; + +var _redefineProperty = require('./define-property')._redefineProperty; +var utils = require("../utils"); + +function apply() { + if (utils.isWebWorker() || !('registerElement' in global.document)) { + return; + } + + var _registerElement = document.registerElement; + var callbacks = [ + 'createdCallback', + 'attachedCallback', + 'detachedCallback', + 'attributeChangedCallback' + ]; + + document.registerElement = function (name, opts) { + if (opts && opts.prototype) { + callbacks.forEach(function (callback) { + if (opts.prototype.hasOwnProperty(callback)) { + var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = global.zone.bind(descriptor.value); + _redefineProperty(opts.prototype, callback, descriptor); + } else { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + } else if (opts.prototype[callback]) { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + }); + } + + return _registerElement.apply(document, [name, opts]); + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16,"./define-property":6}],15:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +// we have to patch the instance since the proto is non-configurable +function apply() { + var WS = global.WebSocket; + utils.patchEventTargetMethods(WS.prototype); + global.WebSocket = function(a, b) { + var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); + var proxySocket; + + // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance + var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); + if (onmessageDesc && onmessageDesc.configurable === false) { + proxySocket = Object.create(socket); + ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) { + proxySocket[propName] = function() { + return socket[propName].apply(socket, arguments); + }; + }); + } else { + // we can patch the real socket + proxySocket = socket; + } + + utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']); + + return proxySocket; + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],16:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('./keys'); + +function bindArguments(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bind(args[i]); + } + } + return args; +}; + +function bindArgumentsOnce(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bindOnce(args[i]); + } + } + return args; +}; + +function patchPrototype(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + obj[name] = function () { + return delegate.apply(this, bindArguments(arguments)); + }; + } + }); +}; + +function isWebWorker() { + return (typeof document === "undefined"); +} + +function patchProperty(obj, prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop) || { + enumerable: true, + configurable: true + }; + + // A property descriptor cannot have getter/setter and be writable + // deleting the writable and value properties avoids this error: + // + // TypeError: property descriptors must not specify a value or be writable when a + // getter or setter has been specified + delete desc.writable; + delete desc.value; + + // substr(2) cuz 'onclick' -> 'click', etc + var eventName = prop.substr(2); + var _prop = '_' + prop; + + desc.set = function (fn) { + if (this[_prop]) { + this.removeEventListener(eventName, this[_prop]); + } + + if (typeof fn === 'function') { + this[_prop] = fn; + this.addEventListener(eventName, fn, false); + } else { + this[_prop] = null; + } + }; + + desc.get = function () { + return this[_prop]; + }; + + Object.defineProperty(obj, prop, desc); +}; + +function patchProperties(obj, properties) { + (properties || (function () { + var props = []; + for (var prop in obj) { + props.push(prop); + } + return props; + }()). + filter(function (propertyName) { + return propertyName.substr(0,2) === 'on'; + })). + forEach(function (eventName) { + patchProperty(obj, eventName); + }); +}; + +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + +function patchEventTargetMethods(obj) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + var fn; + //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 + if (handler.toString() !== "[object FunctionWrapper]") { + if (handler.handleEvent) { + // Have to pass in 'handler' reference as an argument here, otherwise it gets clobbered in + // IE9 by the arguments[1] assignment at end of this function. + fn = (function(handler) { + return function() { + handler.handleEvent.apply(handler, arguments); + }; + })(handler); + } else { + fn = handler; + } + + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` (= `self`) + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + return global.zone.addEventListener.apply(target, arguments); + }; + + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + var result = global.zone.removeEventListener.apply(target, arguments); + global.zone.dequeueTask(handler[originalFnKey]); + return result; + }; +}; + +var originalInstanceKey = keys.create('originalInstance'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function () { + var a = bindArguments(arguments); + switch (a.length) { + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; + default: throw new Error('what are you even doing?'); + } + }; + + var instance = new OriginalClass(); + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } + + for (prop in OriginalClass) { + if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { + global[className][prop] = OriginalClass[prop]; + } + } +}; + +module.exports = { + bindArguments: bindArguments, + bindArgumentsOnce: bindArgumentsOnce, + patchPrototype: patchPrototype, + patchProperty: patchProperty, + patchProperties: patchProperties, + patchEventTargetMethods: patchEventTargetMethods, + patchClass: patchClass, + isWebWorker: isWebWorker +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./keys":3}],17:[function(require,module,exports){ +(function (process,global){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 3.0.2 + */ + +(function() { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x === 'function' || (typeof x === 'object' && x !== null); + } + + function lib$es6$promise$utils$$isFunction(x) { + return typeof x === 'function'; + } + + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } + + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + lib$es6$promise$utils$$_isArray = Array.isArray; + } + + var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len = 0; + var lib$es6$promise$asap$$toString = {}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + + var lib$es6$promise$asap$$asap = function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg; + lib$es6$promise$asap$$len += 2; + if (lib$es6$promise$asap$$len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + } + + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn = scheduleFn; + } + + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap = asapFn; + } + + var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + // test for web worker but not in IE10 + var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && + typeof importScripts !== 'undefined' && + typeof MessageChannel !== 'undefined'; + + // node + function lib$es6$promise$asap$$useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function() { + process.nextTick(lib$es6$promise$asap$$flush); + }; + } + + // vertx + function lib$es6$promise$asap$$useVertxTimer() { + return function() { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + + function lib$es6$promise$asap$$useMutationObserver() { + var iterations = 0; + var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function() { + node.data = (iterations = ++iterations % 2); + }; + } + + // web worker + function lib$es6$promise$asap$$useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + + function lib$es6$promise$asap$$useSetTimeout() { + return function() { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + + var lib$es6$promise$asap$$queue = new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) { + var callback = lib$es6$promise$asap$$queue[i]; + var arg = lib$es6$promise$asap$$queue[i+1]; + + callback(arg); + + lib$es6$promise$asap$$queue[i] = undefined; + lib$es6$promise$asap$$queue[i+1] = undefined; + } + + lib$es6$promise$asap$$len = 0; + } + + function lib$es6$promise$asap$$attemptVertx() { + try { + var r = require; + var vertx = r('vertx'); + lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } catch(e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + + var lib$es6$promise$asap$$scheduleFlush; + // Decide what async method to use to triggering processing of queued callbacks: + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick(); + } else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver(); + } else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); + } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); + } else { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); + } + + function lib$es6$promise$$internal$$noop() {} + + var lib$es6$promise$$internal$$PENDING = void 0; + var lib$es6$promise$$internal$$FULFILLED = 1; + var lib$es6$promise$$internal$$REJECTED = 2; + + var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } catch(error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error = error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } + } + + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function(promise) { + var sealed = false; + var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + lib$es6$promise$$internal$$resolve(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function(reason) { + if (sealed) { return; } + sealed = true; + + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor === promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } else { + var then = lib$es6$promise$$internal$$getThen(maybeThenable); + + if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } else if (then === undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); + } else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + lib$es6$promise$$internal$$publish(promise); + } + + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + + promise._result = value; + promise._state = lib$es6$promise$$internal$$FULFILLED; + + if (promise._subscribers.length !== 0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + promise._state = lib$es6$promise$$internal$$REJECTED; + promise._result = reason; + + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onerror = null; + + subscribers[length] = child; + subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment; + subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection; + + if (length === 0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + + function lib$es6$promise$$internal$$publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { return; } + + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; + } + + function lib$es6$promise$$internal$$ErrorObject() { + this.error = null; + } + + var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback = lib$es6$promise$utils$$isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = lib$es6$promise$$internal$$tryCatch(callback, detail); + + if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } + + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + + } else { + value = detail; + succeeded = true; + } + + if (promise._state !== lib$es6$promise$$internal$$PENDING) { + // noop + } else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } else if (settled === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value){ + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } catch(e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator = this; + + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; + + enumerator._init(); + + if (enumerator.length === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } else { + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) { + return lib$es6$promise$utils$$isArray(input); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._init = function() { + this._result = new Array(this.length); + }; + + var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator; + + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() { + var enumerator = this; + + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { + var enumerator = this; + var c = enumerator._instanceConstructor; + + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) { + entry._onerror = null; + enumerator._settledAt(entry._state, i, entry._result); + } else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } else { + enumerator._remaining--; + enumerator._result[i] = entry; + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { + var enumerator = this; + var promise = enumerator.promise; + + if (promise._state === lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + + if (state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } else { + enumerator._result[i] = value; + } + } + + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; + + lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; + } + var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject; + + var lib$es6$promise$promise$$counter = 0; + + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + var lib$es6$promise$promise$$default = lib$es6$promise$promise$$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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {function} resolver + Useful for tooling. + @constructor + */ + function lib$es6$promise$promise$$Promise(resolver) { + this._id = lib$es6$promise$promise$$counter++; + this._state = undefined; + this._result = undefined; + this._subscribers = []; + + if (lib$es6$promise$$internal$$noop !== resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + + lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap; + + lib$es6$promise$promise$$Promise.prototype = { + constructor: lib$es6$promise$promise$$Promise, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + then: function(onFulfillment, onRejection) { + var parent = this; + var state = parent._state; + + if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + + var child = new this.constructor(lib$es6$promise$$internal$$noop); + var result = parent._result; + + if (state) { + var callback = arguments[state - 1]; + lib$es6$promise$asap$$asap(function(){ + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + + return child; + }, + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + 'catch': function(onRejection) { + return this.then(null, onRejection); + } + }; + function lib$es6$promise$polyfill$$polyfill() { + var local; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) { + return; + } + + local.Promise = lib$es6$promise$promise$$default; + } + var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill; + + var lib$es6$promise$umd$$ES6Promise = { + 'Promise': lib$es6$promise$promise$$default, + 'polyfill': lib$es6$promise$polyfill$$default + }; + + /* global define:true module:true window: true */ + if (typeof define === 'function' && define['amd']) { + define(function() { return lib$es6$promise$umd$$ES6Promise; }); + } else if (typeof module !== 'undefined' && module['exports']) { + module['exports'] = lib$es6$promise$umd$$ES6Promise; + } else if (typeof this !== 'undefined') { + this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise; + } + + lib$es6$promise$polyfill$$default(); +}).call(this); + + +}).call(this,{},typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + if (IsUndefined(metadataMap)) { + return false; + } + if (!metadataMap.delete(metadataKey)) { + return false; + } + if (metadataMap.size > 0) { + return true; + } + var targetMetadata = __Metadata__.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) { + return true; + } + __Metadata__.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) { + throw new TypeError(); + } + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) { + throw new TypeError(); + } + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = __Metadata__.get(target); + if (!targetMetadata) { + if (!create) { + return undefined; + } + targetMetadata = new _Map(); + __Metadata__.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) { + return undefined; + } + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return true; + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryHasMetadata(MetadataKey, parent, P); + } + return false; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return false; + } + return Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryGetMetadata(MetadataKey, parent, P); + } + return undefined; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return undefined; + } + return metadataMap.get(MetadataKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) { + return ownKeys; + } + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) { + return ownKeys; + } + if (ownKeys.length <= 0) { + return parentKeys; + } + var set = new _Set(); + var keys = []; + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) { + metadataMap.forEach(function (_, key) { return keys.push(key); }); + } + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray(x); + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + if (IsSymbol(value)) { + return value; + } + return String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) { + return proto; + } + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) { + return proto; + } + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) { + return proto; + } + // if the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") { + return proto; + } + // if we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) { + return proto; + } + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + function Map() { + this._keys = []; + this._values = []; + this._cache = cacheSentinel; + } + Map.prototype = { + get size() { + return this._keys.length; + }, + has: function (key) { + if (key === this._cache) { + return true; + } + if (this._find(key) >= 0) { + this._cache = key; + return true; + } + return false; + }, + get: function (key) { + var index = this._find(key); + if (index >= 0) { + this._cache = key; + return this._values[index]; + } + return undefined; + }, + set: function (key, value) { + this.delete(key); + this._keys.push(key); + this._values.push(value); + this._cache = key; + return this; + }, + delete: function (key) { + var index = this._find(key); + if (index >= 0) { + this._keys.splice(index, 1); + this._values.splice(index, 1); + this._cache = cacheSentinel; + return true; + } + return false; + }, + clear: function () { + this._keys.length = 0; + this._values.length = 0; + this._cache = cacheSentinel; + }, + forEach: function (callback, thisArg) { + var size = this.size; + for (var i = 0; i < size; ++i) { + var key = this._keys[i]; + var value = this._values[i]; + this._cache = key; + callback.call(this, value, key, this); + } + }, + _find: function (key) { + var keys = this._keys; + var size = keys.length; + for (var i = 0; i < size; ++i) { + if (keys[i] === key) { + return i; + } + } + return -1; + } + }; + return Map; + } + // naive Set shim + function CreateSetPolyfill() { + var cacheSentinel = {}; + function Set() { + this._map = new _Map(); + } + Set.prototype = { + get size() { + return this._map.length; + }, + has: function (value) { + return this._map.has(value); + }, + add: function (value) { + this._map.set(value, value); + return this; + }, + delete: function (value) { + return this._map.delete(value); + }, + clear: function () { + this._map.clear(); + }, + forEach: function (callback, thisArg) { + this._map.forEach(callback, thisArg); + } + }; + return Set; + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; + var nodeCrypto = isNode && require("crypto"); + var hasOwn = Object.prototype.hasOwnProperty; + var keys = {}; + var rootKey = CreateUniqueKey(); + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype = { + has: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return this._key in table; + } + return false; + }, + get: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return table[this._key]; + } + return undefined; + }, + set: function (target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }, + delete: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table && this._key in table) { + return delete table[this._key]; + } + return false; + }, + clear: function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + } + }; + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) { + buffer[i] = Math.random() * 255 | 0; + } + } + function GenRandomBytes(size) { + if (nodeCrypto) { + var data = nodeCrypto.randomBytes(size); + return data; + } + else if (typeof Uint8Array === "function") { + var data = new Uint8Array(size); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(data); + } + else if (typeof msCrypto !== "undefined") { + msCrypto.getRandomValues(data); + } + else { + FillRandomBytes(data, size); + } + return data; + } + else { + var data = new Array(size); + FillRandomBytes(data, size); + return data; + } + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) { + result += "-"; + } + if (byte < 16) { + result += "0"; + } + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do { + key = "@@WeakMap@@" + CreateUUID(); + } while (hasOwn.call(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) { + return undefined; + } + Object.defineProperty(target, rootKey, { value: Object.create(null) }); + } + return target[rootKey]; + } + return WeakMap; + } + // hook global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + __global.Reflect[p] = Reflect[p]; + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURLDisabled=Reflect.js.map +"format register"; +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Class = decorators_1.Class; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var _EMPTY_ATTR_VALUE = ''; + var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); + var CssSelector = (function() { + function CssSelector() { + this.element = null; + this.classNames = []; + this.attrs = []; + this.notSelectors = []; + } + CssSelector.parse = function(selector) { + var results = []; + var _addResult = function(res, cssSel) { + if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { + cssSel.element = "*"; + } + res.push(cssSel); + }; + var cssSelector = new CssSelector(); + var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); + var match; + var current = cssSelector; + var inNot = false; + while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { + if (lang_1.isPresent(match[1])) { + if (inNot) { + throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); + } + inNot = true; + current = new CssSelector(); + cssSelector.notSelectors.push(current); + } + if (lang_1.isPresent(match[2])) { + current.setElement(match[2]); + } + if (lang_1.isPresent(match[3])) { + current.addClassName(match[3]); + } + if (lang_1.isPresent(match[4])) { + current.addAttribute(match[4], match[5]); + } + if (lang_1.isPresent(match[6])) { + inNot = false; + current = cssSelector; + } + if (lang_1.isPresent(match[7])) { + if (inNot) { + throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); + } + _addResult(results, cssSelector); + cssSelector = current = new CssSelector(); + } + } + _addResult(results, cssSelector); + return results; + }; + CssSelector.prototype.isElementSelector = function() { + return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; + }; + CssSelector.prototype.setElement = function(element) { + if (element === void 0) { + element = null; + } + if (lang_1.isPresent(element)) { + element = element.toLowerCase(); + } + this.element = element; + }; + CssSelector.prototype.getMatchingElementTemplate = function() { + var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; + var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; + var attrs = ''; + for (var i = 0; i < this.attrs.length; i += 2) { + var attrName = this.attrs[i]; + var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; + attrs += " " + attrName + attrValue; + } + return "<" + tagName + classAttr + attrs + ">"; + }; + CssSelector.prototype.addAttribute = function(name, value) { + if (value === void 0) { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(name.toLowerCase()); + if (lang_1.isPresent(value)) { + value = value.toLowerCase(); + } else { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(value); + }; + CssSelector.prototype.addClassName = function(name) { + this.classNames.push(name.toLowerCase()); + }; + CssSelector.prototype.toString = function() { + var res = ''; + if (lang_1.isPresent(this.element)) { + res += this.element; + } + if (lang_1.isPresent(this.classNames)) { + for (var i = 0; i < this.classNames.length; i++) { + res += '.' + this.classNames[i]; + } + } + if (lang_1.isPresent(this.attrs)) { + for (var i = 0; i < this.attrs.length; ) { + var attrName = this.attrs[i++]; + var attrValue = this.attrs[i++]; + res += '[' + attrName; + if (attrValue.length > 0) { + res += '=' + attrValue; + } + res += ']'; + } + } + this.notSelectors.forEach(function(notSelector) { + return res += ":not(" + notSelector + ")"; + }); + return res; + }; + return CssSelector; + })(); + exports.CssSelector = CssSelector; + var SelectorMatcher = (function() { + function SelectorMatcher() { + this._elementMap = new collection_1.Map(); + this._elementPartialMap = new collection_1.Map(); + this._classMap = new collection_1.Map(); + this._classPartialMap = new collection_1.Map(); + this._attrValueMap = new collection_1.Map(); + this._attrValuePartialMap = new collection_1.Map(); + this._listContexts = []; + } + SelectorMatcher.createNotMatcher = function(notSelectors) { + var notMatcher = new SelectorMatcher(); + notMatcher.addSelectables(notSelectors, null); + return notMatcher; + }; + SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { + var listContext = null; + if (cssSelectors.length > 1) { + listContext = new SelectorListContext(cssSelectors); + this._listContexts.push(listContext); + } + for (var i = 0; i < cssSelectors.length; i++) { + this._addSelectable(cssSelectors[i], callbackCtxt, listContext); + } + }; + SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { + var matcher = this; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); + if (lang_1.isPresent(element)) { + var isTerminal = attrs.length === 0 && classNames.length === 0; + if (isTerminal) { + this._addTerminal(matcher._elementMap, element, selectable); + } else { + matcher = this._addPartial(matcher._elementPartialMap, element); + } + } + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var isTerminal = attrs.length === 0 && index === classNames.length - 1; + var className = classNames[index]; + if (isTerminal) { + this._addTerminal(matcher._classMap, className, selectable); + } else { + matcher = this._addPartial(matcher._classPartialMap, className); + } + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var isTerminal = index === attrs.length - 2; + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + if (isTerminal) { + var terminalMap = matcher._attrValueMap; + var terminalValuesMap = terminalMap.get(attrName); + if (lang_1.isBlank(terminalValuesMap)) { + terminalValuesMap = new collection_1.Map(); + terminalMap.set(attrName, terminalValuesMap); + } + this._addTerminal(terminalValuesMap, attrValue, selectable); + } else { + var parttialMap = matcher._attrValuePartialMap; + var partialValuesMap = parttialMap.get(attrName); + if (lang_1.isBlank(partialValuesMap)) { + partialValuesMap = new collection_1.Map(); + parttialMap.set(attrName, partialValuesMap); + } + matcher = this._addPartial(partialValuesMap, attrValue); + } + } + } + }; + SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { + var terminalList = map.get(name); + if (lang_1.isBlank(terminalList)) { + terminalList = []; + map.set(name, terminalList); + } + terminalList.push(selectable); + }; + SelectorMatcher.prototype._addPartial = function(map, name) { + var matcher = map.get(name); + if (lang_1.isBlank(matcher)) { + matcher = new SelectorMatcher(); + map.set(name, matcher); + } + return matcher; + }; + SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { + var result = false; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + for (var i = 0; i < this._listContexts.length; i++) { + this._listContexts[i].alreadyMatched = false; + } + result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var className = classNames[index]; + result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + var terminalValuesMap = this._attrValueMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; + var partialValuesMap = this._attrValuePartialMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; + } + } + return result; + }; + SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var selectables = map.get(name); + var starSelectables = map.get("*"); + if (lang_1.isPresent(starSelectables)) { + selectables = selectables.concat(starSelectables); + } + if (lang_1.isBlank(selectables)) { + return false; + } + var selectable; + var result = false; + for (var index = 0; index < selectables.length; index++) { + selectable = selectables[index]; + result = selectable.finalize(cssSelector, matchedCallback) || result; + } + return result; + }; + SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var nestedSelector = map.get(name); + if (lang_1.isBlank(nestedSelector)) { + return false; + } + return nestedSelector.match(cssSelector, matchedCallback); + }; + return SelectorMatcher; + })(); + exports.SelectorMatcher = SelectorMatcher; + var SelectorListContext = (function() { + function SelectorListContext(selectors) { + this.selectors = selectors; + this.alreadyMatched = false; + } + return SelectorListContext; + })(); + exports.SelectorListContext = SelectorListContext; + var SelectorContext = (function() { + function SelectorContext(selector, cbContext, listContext) { + this.selector = selector; + this.cbContext = cbContext; + this.listContext = listContext; + this.notSelectors = selector.notSelectors; + } + SelectorContext.prototype.finalize = function(cssSelector, callback) { + var result = true; + if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); + result = !notMatcher.match(cssSelector, null); + } + if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + if (lang_1.isPresent(this.listContext)) { + this.listContext.alreadyMatched = true; + } + callback(this.selector, this.cbContext); + } + return result; + }; + return SelectorContext; + })(); + exports.SelectorContext = SelectorContext; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\$/g; + var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\$/g; + exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + function escapeSingleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; + } + exports.escapeSingleQuoteString = escapeSingleQuoteString; + function escapeDoubleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; + } + exports.escapeDoubleQuoteString = escapeDoubleQuoteString; + function escapeString(input, re) { + return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { + if (match[0] == '$') { + return lang_1.IS_DART ? '\\$' : '$'; + } else if (match[0] == '\n') { + return '\\n'; + } else { + return "\\" + match[0]; + } + }); + } + function codeGenExportVariable(name) { + if (lang_1.IS_DART) { + return "const " + name + " = "; + } else { + return "var " + name + " = exports['" + name + "'] = "; + } + } + exports.codeGenExportVariable = codeGenExportVariable; + function codeGenConstConstructorCall(name) { + if (lang_1.IS_DART) { + return "const " + name; + } else { + return "new " + name; + } + } + exports.codeGenConstConstructorCall = codeGenConstConstructorCall; + function codeGenValueFn(params, value, fnName) { + if (fnName === void 0) { + fnName = ''; + } + if (lang_1.IS_DART) { + return fnName + "(" + params.join(',') + ") => " + value; + } else { + return "function " + fnName + "(" + params.join(',') + ") { return " + value + "; }"; + } + } + exports.codeGenValueFn = codeGenValueFn; + function codeGenToString(expr) { + if (lang_1.IS_DART) { + return "'${" + expr + "}'"; + } else { + return expr; + } + } + exports.codeGenToString = codeGenToString; + function splitAtColon(input, defaultValues) { + var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); + if (parts.length > 1) { + return parts; + } else { + return defaultValues; + } + } + exports.splitAtColon = splitAtColon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; + function moduleRef(moduleUrl) { + return "#MODULE[" + moduleUrl + "]"; + } + exports.moduleRef = moduleRef; + var SourceModule = (function() { + function SourceModule(moduleUrl, sourceWithModuleRefs) { + this.moduleUrl = moduleUrl; + this.sourceWithModuleRefs = sourceWithModuleRefs; + } + SourceModule.prototype.getSourceWithImports = function() { + var _this = this; + var moduleAliases = {}; + var imports = []; + var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { + var moduleUrl = match[1]; + var alias = moduleAliases[moduleUrl]; + if (lang_1.isBlank(alias)) { + if (moduleUrl == _this.moduleUrl) { + alias = ''; + } else { + alias = "import" + imports.length; + imports.push([moduleUrl, alias]); + } + moduleAliases[moduleUrl] = alias; + } + return alias.length > 0 ? alias + "." : ''; + }); + return new SourceWithImports(newSource, imports); + }; + return SourceModule; + })(); + exports.SourceModule = SourceModule; + var SourceExpression = (function() { + function SourceExpression(declarations, expression) { + this.declarations = declarations; + this.expression = expression; + } + return SourceExpression; + })(); + exports.SourceExpression = SourceExpression; + var SourceExpressions = (function() { + function SourceExpressions(declarations, expressions) { + this.declarations = declarations; + this.expressions = expressions; + } + return SourceExpressions; + })(); + exports.SourceExpressions = SourceExpressions; + var SourceWithImports = (function() { + function SourceWithImports(source, imports) { + this.source = source; + this.imports = imports; + } + return SourceWithImports; + })(); + exports.SourceWithImports = SourceWithImports; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var TextAst = (function() { + function TextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + TextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return TextAst; + })(); + exports.TextAst = TextAst; + var BoundTextAst = (function() { + function BoundTextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + BoundTextAst.prototype.visit = function(visitor, context) { + return visitor.visitBoundText(this, context); + }; + return BoundTextAst; + })(); + exports.BoundTextAst = BoundTextAst; + var AttrAst = (function() { + function AttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + AttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return AttrAst; + })(); + exports.AttrAst = AttrAst; + var BoundElementPropertyAst = (function() { + function BoundElementPropertyAst(name, type, value, unit, sourceInfo) { + this.name = name; + this.type = type; + this.value = value; + this.unit = unit; + this.sourceInfo = sourceInfo; + } + BoundElementPropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitElementProperty(this, context); + }; + return BoundElementPropertyAst; + })(); + exports.BoundElementPropertyAst = BoundElementPropertyAst; + var BoundEventAst = (function() { + function BoundEventAst(name, target, handler, sourceInfo) { + this.name = name; + this.target = target; + this.handler = handler; + this.sourceInfo = sourceInfo; + } + BoundEventAst.prototype.visit = function(visitor, context) { + return visitor.visitEvent(this, context); + }; + Object.defineProperty(BoundEventAst.prototype, "fullName", { + get: function() { + if (lang_1.isPresent(this.target)) { + return this.target + ":" + this.name; + } else { + return this.name; + } + }, + enumerable: true, + configurable: true + }); + return BoundEventAst; + })(); + exports.BoundEventAst = BoundEventAst; + var VariableAst = (function() { + function VariableAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + VariableAst.prototype.visit = function(visitor, context) { + return visitor.visitVariable(this, context); + }; + return VariableAst; + })(); + exports.VariableAst = VariableAst; + var ElementAst = (function() { + function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.inputs = inputs; + this.outputs = outputs; + this.exportAsVars = exportAsVars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + ElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + ElementAst.prototype.isBound = function() { + return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); + }; + ElementAst.prototype.getComponent = function() { + return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; + }; + return ElementAst; + })(); + exports.ElementAst = ElementAst; + var EmbeddedTemplateAst = (function() { + function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceInfo) { + this.attrs = attrs; + this.outputs = outputs; + this.vars = vars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + EmbeddedTemplateAst.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return EmbeddedTemplateAst; + })(); + exports.EmbeddedTemplateAst = EmbeddedTemplateAst; + var BoundDirectivePropertyAst = (function() { + function BoundDirectivePropertyAst(directiveName, templateName, value, sourceInfo) { + this.directiveName = directiveName; + this.templateName = templateName; + this.value = value; + this.sourceInfo = sourceInfo; + } + BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitDirectiveProperty(this, context); + }; + return BoundDirectivePropertyAst; + })(); + exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; + var DirectiveAst = (function() { + function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceInfo) { + this.directive = directive; + this.inputs = inputs; + this.hostProperties = hostProperties; + this.hostEvents = hostEvents; + this.exportAsVars = exportAsVars; + this.sourceInfo = sourceInfo; + } + DirectiveAst.prototype.visit = function(visitor, context) { + return visitor.visitDirective(this, context); + }; + return DirectiveAst; + })(); + exports.DirectiveAst = DirectiveAst; + var NgContentAst = (function() { + function NgContentAst(index, ngContentIndex, sourceInfo) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + NgContentAst.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return NgContentAst; + })(); + exports.NgContentAst = NgContentAst; + (function(PropertyBindingType) { + PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; + PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; + PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; + PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; + })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); + var PropertyBindingType = exports.PropertyBindingType; + function templateVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.templateVisitAll = templateVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Codegen = (function() { + function Codegen(moduleAlias) {} + Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { + throw "Not implemented in JS"; + }; + Codegen.prototype.toString = function() { + throw "Not implemented in JS"; + }; + return Codegen; + })(); + exports.Codegen = Codegen; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var ShadowCss = (function() { + function ShadowCss() { + this.strictStyling = true; + } + ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { + if (hostSelector === void 0) { + hostSelector = ''; + } + cssText = stripComments(cssText); + cssText = this._insertDirectives(cssText); + return this._scopeCssText(cssText, selector, hostSelector); + }; + ShadowCss.prototype._insertDirectives = function(cssText) { + cssText = this._insertPolyfillDirectivesInCssText(cssText); + return this._insertPolyfillRulesInCssText(cssText); + }; + ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { + return m[1] + '{'; + }); + }; + ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[1], ''); + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + return m[3] + rule; + }); + }; + ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { + var unscoped = this._extractUnscopedRulesFromCssText(cssText); + cssText = this._insertPolyfillHostInCssText(cssText); + cssText = this._convertColonHost(cssText); + cssText = this._convertColonHostContext(cssText); + cssText = this._convertShadowDOMSelectors(cssText); + if (lang_1.isPresent(scopeSelector)) { + cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); + } + cssText = cssText + '\n' + unscoped; + return cssText.trim(); + }; + ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { + var r = '', + m; + var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); + while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); + r += rule + '\n\n'; + } + return r; + }; + ShadowCss.prototype._convertColonHost = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); + }; + ShadowCss.prototype._convertColonHostContext = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); + }; + ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { + return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { + if (lang_1.isPresent(m[2])) { + var parts = m[2].split(','), + r = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + if (lang_1.isBlank(p)) + break; + p = p.trim(); + r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); + } + return r.join(','); + } else { + return _polyfillHostNoCombinator + m[3]; + } + }); + }; + ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { + if (lang_1.StringWrapper.contains(part, _polyfillHost)) { + return this._colonHostPartReplacer(host, part, suffix); + } else { + return host + part + suffix + ', ' + part + ' ' + host + suffix; + } + }; + ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { + return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; + }; + ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { + for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { + cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); + } + return cssText; + }; + ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { + var _this = this; + return processRules(cssText, function(rule) { + var selector = rule.selector; + var content = rule.content; + if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { + selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); + } else if (rule.selector.startsWith('@media')) { + content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); + } + return new CssRule(selector, content); + }); + }; + ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { + var r = [], + parts = selector.split(','); + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + p = p.trim(); + if (this._selectorNeedsScoping(p, scopeSelector)) { + p = strict && !lang_1.StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector); + } + r.push(p); + } + return r.join(', '); + }; + ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { + var re = this._makeScopeMatcher(scopeSelector); + return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); + }; + ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { + var lre = /\[/g; + var rre = /\]/g; + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); + return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); + }; + ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { + return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); + }; + ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { + if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { + var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; + selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); + return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); + } else { + return scopeSelector + ' ' + selector; + } + }; + ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { + var isRe = /\[is=([^\]]*)\]/g; + scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { + return m[1]; + }); + var splits = [' ', '>', '+', '~'], + scoped = selector, + attrName = '[' + scopeSelector + ']'; + for (var i = 0; i < splits.length; i++) { + var sep = splits[i]; + var parts = scoped.split(sep); + scoped = parts.map(function(p) { + var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); + if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { + var re = /([^:]*)(:*)(.*)/g; + var m = lang_1.RegExpWrapper.firstMatch(re, t); + if (lang_1.isPresent(m)) { + p = m[1] + attrName + m[2] + m[3]; + } + } + return p; + }).join(sep); + } + return scoped; + }; + ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); + return selector; + }; + return ShadowCss; + })(); + exports.ShadowCss = ShadowCss; + var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; + var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _polyfillHost = '-shadowcsshost'; + var _polyfillHostContext = '-shadowcsscontext'; + var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; + var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); + var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); + var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; + var _shadowDOMSelectorsRe = [/>>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow-deep\//g, /\/shadow\//g]; + var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; + var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); + var _colonHostRe = /:host/gim; + var _colonHostContextRe = /:host-context/gim; + var _commentRe = /\/\*[\s\S]*?\*\//g; + function stripComments(input) { + return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { + return ''; + }); + } + var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; + var _curlyRe = /([{}])/g; + var OPEN_CURLY = '{'; + var CLOSE_CURLY = '}'; + var BLOCK_PLACEHOLDER = '%BLOCK%'; + var CssRule = (function() { + function CssRule(selector, content) { + this.selector = selector; + this.content = content; + } + return CssRule; + })(); + exports.CssRule = CssRule; + function processRules(input, ruleCallback) { + var inputWithEscapedBlocks = escapeBlocks(input); + var nextBlockIndex = 0; + return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { + var selector = m[2]; + var content = ''; + var suffix = m[4]; + var contentPrefix = ''; + if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { + content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; + suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); + contentPrefix = '{'; + } + var rule = ruleCallback(new CssRule(selector, content)); + return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; + }); + } + exports.processRules = processRules; + var StringWithEscapedBlocks = (function() { + function StringWithEscapedBlocks(escapedString, blocks) { + this.escapedString = escapedString; + this.blocks = blocks; + } + return StringWithEscapedBlocks; + })(); + function escapeBlocks(input) { + var inputParts = lang_1.StringWrapper.split(input, _curlyRe); + var resultParts = []; + var escapedBlocks = []; + var bracketCount = 0; + var currentBlockParts = []; + for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { + var part = inputParts[partIndex]; + if (part == CLOSE_CURLY) { + bracketCount--; + } + if (bracketCount > 0) { + currentBlockParts.push(part); + } else { + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + currentBlockParts = []; + } + resultParts.push(part); + } + if (part == OPEN_CURLY) { + bracketCount++; + } + } + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + } + return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var StyleWithImports = (function() { + function StyleWithImports(style, styleUrls) { + this.style = style; + this.styleUrls = styleUrls; + } + return StyleWithImports; + })(); + exports.StyleWithImports = StyleWithImports; + function isStyleUrlResolvable(url) { + if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') + return false; + var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); + return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; + } + exports.isStyleUrlResolvable = isStyleUrlResolvable; + function extractStyleUrls(resolver, baseUrl, cssText) { + var foundUrls = []; + var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { + var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; + if (!isStyleUrlResolvable(url)) { + return m[0]; + } + foundUrls.push(resolver.resolve(baseUrl, url)); + return ''; + }); + return new StyleWithImports(modifiedCssText, foundUrls); + } + exports.extractStyleUrls = extractStyleUrls; + var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; + var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/command_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/template_commands", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + exports.TEMPLATE_COMMANDS_MODULE_REF = source_module_1.moduleRef("package:angular2/src/core/linker/template_commands" + util_1.MODULE_SUFFIX); + var IMPLICIT_TEMPLATE_VAR = '\$implicit'; + var CLASS_ATTR = 'class'; + var STYLE_ATTR = 'style'; + var CommandCompiler = (function() { + function CommandCompiler() {} + CommandCompiler.prototype.compileComponentRuntime = function(component, template, changeDetectorFactories, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories), 0); + template_ast_1.templateVisitAll(visitor, template); + return visitor.result; + }; + CommandCompiler.prototype.compileComponentCodeGen = function(component, template, changeDetectorFactoryExpressions, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions), 0); + template_ast_1.templateVisitAll(visitor, template); + return new source_module_1.SourceExpression([], codeGenArray(visitor.result)); + }; + CommandCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], CommandCompiler); + return CommandCompiler; + })(); + exports.CommandCompiler = CommandCompiler; + var RuntimeCommandFactory = (function() { + function RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactories = changeDetectorFactories; + } + RuntimeCommandFactory.prototype._mapDirectives = function(directives) { + return directives.map(function(directive) { + return directive.type.runtime; + }); + }; + RuntimeCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new template_commands_1.TextCmd(value, isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new template_commands_1.NgContentCmd(index, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + return new template_commands_1.BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createEndElement = function() { + return new template_commands_1.EndElementCmd(); + }; + RuntimeCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var nestedTemplateAccessor = this.componentTemplateFactory(directives[0]); + return new template_commands_1.BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), encapsulation, ngContentIndex, nestedTemplateAccessor); + }; + RuntimeCommandFactory.prototype.createEndComponent = function() { + return new template_commands_1.EndComponentCmd(); + }; + RuntimeCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new template_commands_1.EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, this._mapDirectives(directives), isMerged, ngContentIndex, this.changeDetectorFactories[embeddedTemplateIndex], children); + }; + return RuntimeCommandFactory; + })(); + var CodegenCommandFactory = (function() { + function CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactoryExpressions = changeDetectorFactoryExpressions; + } + CodegenCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'TextCmd') + "(" + util_1.escapeSingleQuoteString(value) + ", " + isBound + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'NgContentCmd') + "(" + index + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginElementCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + isBound + ", " + ngContentIndex + ")")); + }; + CodegenCommandFactory.prototype.createEndElement = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndElementCmd') + "()"); + }; + CodegenCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginComponentCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + codeGenViewEncapsulation(encapsulation) + ", " + ngContentIndex + ", " + this.componentTemplateFactory(directives[0]) + ")")); + }; + CodegenCommandFactory.prototype.createEndComponent = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndComponentCmd') + "()"); + }; + CodegenCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EmbeddedTemplateCmd') + "(" + codeGenArray(attrNameAndValues) + ", " + codeGenArray(variableNameAndValues) + ", ") + (codeGenDirectivesArray(directives) + ", " + isMerged + ", " + ngContentIndex + ", " + this.changeDetectorFactoryExpressions[embeddedTemplateIndex] + ", " + codeGenArray(children) + ")")); + }; + return CodegenCommandFactory; + })(); + function visitAndReturnContext(visitor, asts, context) { + template_ast_1.templateVisitAll(visitor, asts, context); + return context; + } + var CommandBuilderVisitor = (function() { + function CommandBuilderVisitor(commandFactory, embeddedTemplateIndex) { + this.commandFactory = commandFactory; + this.embeddedTemplateIndex = embeddedTemplateIndex; + this.result = []; + this.transitiveNgContentCount = 0; + } + CommandBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { + var attrs = keyValueArrayToMap(visitAndReturnContext(this, attrAsts, [])); + directives.forEach(function(directiveMeta) { + collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { + var prevValue = attrs[name]; + attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; + }); + }); + return mapToKeyValueArray(attrs); + }; + CommandBuilderVisitor.prototype.visitNgContent = function(ast, context) { + this.transitiveNgContentCount++; + this.result.push(this.commandFactory.createNgContent(ast.index, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + var _this = this; + this.embeddedTemplateIndex++; + var childVisitor = new CommandBuilderVisitor(this.commandFactory, this.embeddedTemplateIndex); + template_ast_1.templateVisitAll(childVisitor, ast.children); + var isMerged = childVisitor.transitiveNgContentCount > 0; + var variableNameAndValues = []; + ast.vars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR); + }); + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, [], [], directives)); + }); + this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex, this._readAttrNameAndValues(directives, ast.attrs), variableNameAndValues, directives, isMerged, ast.ngContentIndex, childVisitor.result)); + this.transitiveNgContentCount += childVisitor.transitiveNgContentCount; + this.embeddedTemplateIndex = childVisitor.embeddedTemplateIndex; + return null; + }; + CommandBuilderVisitor.prototype.visitElement = function(ast, context) { + var _this = this; + var component = ast.getComponent(); + var eventTargetAndNames = visitAndReturnContext(this, ast.outputs, []); + var variableNameAndValues = []; + if (lang_1.isBlank(component)) { + ast.exportAsVars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(null); + }); + } + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, eventTargetAndNames, variableNameAndValues, directives)); + }); + eventTargetAndNames = removeKeyValueArrayDuplicates(eventTargetAndNames); + var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); + if (lang_1.isPresent(component)) { + this.result.push(this.commandFactory.createBeginComponent(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, component.template.encapsulation, ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndComponent()); + } else { + this.result.push(this.commandFactory.createBeginElement(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, ast.isBound(), ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndElement()); + } + return null; + }; + CommandBuilderVisitor.prototype.visitVariable = function(ast, ctx) { + return null; + }; + CommandBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { + attrNameAndValues.push(ast.name); + attrNameAndValues.push(ast.value); + return null; + }; + CommandBuilderVisitor.prototype.visitBoundText = function(ast, context) { + this.result.push(this.commandFactory.createText(null, true, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitText = function(ast, context) { + this.result.push(this.commandFactory.createText(ast.value, false, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitDirective = function(ast, ctx) { + ctx.targetDirectives.push(ast.directive); + template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.eventTargetAndNames); + ast.exportAsVars.forEach(function(varAst) { + ctx.targetVariableNameAndValues.push(varAst.name); + ctx.targetVariableNameAndValues.push(ctx.index); + }); + return null; + }; + CommandBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { + eventTargetAndNames.push(ast.target); + eventTargetAndNames.push(ast.name); + return null; + }; + CommandBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { + return null; + }; + CommandBuilderVisitor.prototype.visitElementProperty = function(ast, context) { + return null; + }; + return CommandBuilderVisitor; + })(); + function removeKeyValueArrayDuplicates(keyValueArray) { + var knownPairs = new Set(); + var resultKeyValueArray = []; + for (var i = 0; i < keyValueArray.length; i += 2) { + var key = keyValueArray[i]; + var value = keyValueArray[i + 1]; + var pairId = key + ":" + value; + if (!collection_1.SetWrapper.has(knownPairs, pairId)) { + resultKeyValueArray.push(key); + resultKeyValueArray.push(value); + knownPairs.add(pairId); + } + } + return resultKeyValueArray; + } + function keyValueArrayToMap(keyValueArr) { + var data = {}; + for (var i = 0; i < keyValueArr.length; i += 2) { + data[keyValueArr[i]] = keyValueArr[i + 1]; + } + return data; + } + function mapToKeyValueArray(data) { + var entryArray = []; + collection_1.StringMapWrapper.forEach(data, function(value, name) { + entryArray.push([name, value]); + }); + collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + var keyValueArray = []; + entryArray.forEach(function(entry) { + keyValueArray.push(entry[0]); + keyValueArray.push(entry[1]); + }); + return keyValueArray; + } + function mergeAttributeValue(attrName, attrValue1, attrValue2) { + if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { + return attrValue1 + " " + attrValue2; + } else { + return attrValue2; + } + } + var DirectiveContext = (function() { + function DirectiveContext(index, eventTargetAndNames, targetVariableNameAndValues, targetDirectives) { + this.index = index; + this.eventTargetAndNames = eventTargetAndNames; + this.targetVariableNameAndValues = targetVariableNameAndValues; + this.targetDirectives = targetDirectives; + } + return DirectiveContext; + })(); + var Expression = (function() { + function Expression(value) { + this.value = value; + } + return Expression; + })(); + function escapeValue(value) { + if (value instanceof Expression) { + return value.value; + } else if (lang_1.isString(value)) { + return util_1.escapeSingleQuoteString(value); + } else if (lang_1.isBlank(value)) { + return 'null'; + } else { + return "" + value; + } + } + function codeGenArray(data) { + var base = "[" + data.map(escapeValue).join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenDirectivesArray(directives) { + var expressions = directives.map(function(directiveType) { + return ("" + source_module_1.moduleRef(directiveType.type.moduleUrl) + directiveType.type.name); + }); + var base = "[" + expressions.join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenViewEncapsulation(value) { + if (lang_1.IS_DART) { + return "" + exports.TEMPLATE_COMMANDS_MODULE_REF + value; + } else { + return "" + value; + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var HtmlTextAst = (function() { + function HtmlTextAst(value, sourceInfo) { + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlTextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return HtmlTextAst; + })(); + exports.HtmlTextAst = HtmlTextAst; + var HtmlAttrAst = (function() { + function HtmlAttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlAttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return HtmlAttrAst; + })(); + exports.HtmlAttrAst = HtmlAttrAst; + var HtmlElementAst = (function() { + function HtmlElementAst(name, attrs, children, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.children = children; + this.sourceInfo = sourceInfo; + } + HtmlElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + return HtmlElementAst; + })(); + exports.HtmlElementAst = HtmlElementAst; + function htmlVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.htmlVisitAll = htmlVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var NG_CONTENT_SELECT_ATTR = 'select'; + var NG_CONTENT_ELEMENT = 'ng-content'; + var LINK_ELEMENT = 'link'; + var LINK_STYLE_REL_ATTR = 'rel'; + var LINK_STYLE_HREF_ATTR = 'href'; + var LINK_STYLE_REL_VALUE = 'stylesheet'; + var STYLE_ELEMENT = 'style'; + var SCRIPT_ELEMENT = 'script'; + var NG_NON_BINDABLE_ATTR = 'ng-non-bindable'; + function preparseElement(ast) { + var selectAttr = null; + var hrefAttr = null; + var relAttr = null; + var nonBindable = false; + ast.attrs.forEach(function(attr) { + if (attr.name == NG_CONTENT_SELECT_ATTR) { + selectAttr = attr.value; + } else if (attr.name == LINK_STYLE_HREF_ATTR) { + hrefAttr = attr.value; + } else if (attr.name == LINK_STYLE_REL_ATTR) { + relAttr = attr.value; + } else if (attr.name == NG_NON_BINDABLE_ATTR) { + nonBindable = true; + } + }); + selectAttr = normalizeNgContentSelect(selectAttr); + var nodeName = ast.name; + var type = PreparsedElementType.OTHER; + if (nodeName == NG_CONTENT_ELEMENT) { + type = PreparsedElementType.NG_CONTENT; + } else if (nodeName == STYLE_ELEMENT) { + type = PreparsedElementType.STYLE; + } else if (nodeName == SCRIPT_ELEMENT) { + type = PreparsedElementType.SCRIPT; + } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { + type = PreparsedElementType.STYLESHEET; + } + return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable); + } + exports.preparseElement = preparseElement; + (function(PreparsedElementType) { + PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; + PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; + PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; + PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; + PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; + })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); + var PreparsedElementType = exports.PreparsedElementType; + var PreparsedElement = (function() { + function PreparsedElement(type, selectAttr, hrefAttr, nonBindable) { + this.type = type; + this.selectAttr = selectAttr; + this.hrefAttr = hrefAttr; + this.nonBindable = nonBindable; + } + return PreparsedElement; + })(); + exports.PreparsedElement = PreparsedElement; + function normalizeNgContentSelect(selectAttr) { + if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { + return '*'; + } + return selectAttr; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var TemplateNormalizer = (function() { + function TemplateNormalizer(_xhr, _urlResolver, _domParser) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._domParser = _domParser; + } + TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { + var _this = this; + if (lang_1.isPresent(template.template)) { + return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); + } else if (lang_1.isPresent(template.templateUrl)) { + var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); + return this._xhr.get(sourceAbsUrl).then(function(templateContent) { + return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); + }); + } else { + throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); + } + }; + TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { + var _this = this; + var domNodes = this._domParser.parse(template, directiveType.name); + var visitor = new TemplatePreparseVisitor(); + html_ast_1.htmlVisitAll(visitor, domNodes); + var allStyles = templateMeta.styles.concat(visitor.styles); + var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(templateAbsUrl, url); + }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(directiveType.moduleUrl, url); + })); + var allResolvedStyles = allStyles.map(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); + styleWithImports.styleUrls.forEach(function(styleUrl) { + return allStyleAbsUrls.push(styleUrl); + }); + return styleWithImports.style; + }); + var encapsulation = templateMeta.encapsulation; + if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { + encapsulation = view_1.ViewEncapsulation.None; + } + return new directive_metadata_1.CompileTemplateMetadata({ + encapsulation: encapsulation, + template: template, + templateUrl: templateAbsUrl, + styles: allResolvedStyles, + styleUrls: allStyleAbsUrls, + ngContentSelectors: visitor.ngContentSelectors + }); + }; + TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); + return TemplateNormalizer; + })(); + exports.TemplateNormalizer = TemplateNormalizer; + var TemplatePreparseVisitor = (function() { + function TemplatePreparseVisitor() { + this.ngContentSelectors = []; + this.styles = []; + this.styleUrls = []; + this.ngNonBindableStackCount = 0; + } + TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { + var preparsedElement = template_preparser_1.preparseElement(ast); + switch (preparsedElement.type) { + case template_preparser_1.PreparsedElementType.NG_CONTENT: + if (this.ngNonBindableStackCount === 0) { + this.ngContentSelectors.push(preparsedElement.selectAttr); + } + break; + case template_preparser_1.PreparsedElementType.STYLE: + var textContent = ''; + ast.children.forEach(function(child) { + if (child instanceof html_ast_1.HtmlTextAst) { + textContent += child.value; + } + }); + this.styles.push(textContent); + break; + case template_preparser_1.PreparsedElementType.STYLESHEET: + this.styleUrls.push(preparsedElement.hrefAttr); + break; + } + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount++; + } + html_ast_1.htmlVisitAll(this, ast.children); + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount--; + } + return null; + }; + TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + TemplatePreparseVisitor.prototype.visitText = function(ast, context) { + return null; + }; + return TemplatePreparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cpl = require("angular2/src/compiler/directive_metadata"); + var md = require("angular2/src/core/metadata/directives"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var di_2 = require("angular2/src/core/di"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var util_1 = require("angular2/src/compiler/util"); + var RuntimeMetadataResolver = (function() { + function RuntimeMetadataResolver(_directiveResolver, _viewResolver, _platformDirectives) { + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._platformDirectives = _platformDirectives; + this._cache = new Map(); + } + RuntimeMetadataResolver.prototype.getMetadata = function(directiveType) { + var meta = this._cache.get(directiveType); + if (lang_1.isBlank(meta)) { + var dirMeta = this._directiveResolver.resolve(directiveType); + var moduleUrl = calcModuleUrl(directiveType, dirMeta); + var templateMeta = null; + var changeDetectionStrategy = null; + if (dirMeta instanceof md.ComponentMetadata) { + var cmpMeta = dirMeta; + var viewMeta = this._viewResolver.resolve(directiveType); + templateMeta = new cpl.CompileTemplateMetadata({ + encapsulation: viewMeta.encapsulation, + template: viewMeta.template, + templateUrl: viewMeta.templateUrl, + styles: viewMeta.styles, + styleUrls: viewMeta.styleUrls + }); + changeDetectionStrategy = cmpMeta.changeDetection; + } + meta = cpl.CompileDirectiveMetadata.create({ + selector: dirMeta.selector, + exportAs: dirMeta.exportAs, + isComponent: lang_1.isPresent(templateMeta), + dynamicLoadable: true, + type: new cpl.CompileTypeMetadata({ + name: lang_1.stringify(directiveType), + moduleUrl: moduleUrl, + runtime: directiveType + }), + template: templateMeta, + changeDetection: changeDetectionStrategy, + inputs: dirMeta.inputs, + outputs: dirMeta.outputs, + host: dirMeta.host, + lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { + return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); + }) + }); + this._cache.set(directiveType, meta); + } + return meta; + }; + RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { + var _this = this; + var view = this._viewResolver.resolve(component); + var directives = flattenDirectives(view, this._platformDirectives); + for (var i = 0; i < directives.length; i++) { + if (!isValidDirective(directives[i])) { + throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); + } + } + return removeDuplicates(directives).map(function(type) { + return _this.getMetadata(type); + }); + }; + RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(2, di_2.Optional()), __param(2, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, Array])], RuntimeMetadataResolver); + return RuntimeMetadataResolver; + })(); + exports.RuntimeMetadataResolver = RuntimeMetadataResolver; + function removeDuplicates(items) { + var m = new Map(); + items.forEach(function(i) { + return m.set(i, null); + }); + return collection_1.MapWrapper.keys(m); + } + function flattenDirectives(view, platformDirectives) { + var directives = []; + if (lang_1.isPresent(platformDirectives)) { + flattenArray(platformDirectives, directives); + } + if (lang_1.isPresent(view.directives)) { + flattenArray(view.directives, directives); + } + return directives; + } + function flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + flattenArray(item, out); + } else { + out.push(item); + } + } + } + function isValidDirective(value) { + return lang_1.isPresent(value) && (value instanceof lang_1.Type); + } + function calcModuleUrl(type, dirMeta) { + if (lang_1.isPresent(dirMeta.moduleId)) { + return "package:" + dirMeta.moduleId + util_1.MODULE_SUFFIX; + } else { + return reflection_1.reflector.importUri(type); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var promise_1 = require("angular2/src/facade/promise"); + var lang_1 = require("angular2/src/facade/lang"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var XHRImpl = (function(_super) { + __extends(XHRImpl, _super); + function XHRImpl() { + _super.apply(this, arguments); + } + XHRImpl.prototype.get = function(url) { + var completer = promise_1.PromiseWrapper.completer(); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'text'; + xhr.onload = function() { + var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + if (200 <= status && status <= 300) { + completer.resolve(response); + } else { + completer.reject("Failed to load " + url, null); + } + }; + xhr.onerror = function() { + completer.reject("Failed to load " + url, null); + }; + xhr.send(); + return completer.promise; + }; + return XHRImpl; + })(xhr_1.XHR); + exports.XHRImpl = XHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/key_events", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var di_1 = require("angular2/src/core/di"); + var modifierKeys = ['alt', 'control', 'meta', 'shift']; + var modifierKeyGetters = { + 'alt': function(event) { + return event.altKey; + }, + 'control': function(event) { + return event.ctrlKey; + }, + 'meta': function(event) { + return event.metaKey; + }, + 'shift': function(event) { + return event.shiftKey; + } + }; + var KeyEventsPlugin = (function(_super) { + __extends(KeyEventsPlugin, _super); + function KeyEventsPlugin() { + _super.call(this); + } + KeyEventsPlugin.prototype.supports = function(eventName) { + return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); + }; + KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var parsedEvent = KeyEventsPlugin.parseEventName(eventName); + var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); + }); + }; + KeyEventsPlugin.parseEventName = function(eventName) { + var parts = eventName.toLowerCase().split('.'); + var domEventName = parts.shift(); + if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { + return null; + } + var key = KeyEventsPlugin._normalizeKey(parts.pop()); + var fullKey = ''; + modifierKeys.forEach(function(modifierName) { + if (collection_1.ListWrapper.contains(parts, modifierName)) { + collection_1.ListWrapper.remove(parts, modifierName); + fullKey += modifierName + '.'; + } + }); + fullKey += key; + if (parts.length != 0 || key.length === 0) { + return null; + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); + collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); + return result; + }; + KeyEventsPlugin.getEventFullKey = function(event) { + var fullKey = ''; + var key = dom_adapter_1.DOM.getEventKey(event); + key = key.toLowerCase(); + if (lang_1.StringWrapper.equals(key, ' ')) { + key = 'space'; + } else if (lang_1.StringWrapper.equals(key, '.')) { + key = 'dot'; + } + modifierKeys.forEach(function(modifierName) { + if (modifierName != key) { + var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); + if (modifierGetter(event)) { + fullKey += modifierName + '.'; + } + } + }); + fullKey += key; + return fullKey; + }; + KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { + return function(event) { + if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { + zone.run(function() { + return handler(event); + }); + } + }; + }; + KeyEventsPlugin._normalizeKey = function(keyName) { + switch (keyName) { + case 'esc': + return 'escape'; + default: + return keyName; + } + }; + KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); + return KeyEventsPlugin; + })(event_manager_1.EventManagerPlugin); + exports.KeyEventsPlugin = KeyEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_common", ["angular2/src/core/render/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var collection_1 = require("angular2/src/facade/collection"); + var _eventNames = { + 'pan': true, + 'panstart': true, + 'panmove': true, + 'panend': true, + 'pancancel': true, + 'panleft': true, + 'panright': true, + 'panup': true, + 'pandown': true, + 'pinch': true, + 'pinchstart': true, + 'pinchmove': true, + 'pinchend': true, + 'pinchcancel': true, + 'pinchin': true, + 'pinchout': true, + 'press': true, + 'pressup': true, + 'rotate': true, + 'rotatestart': true, + 'rotatemove': true, + 'rotateend': true, + 'rotatecancel': true, + 'swipe': true, + 'swipeleft': true, + 'swiperight': true, + 'swipeup': true, + 'swipedown': true, + 'tap': true + }; + var HammerGesturesPluginCommon = (function(_super) { + __extends(HammerGesturesPluginCommon, _super); + function HammerGesturesPluginCommon() { + _super.call(this); + } + HammerGesturesPluginCommon.prototype.supports = function(eventName) { + eventName = eventName.toLowerCase(); + return collection_1.StringMapWrapper.contains(_eventNames, eventName); + }; + return HammerGesturesPluginCommon; + })(event_manager_1.EventManagerPlugin); + exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_bindings", ["angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + exports.EXCEPTION_PROVIDER = di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(dom_adapter_1.DOM, false); + }, + deps: [] + }); + exports.EXCEPTION_BINDING = exports.EXCEPTION_PROVIDER; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function wtfInit() {} + exports.wtfInit = wtfInit; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/bootstrap", ["angular2/src/core/application"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var application_1 = require("angular2/src/core/application"); + exports.bootstrap = application_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services/title", ["angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Title = (function() { + function Title() {} + Title.prototype.getTitle = function() { + return dom_adapter_1.DOM.getTitle(); + }; + Title.prototype.setTitle = function(newTitle) { + dom_adapter_1.DOM.setTitle(newTitle); + }; + return Title; + })(); + exports.Title = Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_1 = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var DebugElement = (function() { + function DebugElement() {} + Object.defineProperty(DebugElement.prototype, "componentInstance", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "elementRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "componentViewChildren", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + DebugElement.prototype.query = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var results = this.queryAll(predicate, scope); + return results.length > 0 ? results[0] : null; + }; + DebugElement.prototype.queryAll = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var elementsInScope = scope(this); + return elementsInScope.filter(predicate); + }; + return DebugElement; + })(); + exports.DebugElement = DebugElement; + var DebugElement_ = (function(_super) { + __extends(DebugElement_, _super); + function DebugElement_(_parentView, _boundElementIndex) { + _super.call(this); + this._parentView = _parentView; + this._boundElementIndex = _boundElementIndex; + this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex]; + } + Object.defineProperty(DebugElement_.prototype, "componentInstance", { + get: function() { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.getComponent(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "nativeElement", { + get: function() { + return this.elementRef.nativeElement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "elementRef", { + get: function() { + return this._parentView.elementRefs[this._boundElementIndex]; + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.getDirectiveInstance = function(directiveIndex) { + return this._elementInjector.getDirectiveAtIndex(directiveIndex); + }; + Object.defineProperty(DebugElement_.prototype, "children", { + get: function() { + return this._getChildElements(this._parentView, this._boundElementIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "componentViewChildren", { + get: function() { + var shadowView = this._parentView.getNestedView(this._boundElementIndex); + if (!lang_1.isPresent(shadowView) || shadowView.proto.type !== view_1.ViewType.COMPONENT) { + return []; + } + return this._getChildElements(shadowView, null); + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.triggerEventHandler = function(eventName, eventObj) { + this._parentView.triggerEventHandlers(eventName, eventObj, this._boundElementIndex); + }; + DebugElement_.prototype.hasDirective = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return false; + } + return this._elementInjector.hasDirective(type); + }; + DebugElement_.prototype.inject = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.get(type); + }; + DebugElement_.prototype.getLocal = function(name) { + return this._parentView.locals.get(name); + }; + DebugElement_.prototype._getChildElements = function(view, parentBoundElementIndex) { + var _this = this; + var els = []; + var parentElementBinder = null; + if (lang_1.isPresent(parentBoundElementIndex)) { + parentElementBinder = view.proto.elementBinders[parentBoundElementIndex - view.elementOffset]; + } + for (var i = 0; i < view.proto.elementBinders.length; ++i) { + var binder = view.proto.elementBinders[i]; + if (binder.parent == parentElementBinder) { + els.push(new DebugElement_(view, view.elementOffset + i)); + var views = view.viewContainers[view.elementOffset + i]; + if (lang_1.isPresent(views)) { + views.views.forEach(function(nextView) { + els = els.concat(_this._getChildElements(nextView, null)); + }); + } + } + } + return els; + }; + return DebugElement_; + })(DebugElement); + exports.DebugElement_ = DebugElement_; + function inspectElement(elementRef) { + return new DebugElement_(view_ref_1.internalView(elementRef.parentView), elementRef.boundElementIndex); + } + exports.inspectElement = inspectElement; + function asNativeElements(arr) { + return arr.map(function(debugEl) { + return debugEl.nativeElement; + }); + } + exports.asNativeElements = asNativeElements; + var Scope = (function() { + function Scope() {} + Scope.all = function(debugElement) { + var scope = []; + scope.push(debugElement); + debugElement.children.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + debugElement.componentViewChildren.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + return scope; + }; + Scope.light = function(debugElement) { + var scope = []; + debugElement.children.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + Scope.view = function(debugElement) { + var scope = []; + debugElement.componentViewChildren.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + return Scope; + })(); + exports.Scope = Scope; + var By = (function() { + function By() {} + By.all = function() { + return function(debugElement) { + return true; + }; + }; + By.css = function(selector) { + return function(debugElement) { + return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; + }; + }; + By.directive = function(type) { + return function(debugElement) { + return debugElement.hasDirective(type); + }; + }; + return By; + })(); + exports.By = By; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element_view_listener", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/linker/view_listener", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/api", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var api_1 = require("angular2/src/core/render/api"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var NG_ID_PROPERTY = 'ngid'; + var INSPECT_GLOBAL_NAME = 'ng.probe'; + var NG_ID_SEPARATOR = '#'; + var _allIdsByView = new collection_1.Map(); + var _allViewsById = new collection_1.Map(); + var _nextId = 0; + function _setElementId(element, indices) { + if (lang_1.isPresent(element)) { + dom_adapter_1.DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); + } + } + function _getElementId(element) { + var elId = dom_adapter_1.DOM.getData(element, NG_ID_PROPERTY); + if (lang_1.isPresent(elId)) { + return elId.split(NG_ID_SEPARATOR).map(function(partStr) { + return lang_1.NumberWrapper.parseInt(partStr, 10); + }); + } else { + return null; + } + } + function inspectNativeElement(element) { + var elId = _getElementId(element); + if (lang_1.isPresent(elId)) { + var view = _allViewsById.get(elId[0]); + if (lang_1.isPresent(view)) { + return new debug_element_1.DebugElement_(view, elId[1]); + } + } + return null; + } + exports.inspectNativeElement = inspectNativeElement; + var DebugElementViewListener = (function() { + function DebugElementViewListener(_renderer) { + this._renderer = _renderer; + dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); + } + DebugElementViewListener.prototype.onViewCreated = function(view) { + var viewId = _nextId++; + _allViewsById.set(viewId, view); + _allIdsByView.set(view, viewId); + for (var i = 0; i < view.elementRefs.length; i++) { + var el = view.elementRefs[i]; + _setElementId(this._renderer.getNativeElementSync(el), [viewId, i]); + } + }; + DebugElementViewListener.prototype.onViewDestroyed = function(view) { + var viewId = _allIdsByView.get(view); + _allIdsByView.delete(view); + _allViewsById.delete(viewId); + }; + DebugElementViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [api_1.Renderer])], DebugElementViewListener); + return DebugElementViewListener; + })(); + exports.DebugElementViewListener = DebugElementViewListener; + exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([DebugElementViewListener, lang_1.CONST_EXPR(new di_1.Provider(view_listener_1.AppViewListener, {useExisting: DebugElementViewListener}))]); + exports.ELEMENT_PROBE_BINDINGS = exports.ELEMENT_PROBE_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.enableDevMode = lang_1.enableDevMode; + global.define = __define; + return module.exports; +}); + +System.register("angular2/profile", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var profile_1 = require("angular2/src/core/profile/profile"); + exports.wtfCreateScope = profile_1.wtfCreateScope; + exports.wtfLeave = profile_1.wtfLeave; + exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; + exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/lifecycle_hooks", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/bootstrap", ["angular2/src/core/bootstrap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var bootstrap_1 = require("angular2/src/core/bootstrap"); + exports.bootstrap = bootstrap_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/metadata", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var COMPONENT_SELECTOR = /^[\w|-]*$/; + var SKEWER_CASE = /-(\w)/g; + var directiveResolver = new angular2_1.DirectiveResolver(); + function getComponentInfo(type) { + var resolvedMetadata = directiveResolver.resolve(type); + var selector = resolvedMetadata.selector; + if (!selector.match(COMPONENT_SELECTOR)) { + throw new Error('Only selectors matching element names are supported, got: ' + selector); + } + var selector = selector.replace(SKEWER_CASE, function(all, letter) { + return letter.toUpperCase(); + }); + return { + type: type, + selector: selector, + inputs: parseFields(resolvedMetadata.inputs), + outputs: parseFields(resolvedMetadata.outputs) + }; + } + exports.getComponentInfo = getComponentInfo; + function parseFields(names) { + var attrProps = []; + if (names) { + for (var i = 0; i < names.length; i++) { + var parts = names[i].split(':'); + var prop = parts[0].trim(); + var attr = (parts[1] || parts[0]).trim(); + var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1); + attrProps.push({ + prop: prop, + attr: attr, + bracketAttr: "[" + attr + "]", + parenAttr: "(" + attr + ")", + bracketParenAttr: "[(" + attr + ")]", + onAttr: "on" + capitalAttr, + bindAttr: "bind" + capitalAttr, + bindonAttr: "bindon" + capitalAttr + }); + } + } + return attrProps; + } + exports.parseFields = parseFields; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function stringify(obj) { + if (typeof obj == 'function') + return obj.name || obj.toString(); + return '' + obj; + } + exports.stringify = stringify; + function onError(e) { + console.log(e, e.stack); + throw e; + } + exports.onError = onError; + function controllerKey(name) { + return '$' + name + 'Controller'; + } + exports.controllerKey = controllerKey; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager'; + exports.NG2_COMPILER = 'ng2.Compiler'; + exports.NG2_INJECTOR = 'ng2.Injector'; + exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap'; + exports.NG2_ZONE = 'ng2.NgZone'; + exports.NG1_CONTROLLER = '$controller'; + exports.NG1_SCOPE = '$scope'; + exports.NG1_ROOT_SCOPE = '$rootScope'; + exports.NG1_COMPILE = '$compile'; + exports.NG1_HTTP_BACKEND = '$httpBackend'; + exports.NG1_INJECTOR = '$injector'; + exports.NG1_PARSE = '$parse'; + exports.NG1_TEMPLATE_CACHE = '$templateCache'; + exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/angular2", "angular2/src/upgrade/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var DowngradeNg2ComponentAdapter = (function() { + function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) { + this.id = id; + this.info = info; + this.element = element; + this.attrs = attrs; + this.scope = scope; + this.parentInjector = parentInjector; + this.parse = parse; + this.viewManager = viewManager; + this.protoView = protoView; + this.component = null; + this.inputChangeCount = 0; + this.inputChanges = null; + this.hostViewRef = null; + this.changeDetector = null; + this.contentInserctionPoint = null; + this.element[0].id = id; + this.componentScope = scope.$new(); + this.childNodes = element.contents(); + } + DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() { + var childInjector = this.parentInjector.resolveAndCreateChild([angular2_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]); + this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector); + var renderer = this.hostViewRef.render; + var hostElement = this.viewManager.getHostElement(this.hostViewRef); + this.changeDetector = this.hostViewRef.changeDetectorRef; + this.component = this.viewManager.getComponent(hostElement); + this.contentInserctionPoint = renderer.rootContentInsertionPoints[0]; + }; + DowngradeNg2ComponentAdapter.prototype.setupInputs = function() { + var _this = this; + var attrs = this.attrs; + var inputs = this.info.inputs; + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + var expr = null; + if (attrs.hasOwnProperty(input.attr)) { + var observeFn = (function(prop) { + var prevValue = INITIAL_VALUE; + return function(value) { + if (_this.inputChanges !== null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue); + prevValue = value; + } + _this.component[prop] = value; + }; + })(input.prop); + attrs.$observe(input.attr, observeFn); + } else if (attrs.hasOwnProperty(input.bindAttr)) { + expr = attrs[input.bindAttr]; + } else if (attrs.hasOwnProperty(input.bracketAttr)) { + expr = attrs[input.bracketAttr]; + } else if (attrs.hasOwnProperty(input.bindonAttr)) { + expr = attrs[input.bindonAttr]; + } else if (attrs.hasOwnProperty(input.bracketParenAttr)) { + expr = attrs[input.bracketParenAttr]; + } + if (expr != null) { + var watchFn = (function(prop) { + return function(value, prevValue) { + if (_this.inputChanges != null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(prevValue, value); + } + _this.component[prop] = value; + }; + })(input.prop); + this.componentScope.$watch(expr, watchFn); + } + } + var prototype = this.info.type.prototype; + if (prototype && prototype.onChanges) { + this.inputChanges = {}; + this.componentScope.$watch(function() { + return _this.inputChangeCount; + }, function() { + var inputChanges = _this.inputChanges; + _this.inputChanges = {}; + _this.component.onChanges(inputChanges); + }); + } + this.componentScope.$watch(function() { + return _this.changeDetector && _this.changeDetector.detectChanges(); + }); + }; + DowngradeNg2ComponentAdapter.prototype.projectContent = function() { + var childNodes = this.childNodes; + if (this.contentInserctionPoint) { + var parent = this.contentInserctionPoint.parentNode; + for (var i = 0, + ii = childNodes.length; i < ii; i++) { + parent.insertBefore(childNodes[i], this.contentInserctionPoint); + } + } + }; + DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() { + var _this = this; + var attrs = this.attrs; + var outputs = this.info.outputs; + for (var j = 0; j < outputs.length; j++) { + var output = outputs[j]; + var expr = null; + var assignExpr = false; + var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null; + var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null; + if (attrs.hasOwnProperty(output.onAttr)) { + expr = attrs[output.onAttr]; + } else if (attrs.hasOwnProperty(output.parenAttr)) { + expr = attrs[output.parenAttr]; + } else if (attrs.hasOwnProperty(bindonAttr)) { + expr = attrs[bindonAttr]; + assignExpr = true; + } else if (attrs.hasOwnProperty(bracketParenAttr)) { + expr = attrs[bracketParenAttr]; + assignExpr = true; + } + if (expr != null && assignExpr != null) { + var getter = this.parse(expr); + var setter = getter.assign; + if (assignExpr && !setter) { + throw new Error("Expression '" + expr + "' is not assignable!"); + } + var emitter = this.component[output.prop]; + if (emitter) { + emitter.subscribe({next: assignExpr ? (function(setter) { + return function(value) { + return setter(_this.scope, value); + }; + })(setter) : (function(getter) { + return function(value) { + return getter(_this.scope, {$event: value}); + }; + })(getter)}); + } else { + throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!"); + } + } + } + }; + DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() { + var _this = this; + this.element.bind('$remove', function() { + return _this.viewManager.destroyRootHostView(_this.hostViewRef); + }); + }; + return DowngradeNg2ComponentAdapter; + })(); + exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter; + var Ng1Change = (function() { + function Ng1Change(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + Ng1Change.prototype.isFirstChange = function() { + return this.previousValue === this.currentValue; + }; + return Ng1Change; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function noNg() { + throw new Error('AngularJS v1.x is not loaded!'); + } + var angular = { + bootstrap: noNg, + module: noNg, + element: noNg, + version: noNg + }; + try { + if (window.hasOwnProperty('angular')) { + angular = window.angular; + } + } catch (e) {} + exports.bootstrap = angular.bootstrap; + exports.module = angular.module; + exports.element = angular.element; + exports.version = angular.version; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +/** + @license + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Netflix, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_1 = require("angular2/src/core/metadata/view"); + var selector_1 = require("angular2/src/compiler/selector"); + var util_1 = require("angular2/src/compiler/util"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; + var CompileTypeMetadata = (function() { + function CompileTypeMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + runtime = _b.runtime, + name = _b.name, + moduleUrl = _b.moduleUrl, + isHost = _b.isHost; + this.runtime = runtime; + this.name = name; + this.moduleUrl = moduleUrl; + this.isHost = lang_1.normalizeBool(isHost); + } + CompileTypeMetadata.fromJson = function(data) { + return new CompileTypeMetadata({ + name: data['name'], + moduleUrl: data['moduleUrl'], + isHost: data['isHost'] + }); + }; + CompileTypeMetadata.prototype.toJson = function() { + return { + 'name': this.name, + 'moduleUrl': this.moduleUrl, + 'isHost': this.isHost + }; + }; + return CompileTypeMetadata; + })(); + exports.CompileTypeMetadata = CompileTypeMetadata; + var CompileTemplateMetadata = (function() { + function CompileTemplateMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + encapsulation = _b.encapsulation, + template = _b.template, + templateUrl = _b.templateUrl, + styles = _b.styles, + styleUrls = _b.styleUrls, + ngContentSelectors = _b.ngContentSelectors; + this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; + this.template = template; + this.templateUrl = templateUrl; + this.styles = lang_1.isPresent(styles) ? styles : []; + this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; + this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; + } + CompileTemplateMetadata.fromJson = function(data) { + return new CompileTemplateMetadata({ + encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], + template: data['template'], + templateUrl: data['templateUrl'], + styles: data['styles'], + styleUrls: data['styleUrls'], + ngContentSelectors: data['ngContentSelectors'] + }); + }; + CompileTemplateMetadata.prototype.toJson = function() { + return { + 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, + 'template': this.template, + 'templateUrl': this.templateUrl, + 'styles': this.styles, + 'styleUrls': this.styleUrls, + 'ngContentSelectors': this.ngContentSelectors + }; + }; + return CompileTemplateMetadata; + })(); + exports.CompileTemplateMetadata = CompileTemplateMetadata; + var CompileDirectiveMetadata = (function() { + function CompileDirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + hostListeners = _b.hostListeners, + hostProperties = _b.hostProperties, + hostAttributes = _b.hostAttributes, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + this.type = type; + this.isComponent = isComponent; + this.dynamicLoadable = dynamicLoadable; + this.selector = selector; + this.exportAs = exportAs; + this.changeDetection = changeDetection; + this.inputs = inputs; + this.outputs = outputs; + this.hostListeners = hostListeners; + this.hostProperties = hostProperties; + this.hostAttributes = hostAttributes; + this.lifecycleHooks = lifecycleHooks; + this.template = template; + } + CompileDirectiveMetadata.create = function(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + host = _b.host, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + var hostListeners = {}; + var hostProperties = {}; + var hostAttributes = {}; + if (lang_1.isPresent(host)) { + collection_1.StringMapWrapper.forEach(host, function(value, key) { + var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); + if (lang_1.isBlank(matches)) { + hostAttributes[key] = value; + } else if (lang_1.isPresent(matches[1])) { + hostProperties[matches[1]] = value; + } else if (lang_1.isPresent(matches[2])) { + hostListeners[matches[2]] = value; + } + }); + } + var inputsMap = {}; + if (lang_1.isPresent(inputs)) { + inputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + inputsMap[parts[0]] = parts[1]; + }); + } + var outputsMap = {}; + if (lang_1.isPresent(outputs)) { + outputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + outputsMap[parts[0]] = parts[1]; + }); + } + return new CompileDirectiveMetadata({ + type: type, + isComponent: lang_1.normalizeBool(isComponent), + dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), + selector: selector, + exportAs: exportAs, + changeDetection: changeDetection, + inputs: inputsMap, + outputs: outputsMap, + hostListeners: hostListeners, + hostProperties: hostProperties, + hostAttributes: hostAttributes, + lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], + template: template + }); + }; + CompileDirectiveMetadata.fromJson = function(data) { + return new CompileDirectiveMetadata({ + isComponent: data['isComponent'], + dynamicLoadable: data['dynamicLoadable'], + selector: data['selector'], + exportAs: data['exportAs'], + type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], + changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], + inputs: data['inputs'], + outputs: data['outputs'], + hostListeners: data['hostListeners'], + hostProperties: data['hostProperties'], + hostAttributes: data['hostAttributes'], + lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { + return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; + }), + template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'] + }); + }; + CompileDirectiveMetadata.prototype.toJson = function() { + return { + 'isComponent': this.isComponent, + 'dynamicLoadable': this.dynamicLoadable, + 'selector': this.selector, + 'exportAs': this.exportAs, + 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, + 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, + 'inputs': this.inputs, + 'outputs': this.outputs, + 'hostListeners': this.hostListeners, + 'hostProperties': this.hostProperties, + 'hostAttributes': this.hostAttributes, + 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { + return lang_1.serializeEnum(hook); + }), + 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template + }; + }; + return CompileDirectiveMetadata; + })(); + exports.CompileDirectiveMetadata = CompileDirectiveMetadata; + function createHostComponentMeta(componentType, componentSelector) { + var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); + return CompileDirectiveMetadata.create({ + type: new CompileTypeMetadata({ + runtime: Object, + name: "Host" + componentType.name, + moduleUrl: componentType.moduleUrl, + isHost: true + }), + template: new CompileTemplateMetadata({ + template: template, + templateUrl: '', + styles: [], + styleUrls: [], + ngContentSelectors: [] + }), + changeDetection: change_detection_1.ChangeDetectionStrategy.Default, + inputs: [], + outputs: [], + host: {}, + lifecycleHooks: [], + isComponent: true, + dynamicLoadable: false, + selector: '*' + }); + } + exports.createHostComponentMeta = createHostComponentMeta; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { + var pvVisitors = []; + var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); + template_ast_1.templateVisitAll(visitor, parsedTemplate); + return createChangeDefinitions(pvVisitors, componentType, genConfig); + } + exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; + var ProtoViewVisitor = (function() { + function ProtoViewVisitor(parent, allVisitors, strategy) { + this.parent = parent; + this.allVisitors = allVisitors; + this.strategy = strategy; + this.boundTextCount = 0; + this.boundElementCount = 0; + this.variableNames = []; + this.bindingRecords = []; + this.eventRecords = []; + this.directiveRecords = []; + this.viewIndex = allVisitors.length; + allVisitors.push(this); + } + ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + this.boundElementCount++; + template_ast_1.templateVisitAll(this, ast.outputs); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); + template_ast_1.templateVisitAll(childVisitor, ast.vars); + template_ast_1.templateVisitAll(childVisitor, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitElement = function(ast, context) { + if (ast.isBound()) { + this.boundElementCount++; + } + template_ast_1.templateVisitAll(this, ast.inputs, null); + template_ast_1.templateVisitAll(this, ast.outputs); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + template_ast_1.templateVisitAll(this, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitVariable = function(ast, context) { + this.variableNames.push(ast.name); + return null; + }; + ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { + var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); + this.eventRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { + var boundElementIndex = this.boundElementCount - 1; + var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; + var bindingRecord; + if (ast.type === template_ast_1.PropertyBindingType.Property) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Class) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Style) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); + } + this.bindingRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { + var boundTextIndex = this.boundTextCount++; + this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, boundTextIndex)); + return null; + }; + ProtoViewVisitor.prototype.visitText = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { + var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); + var directiveMetadata = ast.directive; + var directiveRecord = new change_detection_1.DirectiveRecord({ + directiveIndex: directiveIndex, + callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, + callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, + callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, + callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, + callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, + callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, + callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, + changeDetection: directiveMetadata.changeDetection + }); + this.directiveRecords.push(directiveRecord); + template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); + var bindingRecords = this.bindingRecords; + if (directiveRecord.callOnChanges) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); + } + if (directiveRecord.callOnInit) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); + } + if (directiveRecord.callDoCheck) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); + } + template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); + template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + return null; + }; + ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { + var setter = reflection_1.reflector.setter(ast.directiveName); + this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); + return null; + }; + return ProtoViewVisitor; + })(); + function createChangeDefinitions(pvVisitors, componentType, genConfig) { + var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); + return pvVisitors.map(function(pvVisitor) { + var id = componentType.name + "_" + pvVisitor.viewIndex; + return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); + }); + } + function _collectNestedProtoViewsVariableNames(pvVisitors) { + var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); + pvVisitors.forEach(function(pv) { + var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; + nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); + }); + return nestedPvVariableNames; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/core/render/view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var view_1 = require("angular2/src/core/metadata/view"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var shadow_css_1 = require("angular2/src/compiler/shadow_css"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var StyleCompiler = (function() { + function StyleCompiler(_xhr, _urlResolver) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._styleCache = new Map(); + this._shadowCss = new shadow_css_1.ShadowCss(); + } + StyleCompiler.prototype.compileComponentRuntime = function(template) { + var styles = template.styles; + var styleAbsUrls = template.styleUrls; + return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); + }; + StyleCompiler.prototype.compileComponentCodeGen = function(template) { + var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; + return this._styleCodeGen(template.styles, template.styleUrls, shim); + }; + StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); + return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; + }; + StyleCompiler.prototype.clearCache = function() { + this._styleCache.clear(); + }; + StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { + var _this = this; + var promises = absUrls.map(function(absUrl) { + var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); + var result = _this._styleCache.get(cacheKey); + if (lang_1.isBlank(result)) { + result = _this._xhr.get(absUrl).then(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); + return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); + }); + _this._styleCache.set(cacheKey, result); + } + return result; + }); + return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { + var result = plainStyles.map(function(plainStyle) { + return _this._shimIfNeeded(plainStyle, encapsulate); + }); + nestedStyles.forEach(function(styles) { + return result.push(styles); + }); + return result; + }); + }; + StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { + var _this = this; + var arrayPrefix = lang_1.IS_DART ? "const" : ''; + var styleExpressions = plainStyles.map(function(plainStyle) { + return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); + }); + for (var i = 0; i < absUrls.length; i++) { + var moduleUrl = this._createModuleUrl(absUrls[i], shim); + styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); + } + var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; + return new source_module_1.SourceExpression([], expressionSource); + }; + StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { + var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; + return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); + }; + StyleCompiler.prototype._shimIfNeeded = function(style, shim) { + return shim ? this._shadowCss.shimCssText(style, view_factory_1.CONTENT_ATTR, view_factory_1.HOST_ATTR) : style; + }; + StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { + return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + }; + StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); + return StyleCompiler; + })(); + exports.StyleCompiler = StyleCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/html_ast", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var HtmlParser = (function() { + function HtmlParser() {} + HtmlParser.prototype.parse = function(template, sourceInfo) { + var root = dom_adapter_1.DOM.createTemplate(template); + return parseChildNodes(root, sourceInfo); + }; + HtmlParser.prototype.unparse = function(nodes) { + var visitor = new UnparseVisitor(); + var parts = []; + html_ast_1.htmlVisitAll(visitor, nodes, parts); + return parts.join(''); + }; + HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); + return HtmlParser; + })(); + exports.HtmlParser = HtmlParser; + function parseText(text, indexInParent, parentSourceInfo) { + var value = dom_adapter_1.DOM.getText(text); + return new html_ast_1.HtmlTextAst(value, parentSourceInfo + " > #text(" + value + "):nth-child(" + indexInParent + ")"); + } + function parseAttr(element, parentSourceInfo, attrName, attrValue) { + return new html_ast_1.HtmlAttrAst(attrName, attrValue, parentSourceInfo + "[" + attrName + "=" + attrValue + "]"); + } + function parseElement(element, indexInParent, parentSourceInfo) { + var nodeName = dom_adapter_1.DOM.nodeName(element).toLowerCase(); + var sourceInfo = parentSourceInfo + " > " + nodeName + ":nth-child(" + indexInParent + ")"; + var attrs = parseAttrs(element, sourceInfo); + var childNodes = parseChildNodes(element, sourceInfo); + return new html_ast_1.HtmlElementAst(nodeName, attrs, childNodes, sourceInfo); + } + function parseAttrs(element, elementSourceInfo) { + var attrMap = dom_adapter_1.DOM.attributeMap(element); + var attrList = []; + attrMap.forEach(function(value, name) { + return attrList.push([name, value]); + }); + attrList.sort(function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + return attrList.map(function(entry) { + return parseAttr(element, elementSourceInfo, entry[0], entry[1]); + }); + } + function parseChildNodes(element, parentSourceInfo) { + var root = dom_adapter_1.DOM.templateAwareRoot(element); + var childNodes = dom_adapter_1.DOM.childNodesAsList(root); + var result = []; + var index = 0; + childNodes.forEach(function(childNode) { + var childResult = null; + if (dom_adapter_1.DOM.isTextNode(childNode)) { + var text = childNode; + childResult = parseText(text, index, parentSourceInfo); + } else if (dom_adapter_1.DOM.isElementNode(childNode)) { + var el = childNode; + childResult = parseElement(el, index, parentSourceInfo); + } + if (lang_1.isPresent(childResult)) { + result.push(childResult); + } + index++; + }); + return result; + } + var UnparseVisitor = (function() { + function UnparseVisitor() {} + UnparseVisitor.prototype.visitElement = function(ast, parts) { + parts.push("<" + ast.name); + var attrs = []; + html_ast_1.htmlVisitAll(this, ast.attrs, attrs); + if (ast.attrs.length > 0) { + parts.push(' '); + parts.push(attrs.join(' ')); + } + parts.push(">"); + html_ast_1.htmlVisitAll(this, ast.children, parts); + parts.push(""); + return null; + }; + UnparseVisitor.prototype.visitAttr = function(ast, parts) { + parts.push(ast.name + "=" + util_1.escapeDoubleQuoteString(ast.value)); + return null; + }; + UnparseVisitor.prototype.visitText = function(ast, parts) { + parts.push(ast.value); + return null; + }; + return UnparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var GenericBrowserDomAdapter = (function(_super) { + __extends(GenericBrowserDomAdapter, _super); + function GenericBrowserDomAdapter() { + var _this = this; + _super.call(this); + this._animationPrefix = null; + this._transitionEnd = null; + try { + var element = this.createElement('div', this.defaultDoc()); + if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { + this._animationPrefix = ''; + } else { + var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; + for (var i = 0; i < domPrefixes.length; i++) { + if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { + this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; + break; + } + } + } + var transEndEventNames = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { + if (lang_1.isPresent(_this.getStyle(element, key))) { + _this._transitionEnd = value; + } + }); + } catch (e) { + this._animationPrefix = null; + this._transitionEnd = null; + } + } + GenericBrowserDomAdapter.prototype.getXHR = function() { + return xhr_impl_1.XHRImpl; + }; + GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { + return el.getDistributedNodes(); + }; + GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + el.href = href == null ? baseUrl : baseUrl + '/../' + href; + }; + GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { + return true; + }; + GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { + return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); + }; + GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { + return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; + }; + GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { + return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; + }; + GenericBrowserDomAdapter.prototype.supportsAnimation = function() { + return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); + }; + return GenericBrowserDomAdapter; + })(dom_adapter_1.DomAdapter); + exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/browser_testability", ["angular2/src/core/testability/testability", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var testability_1 = require("angular2/src/core/testability/testability"); + var lang_1 = require("angular2/src/facade/lang"); + var PublicTestability = (function() { + function PublicTestability(testability) { + this._testability = testability; + } + PublicTestability.prototype.isStable = function() { + return this._testability.isStable(); + }; + PublicTestability.prototype.whenStable = function(callback) { + this._testability.whenStable(callback); + }; + PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { + return this.findProviders(using, provider, exactMatch); + }; + PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { + return this._testability.findBindings(using, provider, exactMatch); + }; + return PublicTestability; + })(); + var BrowserGetTestability = (function() { + function BrowserGetTestability() {} + BrowserGetTestability.init = function() { + testability_1.setTestabilityGetter(new BrowserGetTestability()); + }; + BrowserGetTestability.prototype.addToWindow = function(registry) { + lang_1.global.getAngularTestability = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + var testability = registry.findTestabilityInTree(elem, findInAncestors); + if (testability == null) { + throw new Error('Could not find testability for element.'); + } + return new PublicTestability(testability); + }; + lang_1.global.getAllAngularTestabilities = function() { + var testabilities = registry.getAllTestabilities(); + return testabilities.map(function(testability) { + return new PublicTestability(testability); + }); + }; + }; + return BrowserGetTestability; + })(); + exports.BrowserGetTestability = BrowserGetTestability; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_gestures", ["angular2/src/core/render/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var hammer_common_1 = require("angular2/src/core/render/dom/events/hammer_common"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var di_1 = require("angular2/src/core/di"); + var HammerGesturesPlugin = (function(_super) { + __extends(HammerGesturesPlugin, _super); + function HammerGesturesPlugin() { + _super.apply(this, arguments); + } + HammerGesturesPlugin.prototype.supports = function(eventName) { + if (!_super.prototype.supports.call(this, eventName)) + return false; + if (!lang_1.isPresent(window['Hammer'])) { + throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); + } + return true; + }; + HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + eventName = eventName.toLowerCase(); + zone.runOutsideAngular(function() { + var mc = new Hammer(element); + mc.get('pinch').set({enable: true}); + mc.get('rotate').set({enable: true}); + mc.on(eventName, function(eventObj) { + zone.run(function() { + handler(eventObj); + }); + }); + }); + }; + HammerGesturesPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HammerGesturesPlugin); + return HammerGesturesPlugin; + })(hammer_common_1.HammerGesturesPluginCommon); + exports.HammerGesturesPlugin = HammerGesturesPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services", ["angular2/src/compiler/app_root_url", "angular2/src/compiler/url_resolver", "angular2/src/core/services/title"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + exports.AppRootUrl = app_root_url_1.AppRootUrl; + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + exports.UrlResolver = url_resolver_1.UrlResolver; + var title_1 = require("angular2/src/core/services/title"); + exports.Title = title_1.Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug", ["angular2/src/core/debug/debug_element", "angular2/src/core/debug/debug_element_view_listener"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + exports.DebugElement = debug_element_1.DebugElement; + exports.asNativeElements = debug_element_1.asNativeElements; + exports.By = debug_element_1.By; + exports.Scope = debug_element_1.Scope; + exports.inspectElement = debug_element_1.inspectElement; + var debug_element_view_listener_1 = require("angular2/src/core/debug/debug_element_view_listener"); + exports.inspectNativeElement = debug_element_view_listener_1.inspectNativeElement; + exports.ELEMENT_PROBE_PROVIDERS = debug_element_view_listener_1.ELEMENT_PROBE_PROVIDERS; + exports.ELEMENT_PROBE_BINDINGS = debug_element_view_listener_1.ELEMENT_PROBE_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/angular2", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var util_1 = require("angular2/src/upgrade/util"); + var angular = require("angular2/src/upgrade/angular_js"); + var CAMEL_CASE = /([A-Z])/g; + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var NOT_SUPPORTED = 'NOT_SUPPORTED'; + var UpgradeNg1ComponentAdapterBuilder = (function() { + function UpgradeNg1ComponentAdapterBuilder(name) { + this.name = name; + this.inputs = []; + this.inputsRename = []; + this.outputs = []; + this.outputsRename = []; + this.propertyOutputs = []; + this.checkProperties = []; + this.propertyMap = {}; + this.linkFn = null; + this.directive = null; + this.$controller = null; + var selector = name.replace(CAMEL_CASE, function(all, next) { + return '-' + next.toLowerCase(); + }); + var self = this; + this.type = angular2_1.Directive({ + selector: selector, + inputs: this.inputsRename, + outputs: this.outputsRename + }).Class({ + constructor: [new angular2_1.Inject(constants_1.NG1_SCOPE), angular2_1.ElementRef, function(scope, elementRef) { + return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap); + }], + onChanges: function() {}, + doCheck: function() {} + }); + } + UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) { + var directives = injector.get(this.name + 'Directive'); + if (directives.length > 1) { + throw new Error('Only support single directive definition for: ' + this.name); + } + var directive = directives[0]; + if (directive.replace) + this.notSupported('replace'); + if (directive.terminal) + this.notSupported('terminal'); + var link = directive.link; + if (typeof link == 'object') { + if (link.post) + this.notSupported('link.post'); + } + return directive; + }; + UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) { + throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'."); + }; + UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() { + var scope = this.directive.scope; + if (typeof scope == 'object') { + for (var name in scope) { + if (scope.hasOwnProperty(name)) { + var localName = scope[name]; + var type = localName.charAt(0); + localName = localName.substr(1) || name; + var outputName = 'output_' + name; + var outputNameRename = outputName + ': ' + name; + var outputNameRenameChange = outputName + ': ' + name + 'Change'; + var inputName = 'input_' + name; + var inputNameRename = inputName + ': ' + name; + switch (type) { + case '=': + this.propertyOutputs.push(outputName); + this.checkProperties.push(localName); + this.outputs.push(outputName); + this.outputsRename.push(outputNameRenameChange); + this.propertyMap[outputName] = localName; + case '@': + this.inputs.push(inputName); + this.inputsRename.push(inputNameRename); + this.propertyMap[inputName] = localName; + break; + case '&': + this.outputs.push(outputName); + this.outputsRename.push(outputNameRename); + this.propertyMap[outputName] = localName; + break; + default: + var json = JSON.stringify(scope); + throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive."); + } + } + } + } + }; + UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) { + var _this = this; + if (this.directive.template) { + this.linkFn = compileHtml(this.directive.template); + } else if (this.directive.templateUrl) { + var url = this.directive.templateUrl; + var html = templateCache.get(url); + if (html !== undefined) { + this.linkFn = compileHtml(html); + } else { + return new Promise(function(resolve, err) { + httpBackend('GET', url, null, function(status, response) { + if (status == 200) { + resolve(_this.linkFn = compileHtml(templateCache.put(url, response))); + } else { + err("GET " + url + " returned " + status + ": " + response); + } + }); + }); + } + } else { + throw new Error("Directive '" + this.name + "' is not a component, it is missing template."); + } + return null; + function compileHtml(html) { + var div = document.createElement('div'); + div.innerHTML = html; + return compile(div.childNodes); + } + }; + UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) { + var promises = []; + var compile = injector.get(constants_1.NG1_COMPILE); + var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE); + var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND); + var $controller = injector.get(constants_1.NG1_CONTROLLER); + for (var name in exportedComponents) { + if (exportedComponents.hasOwnProperty(name)) { + var exportedComponent = exportedComponents[name]; + exportedComponent.directive = exportedComponent.extractDirective(injector); + exportedComponent.$controller = $controller; + exportedComponent.extractBindings(); + var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend); + if (promise) + promises.push(promise); + } + } + return Promise.all(promises); + }; + return UpgradeNg1ComponentAdapterBuilder; + })(); + exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder; + var UpgradeNg1ComponentAdapter = (function() { + function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) { + this.directive = directive; + this.inputs = inputs; + this.outputs = outputs; + this.propOuts = propOuts; + this.checkProperties = checkProperties; + this.propertyMap = propertyMap; + this.destinationObj = null; + this.checkLastValues = []; + var element = elementRef.nativeElement; + var childNodes = []; + var childNode; + while (childNode = element.firstChild) { + element.removeChild(childNode); + childNodes.push(childNode); + } + var componentScope = scope.$new(!!directive.scope); + var $element = angular.element(element); + var controllerType = directive.controller; + var controller = null; + if (controllerType) { + var locals = { + $scope: componentScope, + $element: $element + }; + controller = $controller(controllerType, locals, null, directive.controllerAs); + $element.data(util_1.controllerKey(directive.name), controller); + } + var link = directive.link; + if (typeof link == 'object') + link = link.pre; + if (link) { + var attrs = NOT_SUPPORTED; + var transcludeFn = NOT_SUPPORTED; + var linkController = this.resolveRequired($element, directive.require); + directive.link(componentScope, $element, attrs, linkController, transcludeFn); + } + this.destinationObj = directive.bindToController && controller ? controller : componentScope; + linkFn(componentScope, function(clonedElement, scope) { + for (var i = 0, + ii = clonedElement.length; i < ii; i++) { + element.appendChild(clonedElement[i]); + } + }, {parentBoundTranscludeFn: function(scope, cloneAttach) { + cloneAttach(childNodes); + }}); + for (var i = 0; i < inputs.length; i++) { + this[inputs[i]] = null; + } + for (var j = 0; j < outputs.length; j++) { + var emitter = this[outputs[j]] = new angular2_1.EventEmitter(); + this.setComponentProperty(outputs[j], (function(emitter) { + return function(value) { + return emitter.next(value); + }; + })(emitter)); + } + for (var k = 0; k < propOuts.length; k++) { + this[propOuts[k]] = new angular2_1.EventEmitter(); + this.checkLastValues.push(INITIAL_VALUE); + } + } + UpgradeNg1ComponentAdapter.prototype.onChanges = function(changes) { + for (var name in changes) { + if (changes.hasOwnProperty(name)) { + var change = changes[name]; + this.setComponentProperty(name, change.currentValue); + } + } + }; + UpgradeNg1ComponentAdapter.prototype.doCheck = function() { + var count = 0; + var destinationObj = this.destinationObj; + var lastValues = this.checkLastValues; + var checkProperties = this.checkProperties; + for (var i = 0; i < checkProperties.length; i++) { + var value = destinationObj[checkProperties[i]]; + var last = lastValues[i]; + if (value !== last) { + if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else { + var eventEmitter = this[this.propOuts[i]]; + eventEmitter.next(lastValues[i] = value); + } + } + } + return count; + }; + UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) { + this.destinationObj[this.propertyMap[name]] = value; + }; + UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) { + if (!require) { + return undefined; + } else if (typeof require == 'string') { + var name = require; + var isOptional = false; + var startParent = false; + var searchParents = false; + var ch; + if (name.charAt(0) == '?') { + isOptional = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + searchParents = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + startParent = true; + name = name.substr(1); + } + var key = util_1.controllerKey(name); + if (startParent) + $element = $element.parent(); + var dep = searchParents ? $element.inheritedData(key) : $element.data(key); + if (!dep && !isOptional) { + throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'."); + } + return dep; + } else if (require instanceof Array) { + var deps = []; + for (var i = 0; i < require.length; i++) { + deps.push(this.resolveRequired($element, require[i])); + } + return deps; + } + throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require); + }; + return UpgradeNg1ComponentAdapter; + })(); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); + var lang_1 = require("angular2/src/facade/lang"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; + var UTIL = "ChangeDetectionUtil"; + var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; + var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); + var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); + var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); + var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); + var ChangeDetectionCompiler = (function() { + function ChangeDetectionCompiler(_genConfig) { + this._genConfig = _genConfig; + } + ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { + var _this = this; + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + return changeDetectorDefinitions.map(function(definition) { + return _this._createChangeDetectorFactory(definition); + }); + }; + ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { + if (lang_1.IS_DART || !this._genConfig.useJit) { + var proto = new change_detection_1.DynamicProtoChangeDetector(definition); + return function(dispatcher) { + return proto.instantiate(dispatcher); + }; + } else { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR, CHANGE_DETECTOR_STATE).generate(); + } + }; + ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + var factories = []; + var index = 0; + var sourceParts = changeDetectorDefinitions.map(function(definition) { + var codegen; + var sourcePart; + if (lang_1.IS_DART) { + codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); + var className = "_" + definition.id; + var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; + codegen.generate(typeRef, className, definition); + factories.push(className + ".newChangeDetector"); + sourcePart = codegen.toString(); + } else { + codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); + factories.push("function(dispatcher) { return new " + codegen.typeName + "(dispatcher); }"); + sourcePart = codegen.generateSource(); + } + index++; + return sourcePart; + }); + return new source_module_1.SourceExpressions(sourceParts, factories); + }; + ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); + return ChangeDetectionCompiler; + })(); + exports.ChangeDetectionCompiler = ChangeDetectionCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var selector_1 = require("angular2/src/compiler/selector"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = new RegExp('\\.'); + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + } + TemplateParser.prototype.parse = function(template, directives, sourceInfo) { + var parseVisitor = new TemplateParseVisitor(directives, this._exprParser, this._schemaRegistry); + var result = html_ast_1.htmlVisitAll(parseVisitor, this._htmlParser.parse(template, sourceInfo), EMPTY_COMPONENT); + if (parseVisitor.errors.length > 0) { + var errorString = parseVisitor.errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result; + }; + TemplateParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser])], TemplateParser); + return TemplateParser; + })(); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(directives, _exprParser, _schemaRegistry) { + var _this = this; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + } + TemplateParseVisitor.prototype._reportError = function(message) { + this.errors.push(message); + }; + TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceInfo) { + try { + return this._exprParser.parseInterpolation(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseAction = function(value, sourceInfo) { + try { + return this._exprParser.parseAction(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseBinding = function(value, sourceInfo) { + try { + return this._exprParser.parseBinding(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceInfo) { + try { + return this._exprParser.parseTemplateBindings(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return []; + } + }; + TemplateParseVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + var expr = this._parseInterpolation(ast.value, ast.sourceInfo); + if (lang_1.isPresent(expr)) { + return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceInfo); + } else { + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + } + }; + TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + TemplateParseVisitor.prototype.visitElement = function(element, component) { + var _this = this; + var nodeName = element.name; + var preparsedElement = template_preparser_1.preparseElement(element); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { + return null; + } + if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { + return null; + } + var matchableAttrs = []; + var elementOrDirectiveProps = []; + var vars = []; + var events = []; + var templateElementOrDirectiveProps = []; + var templateVars = []; + var templateMatchableAttrs = []; + var hasInlineTemplates = false; + var attrs = []; + element.attrs.forEach(function(attr) { + matchableAttrs.push([attr.name, attr.value]); + var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); + var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); + if (!hasBinding && !hasTemplateBinding) { + attrs.push(_this.visitAttr(attr, null)); + } + if (hasTemplateBinding) { + hasInlineTemplates = true; + } + }); + var isTemplateElement = nodeName == TEMPLATE_ELEMENT; + var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); + var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceInfo); + var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); + var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); + var elementNgContentIndex = hasInlineTemplates ? null : component.findNgContentIndex(elementCssSelector); + var parsedElement; + if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { + parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, elementNgContentIndex, element.sourceInfo); + } else if (isTemplateElement) { + this._assertAllEventsPublishedByDirectives(directives, events, element.sourceInfo); + this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, elementNgContentIndex, element.sourceInfo); + } else { + this._assertOnlyOneComponent(directives, element.sourceInfo); + var elementExportAsVars = vars.filter(function(varAst) { + return varAst.value.length === 0; + }); + parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, elementNgContentIndex, element.sourceInfo); + } + if (hasInlineTemplates) { + var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); + var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceInfo); + var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); + this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], component.findNgContentIndex(templateCssSelector), element.sourceInfo); + } + return parsedElement; + }; + TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { + var templateBindingsSource = null; + if (attr.name == TEMPLATE_ATTR) { + templateBindingsSource = attr.value; + } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { + var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; + } + if (lang_1.isPresent(templateBindingsSource)) { + var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceInfo); + for (var i = 0; i < bindings.length; i++) { + var binding = bindings[i]; + var dashCaseKey = util_1.camelCaseToDashCase(binding.key); + if (binding.keyIsVar) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(binding.key), binding.name, attr.sourceInfo)); + targetMatchableAttrs.push([dashCaseKey, binding.name]); + } else if (lang_1.isPresent(binding.expression)) { + this._parsePropertyAst(dashCaseKey, binding.expression, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else { + targetMatchableAttrs.push([dashCaseKey, '']); + this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps); + } + } + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { + var attrName = this._normalizeAttributeName(attr.name); + var attrValue = attr.value; + var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); + var hasBinding = false; + if (lang_1.isPresent(bindParts)) { + hasBinding = true; + if (lang_1.isPresent(bindParts[1])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[2])) { + var identifier = bindParts[5]; + this._parseVariable(identifier, attrValue, attr.sourceInfo, targetVars); + } else if (lang_1.isPresent(bindParts[3])) { + this._parseEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[4])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[6])) { + this._parseProperty(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[7])) { + this._parseProperty(bindParts[7], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[8])) { + this._parseEvent(bindParts[8], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } + } else { + hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } + if (!hasBinding) { + this._parseLiteralAttr(attrName, attrValue, attr.sourceInfo, targetProps); + } + return hasBinding; + }; + TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { + return attrName.startsWith('data-') ? attrName.substring(5) : attrName; + }; + TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceInfo, targetVars) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(identifier), value, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceInfo, targetMatchableAttrs, targetProps) { + this._parsePropertyAst(name, this._parseBinding(expression, sourceInfo), sourceInfo, targetMatchableAttrs, targetProps); + }; + TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceInfo, targetMatchableAttrs, targetProps) { + var expr = this._parseInterpolation(value, sourceInfo); + if (lang_1.isPresent(expr)) { + this._parsePropertyAst(name, expr, sourceInfo, targetMatchableAttrs, targetProps); + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceInfo, targetMatchableAttrs, targetProps) { + targetMatchableAttrs.push([name, ast.source]); + targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + this._parseEvent(name + "-change", expression + "=$event", sourceInfo, targetMatchableAttrs, targetEvents); + }; + TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + var parts = util_1.splitAtColon(name, [null, name]); + var target = parts[0]; + var eventName = parts[1]; + targetEvents.push(new template_ast_1.BoundEventAst(util_1.dashCaseToCamelCase(eventName), target, this._parseAction(expression, sourceInfo), sourceInfo)); + }; + TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceInfo, targetProps) { + targetProps.push(new BoundElementOrDirectiveProperty(util_1.dashCaseToCamelCase(name), this._exprParser.wrapLiteralPrimitive(value, sourceInfo), true, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { + var _this = this; + var directives = []; + selectorMatcher.match(elementCssSelector, function(selector, directive) { + directives.push(directive); + }); + collection_1.ListWrapper.sort(directives, function(dir1, dir2) { + var dir1Comp = dir1.isComponent; + var dir2Comp = dir2.isComponent; + if (dir1Comp && !dir2Comp) { + return -1; + } else if (!dir1Comp && dir2Comp) { + return 1; + } else { + return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); + } + }); + return directives; + }; + TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceInfo) { + var _this = this; + var matchedVariables = new Set(); + var directiveAsts = directives.map(function(directive) { + var hostProperties = []; + var hostEvents = []; + var directiveProperties = []; + _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceInfo, hostProperties); + _this._createDirectiveHostEventAsts(directive.hostListeners, sourceInfo, hostEvents); + _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); + var exportAsVars = []; + possibleExportAsVars.forEach(function(varAst) { + if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { + exportAsVars.push(varAst); + matchedVariables.add(varAst.name); + } + }); + return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceInfo); + }); + possibleExportAsVars.forEach(function(varAst) { + if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { + _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\" at " + varAst.sourceInfo); + } + }); + return directiveAsts; + }; + TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceInfo, targetPropertyAsts) { + var _this = this; + if (lang_1.isPresent(hostProps)) { + collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { + var exprAst = _this._parseBinding(expression, sourceInfo); + targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceInfo)); + }); + } + }; + TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceInfo, targetEventAsts) { + var _this = this; + if (lang_1.isPresent(hostListeners)) { + collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { + _this._parseEvent(propName, expression, sourceInfo, [], targetEventAsts); + }); + } + }; + TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { + if (lang_1.isPresent(directiveProperties)) { + var boundPropsByName = new Map(); + boundProps.forEach(function(boundProp) { + var key = util_1.dashCaseToCamelCase(boundProp.name); + var prevValue = boundPropsByName.get(boundProp.name); + if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { + boundPropsByName.set(key, boundProp); + } + }); + collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { + elProp = util_1.dashCaseToCamelCase(elProp); + var boundProp = boundPropsByName.get(elProp); + if (lang_1.isPresent(boundProp)) { + targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceInfo)); + } + }); + } + }; + TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { + var _this = this; + var boundElementProps = []; + var boundDirectivePropsIndex = new Map(); + directives.forEach(function(directive) { + directive.inputs.forEach(function(prop) { + boundDirectivePropsIndex.set(prop.templateName, prop); + }); + }); + props.forEach(function(prop) { + if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { + boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceInfo)); + } + }); + return boundElementProps; + }; + TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceInfo) { + var unit = null; + var bindingType; + var boundPropertyName; + var parts = lang_1.StringWrapper.split(name, PROPERTY_PARTS_SEPARATOR); + if (parts.length === 1) { + boundPropertyName = this._schemaRegistry.getMappedPropName(util_1.dashCaseToCamelCase(parts[0])); + bindingType = template_ast_1.PropertyBindingType.Property; + if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { + this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property in " + sourceInfo); + } + } else if (parts[0] == ATTRIBUTE_PREFIX) { + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Attribute; + } else if (parts[0] == CLASS_PREFIX) { + boundPropertyName = parts[1]; + bindingType = template_ast_1.PropertyBindingType.Class; + } else if (parts[0] == STYLE_PREFIX) { + unit = parts.length > 2 ? parts[2] : null; + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Style; + } else { + this._reportError("Invalid property name " + name + " in " + sourceInfo); + bindingType = null; + } + return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceInfo); + }; + TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { + var componentTypeNames = []; + directives.forEach(function(directive) { + var typeName = directive.directive.type.name; + if (directive.directive.isComponent) { + componentTypeNames.push(typeName); + } + }); + return componentTypeNames; + }; + TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceInfo) { + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 1) { + this._reportError("More than one component: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + }; + TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceInfo) { + var _this = this; + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 0) { + this._reportError("Components on an embedded template: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + elementProps.forEach(function(prop) { + _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template in " + prop.sourceInfo); + }); + }; + TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events, sourceInfo) { + var _this = this; + var allDirectiveEvents = new Set(); + directives.forEach(function(directive) { + collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { + allDirectiveEvents.add(eventName); + }); + }); + events.forEach(function(event) { + if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { + _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template in " + sourceInfo); + } + }); + }; + return TemplateParseVisitor; + })(); + var NonBindableVisitor = (function() { + function NonBindableVisitor() {} + NonBindableVisitor.prototype.visitElement = function(ast, component) { + var preparsedElement = template_preparser_1.preparseElement(ast); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { + return null; + } + var attrNameAndValues = ast.attrs.map(function(attrAst) { + return [attrAst.name, attrAst.value]; + }); + var selector = createElementCssSelector(ast.name, attrNameAndValues); + var ngContentIndex = component.findNgContentIndex(selector); + var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); + return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitAttr = function(ast, context) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + }; + return NonBindableVisitor; + })(); + var BoundElementOrDirectiveProperty = (function() { + function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceInfo) { + this.name = name; + this.expression = expression; + this.isLiteral = isLiteral; + this.sourceInfo = sourceInfo; + } + return BoundElementOrDirectiveProperty; + })(); + function splitClasses(classAttrValue) { + return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); + } + exports.splitClasses = splitClasses; + var Component = (function() { + function Component(ngContentIndexMatcher, wildcardNgContentIndex) { + this.ngContentIndexMatcher = ngContentIndexMatcher; + this.wildcardNgContentIndex = wildcardNgContentIndex; + } + Component.create = function(directives) { + if (directives.length === 0 || !directives[0].directive.isComponent) { + return EMPTY_COMPONENT; + } + var matcher = new selector_1.SelectorMatcher(); + var ngContentSelectors = directives[0].directive.template.ngContentSelectors; + var wildcardNgContentIndex = null; + for (var i = 0; i < ngContentSelectors.length; i++) { + var selector = ngContentSelectors[i]; + if (lang_1.StringWrapper.equals(selector, '*')) { + wildcardNgContentIndex = i; + } else { + matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); + } + } + return new Component(matcher, wildcardNgContentIndex); + }; + Component.prototype.findNgContentIndex = function(selector) { + var ngContentIndices = []; + this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { + ngContentIndices.push(ngContentIndex); + }); + collection_1.ListWrapper.sort(ngContentIndices); + if (lang_1.isPresent(this.wildcardNgContentIndex)) { + ngContentIndices.push(this.wildcardNgContentIndex); + } + return ngContentIndices.length > 0 ? ngContentIndices[0] : null; + }; + return Component; + })(); + function createElementCssSelector(elementName, matchableAttrs) { + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(elementName); + for (var i = 0; i < matchableAttrs.length; i++) { + var attrName = matchableAttrs[i][0].toLowerCase(); + var attrValue = matchableAttrs[i][1]; + cssSelector.addAttribute(attrName, attrValue); + if (attrName == CLASS_ATTR) { + var classes = splitClasses(attrValue); + classes.forEach(function(className) { + return cssSelector.addClassName(className); + }); + } + } + return cssSelector; + } + var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); + var NON_BINDABLE_VISITOR = new NonBindableVisitor(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/core/dom/generic_browser_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var generic_browser_adapter_1 = require("angular2/src/core/dom/generic_browser_adapter"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var DOM_KEY_LOCATION_NUMPAD = 3; + var _keyMap = { + '\b': 'Backspace', + '\t': 'Tab', + '\x7F': 'Delete', + '\x1B': 'Escape', + 'Del': 'Delete', + 'Esc': 'Escape', + 'Left': 'ArrowLeft', + 'Right': 'ArrowRight', + 'Up': 'ArrowUp', + 'Down': 'ArrowDown', + 'Menu': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'Win': 'OS' + }; + var _chromeNumKeyPadMap = { + 'A': '1', + 'B': '2', + 'C': '3', + 'D': '4', + 'E': '5', + 'F': '6', + 'G': '7', + 'H': '8', + 'I': '9', + 'J': '*', + 'K': '+', + 'M': '-', + 'N': '.', + 'O': '/', + '\x60': '0', + '\x90': 'NumLock' + }; + var BrowserDomAdapter = (function(_super) { + __extends(BrowserDomAdapter, _super); + function BrowserDomAdapter() { + _super.apply(this, arguments); + } + BrowserDomAdapter.prototype.parse = function(templateHtml) { + throw new Error("parse not implemented"); + }; + BrowserDomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); + }; + BrowserDomAdapter.prototype.hasProperty = function(element, name) { + return name in element; + }; + BrowserDomAdapter.prototype.setProperty = function(el, name, value) { + el[name] = value; + }; + BrowserDomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { + el[methodName].apply(el, args); + }; + BrowserDomAdapter.prototype.logError = function(error) { + if (window.console.error) { + window.console.error(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.log = function(error) { + window.console.log(error); + }; + BrowserDomAdapter.prototype.logGroup = function(error) { + if (window.console.group) { + window.console.group(error); + this.logError(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.logGroupEnd = function() { + if (window.console.groupEnd) { + window.console.groupEnd(); + } + }; + Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + BrowserDomAdapter.prototype.query = function(selector) { + return document.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelector = function(el, selector) { + return el.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { + return el.querySelectorAll(selector); + }; + BrowserDomAdapter.prototype.on = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + }; + BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + return function() { + el.removeEventListener(evt, listener, false); + }; + }; + BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { + el.dispatchEvent(evt); + }; + BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { + var evt = document.createEvent('MouseEvent'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.createEvent = function(eventType) { + var evt = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.preventDefault = function(evt) { + evt.preventDefault(); + evt.returnValue = false; + }; + BrowserDomAdapter.prototype.isPrevented = function(evt) { + return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + BrowserDomAdapter.prototype.getInnerHTML = function(el) { + return el.innerHTML; + }; + BrowserDomAdapter.prototype.getOuterHTML = function(el) { + return el.outerHTML; + }; + BrowserDomAdapter.prototype.nodeName = function(node) { + return node.nodeName; + }; + BrowserDomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + BrowserDomAdapter.prototype.type = function(node) { + return node.type; + }; + BrowserDomAdapter.prototype.content = function(node) { + if (this.hasProperty(node, "content")) { + return node.content; + } else { + return node; + } + }; + BrowserDomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + BrowserDomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + BrowserDomAdapter.prototype.parentElement = function(el) { + return el.parentNode; + }; + BrowserDomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + BrowserDomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + BrowserDomAdapter.prototype.clearNodes = function(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }; + BrowserDomAdapter.prototype.appendChild = function(el, node) { + el.appendChild(node); + }; + BrowserDomAdapter.prototype.removeChild = function(el, node) { + el.removeChild(node); + }; + BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { + el.replaceChild(newChild, oldChild); + }; + BrowserDomAdapter.prototype.remove = function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + return node; + }; + BrowserDomAdapter.prototype.insertBefore = function(el, node) { + el.parentNode.insertBefore(node, el); + }; + BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { + nodes.forEach(function(n) { + return el.parentNode.insertBefore(n, el); + }); + }; + BrowserDomAdapter.prototype.insertAfter = function(el, node) { + el.parentNode.insertBefore(node, el.nextSibling); + }; + BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { + el.innerHTML = value; + }; + BrowserDomAdapter.prototype.getText = function(el) { + return el.textContent; + }; + BrowserDomAdapter.prototype.setText = function(el, value) { + el.textContent = value; + }; + BrowserDomAdapter.prototype.getValue = function(el) { + return el.value; + }; + BrowserDomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + BrowserDomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + BrowserDomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + BrowserDomAdapter.prototype.createComment = function(text) { + return document.createComment(text); + }; + BrowserDomAdapter.prototype.createTemplate = function(html) { + var t = document.createElement('template'); + t.innerHTML = html; + return t; + }; + BrowserDomAdapter.prototype.createElement = function(tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElement(tagName); + }; + BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElementNS(ns, tagName); + }; + BrowserDomAdapter.prototype.createTextNode = function(text, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createTextNode(text); + }; + BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { + if (doc === void 0) { + doc = document; + } + var el = doc.createElement('SCRIPT'); + el.setAttribute(attrName, attrValue); + return el; + }; + BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { + if (doc === void 0) { + doc = document; + } + var style = doc.createElement('style'); + this.appendChild(style, this.createTextNode(css)); + return style; + }; + BrowserDomAdapter.prototype.createShadowRoot = function(el) { + return el.createShadowRoot(); + }; + BrowserDomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + BrowserDomAdapter.prototype.getHost = function(el) { + return el.host; + }; + BrowserDomAdapter.prototype.clone = function(node) { + return node.cloneNode(true); + }; + BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { + return element.getElementsByClassName(name); + }; + BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { + return element.getElementsByTagName(name); + }; + BrowserDomAdapter.prototype.classList = function(element) { + return Array.prototype.slice.call(element.classList, 0); + }; + BrowserDomAdapter.prototype.addClass = function(element, classname) { + element.classList.add(classname); + }; + BrowserDomAdapter.prototype.removeClass = function(element, classname) { + element.classList.remove(classname); + }; + BrowserDomAdapter.prototype.hasClass = function(element, classname) { + return element.classList.contains(classname); + }; + BrowserDomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + element.style[stylename] = stylevalue; + }; + BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { + element.style[stylename] = null; + }; + BrowserDomAdapter.prototype.getStyle = function(element, stylename) { + return element.style[stylename]; + }; + BrowserDomAdapter.prototype.tagName = function(element) { + return element.tagName; + }; + BrowserDomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = element.attributes; + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.hasAttribute(attribute); + }; + BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { + return element.getAttribute(attribute); + }; + BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { + element.setAttribute(name, value); + }; + BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { + element.setAttributeNS(ns, name, value); + }; + BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { + element.removeAttribute(attribute); + }; + BrowserDomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + BrowserDomAdapter.prototype.createHtmlDocument = function() { + return document.implementation.createHTMLDocument('fakeTitle'); + }; + BrowserDomAdapter.prototype.defaultDoc = function() { + return document; + }; + BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { + try { + return el.getBoundingClientRect(); + } catch (e) { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; + } + }; + BrowserDomAdapter.prototype.getTitle = function() { + return document.title; + }; + BrowserDomAdapter.prototype.setTitle = function(newTitle) { + document.title = newTitle || ''; + }; + BrowserDomAdapter.prototype.elementMatches = function(n, selector) { + var matches = false; + if (n instanceof HTMLElement) { + if (n.matches) { + matches = n.matches(selector); + } else if (n.msMatchesSelector) { + matches = n.msMatchesSelector(selector); + } else if (n.webkitMatchesSelector) { + matches = n.webkitMatchesSelector(selector); + } + } + return matches; + }; + BrowserDomAdapter.prototype.isTemplateElement = function(el) { + return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; + }; + BrowserDomAdapter.prototype.isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + BrowserDomAdapter.prototype.isCommentNode = function(node) { + return node.nodeType === Node.COMMENT_NODE; + }; + BrowserDomAdapter.prototype.isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + BrowserDomAdapter.prototype.hasShadowRoot = function(node) { + return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); + }; + BrowserDomAdapter.prototype.isShadowRoot = function(node) { + return node instanceof DocumentFragment; + }; + BrowserDomAdapter.prototype.importIntoDoc = function(node) { + var toImport = node; + if (this.isTemplateElement(node)) { + toImport = this.content(node); + } + return document.importNode(toImport, true); + }; + BrowserDomAdapter.prototype.adoptNode = function(node) { + return document.adoptNode(node); + }; + BrowserDomAdapter.prototype.getHref = function(el) { + return el.href; + }; + BrowserDomAdapter.prototype.getEventKey = function(event) { + var key = event.key; + if (lang_1.isBlank(key)) { + key = event.keyIdentifier; + if (lang_1.isBlank(key)) { + return 'Unidentified'; + } + if (key.startsWith('U+')) { + key = String.fromCharCode(parseInt(key.substring(2), 16)); + if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { + key = _chromeNumKeyPadMap[key]; + } + } + } + if (_keyMap.hasOwnProperty(key)) { + key = _keyMap[key]; + } + return key; + }; + BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return window; + } else if (target == "document") { + return document; + } else if (target == "body") { + return document.body; + } + }; + BrowserDomAdapter.prototype.getHistory = function() { + return window.history; + }; + BrowserDomAdapter.prototype.getLocation = function() { + return window.location; + }; + BrowserDomAdapter.prototype.getBaseHref = function() { + var href = getBaseElementHref(); + if (lang_1.isBlank(href)) { + return null; + } + return relativePath(href); + }; + BrowserDomAdapter.prototype.resetBaseElement = function() { + baseElement = null; + }; + BrowserDomAdapter.prototype.getUserAgent = function() { + return window.navigator.userAgent; + }; + BrowserDomAdapter.prototype.setData = function(element, name, value) { + this.setAttribute(element, 'data-' + name, value); + }; + BrowserDomAdapter.prototype.getData = function(element, name) { + return this.getAttribute(element, 'data-' + name); + }; + BrowserDomAdapter.prototype.getComputedStyle = function(element) { + return getComputedStyle(element); + }; + BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { + return window.requestAnimationFrame(callback); + }; + BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { + window.cancelAnimationFrame(id); + }; + BrowserDomAdapter.prototype.performanceNow = function() { + if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { + return window.performance.now(); + } else { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + } + }; + return BrowserDomAdapter; + })(generic_browser_adapter_1.GenericBrowserDomAdapter); + exports.BrowserDomAdapter = BrowserDomAdapter; + var baseElement = null; + function getBaseElementHref() { + if (lang_1.isBlank(baseElement)) { + baseElement = document.querySelector('base'); + if (lang_1.isBlank(baseElement)) { + return null; + } + } + return baseElement.getAttribute('href'); + } + var urlParsingNode = null; + function relativePath(url) { + if (lang_1.isBlank(urlParsingNode)) { + urlParsingNode = document.createElement("a"); + } + urlParsingNode.setAttribute('href', url); + return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/angular2", "angular2/src/core/application_common", "angular2/src/core/application_ref", "angular2/src/compiler/compiler", "angular2/src/facade/async", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/upgrade/metadata"); + var util_1 = require("angular2/src/upgrade/util"); + var constants_1 = require("angular2/src/upgrade/constants"); + var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter"); + var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter"); + var angular = require("angular2/src/upgrade/angular_js"); + var upgradeCount = 0; + var UpgradeAdapter = (function() { + function UpgradeAdapter() { + this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_"; + this.upgradedComponents = []; + this.downgradedComponents = {}; + this.providers = []; + } + UpgradeAdapter.prototype.downgradeNg2Component = function(type) { + this.upgradedComponents.push(type); + var info = metadata_1.getComponentInfo(type); + return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c"); + }; + UpgradeAdapter.prototype.upgradeNg1Component = function(name) { + if (this.downgradedComponents.hasOwnProperty(name)) { + return this.downgradedComponents[name].type; + } else { + return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type; + } + }; + UpgradeAdapter.prototype.bootstrap = function(element, modules, config) { + var _this = this; + var upgrade = new UpgradeAdapterRef(); + var ng1Injector = null; + var platformRef = angular2_1.platform(); + var applicationRef = platformRef.application([application_ref_1.applicationCommonProviders(), application_common_1.applicationDomProviders(), compiler_1.compilerProviders(), angular2_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() { + return ng1Injector; + }}), angular2_1.provide(constants_1.NG1_COMPILE, {useFactory: function() { + return ng1Injector.get(constants_1.NG1_COMPILE); + }}), this.providers]); + var injector = applicationRef.injector; + var ngZone = injector.get(angular2_1.NgZone); + var compiler = injector.get(angular2_1.Compiler); + var delayApplyExps = []; + var original$applyFn; + var rootScopePrototype; + var rootScope; + var protoViewRefMap = {}; + var ng1Module = angular.module(this.idPrefix, modules); + var ng1compilePromise = null; + ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(angular2_1.AppViewManager)).config(['$provide', function(provide) { + provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) { + rootScopePrototype = rootScopeDelegate.constructor.prototype; + if (rootScopePrototype.hasOwnProperty('$apply')) { + original$applyFn = rootScopePrototype.$apply; + rootScopePrototype.$apply = function(exp) { + return delayApplyExps.push(exp); + }; + } else { + throw new Error("Failed to find '$apply' on '$rootScope'!"); + } + return rootScope = rootScopeDelegate; + }]); + }]).run(['$injector', '$rootScope', function(injector, rootScope) { + ng1Injector = injector; + async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) { + ngZone.run(function() { + return rootScope.$apply(); + }); + }); + ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector); + }]); + angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector); + ngZone.run(function() { + angular.bootstrap(element, [_this.idPrefix], config); + }); + Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() { + ngZone.run(function() { + if (rootScopePrototype) { + rootScopePrototype.$apply = original$applyFn; + while (delayApplyExps.length) { + rootScope.$apply(delayApplyExps.shift()); + } + upgrade._bootstrapDone(applicationRef, ng1Injector); + rootScopePrototype = null; + } + }); + }, util_1.onError); + return upgrade; + }; + UpgradeAdapter.prototype.addProvider = function(provider) { + this.providers.push(provider); + }; + UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) { + var token = options && options.asToken || name; + this.providers.push(angular2_1.provide(token, { + useFactory: function(ng1Injector) { + return ng1Injector.get(name); + }, + deps: [constants_1.NG1_INJECTOR] + })); + }; + UpgradeAdapter.prototype.downgradeNg2Provider = function(token) { + var factory = function(injector) { + return injector.get(token); + }; + factory.$inject = [constants_1.NG2_INJECTOR]; + return factory; + }; + UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) { + var _this = this; + var promises = []; + var types = this.upgradedComponents; + for (var i = 0; i < types.length; i++) { + promises.push(compiler.compileInHost(types[i])); + } + return Promise.all(promises).then(function(protoViews) { + var types = _this.upgradedComponents; + for (var i = 0; i < protoViews.length; i++) { + protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i]; + } + return protoViewRefMap; + }, util_1.onError); + }; + return UpgradeAdapter; + })(); + exports.UpgradeAdapter = UpgradeAdapter; + function ng1ComponentDirective(info, idPrefix) { + directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE]; + function directiveFactory(protoViewRefMap, viewManager, parse) { + var protoView = protoViewRefMap[info.selector]; + if (!protoView) + throw new Error('Expecting ProtoViewRef for: ' + info.selector); + var idCount = 0; + return { + restrict: 'E', + require: constants_1.REQUIRE_INJECTOR, + link: {post: function(scope, element, attrs, parentInjector, transclude) { + var domElement = element[0]; + var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView); + facade.setupInputs(); + facade.bootstrapNg2(); + facade.projectContent(); + facade.setupOutputs(); + facade.registerCleanup(); + }} + }; + } + return directiveFactory; + } + var UpgradeAdapterRef = (function() { + function UpgradeAdapterRef() { + this._readyFn = null; + this.ng1RootScope = null; + this.ng1Injector = null; + this.ng2ApplicationRef = null; + this.ng2Injector = null; + } + UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) { + this.ng2ApplicationRef = applicationRef; + this.ng2Injector = applicationRef.injector; + this.ng1Injector = ng1Injector; + this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE); + this._readyFn && this._readyFn(this); + }; + UpgradeAdapterRef.prototype.ready = function(fn) { + this._readyFn = fn; + }; + UpgradeAdapterRef.prototype.dispose = function() { + this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy(); + this.ng2ApplicationRef.dispose(); + }; + return UpgradeAdapterRef; + })(); + exports.UpgradeAdapterRef = UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/linker/template_commands", "angular2/src/compiler/directive_metadata", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/command_compiler", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var di_1 = require("angular2/src/core/di"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var command_compiler_2 = require("angular2/src/compiler/command_compiler"); + var util_1 = require("angular2/src/compiler/util"); + var TemplateCompiler = (function() { + function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _commandCompiler, _cdCompiler) { + this._runtimeMetadataResolver = _runtimeMetadataResolver; + this._templateNormalizer = _templateNormalizer; + this._templateParser = _templateParser; + this._styleCompiler = _styleCompiler; + this._commandCompiler = _commandCompiler; + this._cdCompiler = _cdCompiler; + this._hostCacheKeys = new Map(); + this._compiledTemplateCache = new Map(); + this._compiledTemplateDone = new Map(); + this._nextTemplateId = 0; + } + TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { + if (!directive.isComponent) { + return async_1.PromiseWrapper.resolve(directive); + } + return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { + return new directive_metadata_1.CompileDirectiveMetadata({ + type: directive.type, + isComponent: directive.isComponent, + dynamicLoadable: directive.dynamicLoadable, + selector: directive.selector, + exportAs: directive.exportAs, + changeDetection: directive.changeDetection, + inputs: directive.inputs, + outputs: directive.outputs, + hostListeners: directive.hostListeners, + hostProperties: directive.hostProperties, + hostAttributes: directive.hostAttributes, + lifecycleHooks: directive.lifecycleHooks, + template: normalizedTemplate + }); + }); + }; + TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { + var hostCacheKey = this._hostCacheKeys.get(type); + if (lang_1.isBlank(hostCacheKey)) { + hostCacheKey = new Object(); + this._hostCacheKeys.set(type, hostCacheKey); + var compMeta = this._runtimeMetadataResolver.getMetadata(type); + assertComponent(compMeta); + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], new Set()); + } + return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { + return new template_commands_1.CompiledHostTemplate(compiledTemplate); + }); + }; + TemplateCompiler.prototype.clearCache = function() { + this._hostCacheKeys.clear(); + this._styleCompiler.clearCache(); + this._compiledTemplateCache.clear(); + this._compiledTemplateDone.clear(); + }; + TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, compilingComponentCacheKeys) { + var _this = this; + var compiledTemplate = this._compiledTemplateCache.get(cacheKey); + var done = this._compiledTemplateDone.get(cacheKey); + if (lang_1.isBlank(compiledTemplate)) { + var styles = []; + var changeDetectorFactory; + var commands = []; + var templateId = lang_1.stringify(compMeta.type.runtime) + "Template" + this._nextTemplateId++; + compiledTemplate = new template_commands_1.CompiledComponentTemplate(templateId, function(dispatcher) { + return changeDetectorFactory(dispatcher); + }, commands, styles); + this._compiledTemplateCache.set(cacheKey, compiledTemplate); + compilingComponentCacheKeys.add(cacheKey); + done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(viewDirectives.map(function(dirMeta) { + return _this.normalizeDirectiveMetadata(dirMeta); + }))).then(function(stylesAndNormalizedViewDirMetas) { + var childPromises = []; + var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); + var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, compMeta.type.name); + var changeDetectorFactories = _this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); + changeDetectorFactory = changeDetectorFactories[0]; + var tmpStyles = stylesAndNormalizedViewDirMetas[0]; + tmpStyles.forEach(function(style) { + return styles.push(style); + }); + var tmpCommands = _this._compileCommandsRuntime(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises); + tmpCommands.forEach(function(cmd) { + return commands.push(cmd); + }); + return async_1.PromiseWrapper.all(childPromises); + }).then(function(_) { + collection_1.SetWrapper.delete(compilingComponentCacheKeys, cacheKey); + return compiledTemplate; + }); + this._compiledTemplateDone.set(cacheKey, done); + } + return compiledTemplate; + }; + TemplateCompiler.prototype._compileCommandsRuntime = function(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises) { + var _this = this; + var cmds = this._commandCompiler.compileComponentRuntime(compMeta, parsedTemplate, changeDetectorFactories, function(childComponentDir) { + var childCacheKey = childComponentDir.type.runtime; + var childViewDirectives = _this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); + var childIsRecursive = collection_1.SetWrapper.has(compilingComponentCacheKeys, childCacheKey); + var childTemplate = _this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, compilingComponentCacheKeys); + if (!childIsRecursive) { + childPromises.push(_this._compiledTemplateDone.get(childCacheKey)); + } + return function() { + return childTemplate; + }; + }); + cmds.forEach(function(cmd) { + if (cmd instanceof template_commands_1.BeginComponentCmd) { + cmd.templateGetter(); + } + }); + return cmds; + }; + TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { + var _this = this; + if (components.length === 0) { + throw new exceptions_1.BaseException('No components given'); + } + var declarations = []; + var templateArguments = []; + var componentMetas = []; + components.forEach(function(componentWithDirs) { + var compMeta = componentWithDirs.component; + assertComponent(compMeta); + componentMetas.push(compMeta); + _this._processTemplateCodeGen(compMeta, componentWithDirs.directives, declarations, templateArguments); + if (compMeta.dynamicLoadable) { + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + componentMetas.push(hostMeta); + _this._processTemplateCodeGen(hostMeta, [compMeta], declarations, templateArguments); + } + }); + collection_1.ListWrapper.forEachWithIndex(componentMetas, function(compMeta, index) { + var templateId = compMeta.type.moduleUrl + "|" + compMeta.type.name; + var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; + var compiledTemplateExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledComponentTemplate('" + templateId + "'," + templateArguments[index].join(',') + ")"; + var variableValueExpr; + if (compMeta.type.isHost) { + variableValueExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledHostTemplate(" + compiledTemplateExpr + ")"; + } else { + variableValueExpr = compiledTemplateExpr; + } + var varName = templateVariableName(compMeta.type); + declarations.push("" + util_1.codeGenExportVariable(varName) + variableValueExpr + ";"); + declarations.push(util_1.codeGenValueFn([], varName, templateGetterName(compMeta.type)) + ";"); + }); + var moduleUrl = components[0].component.type.moduleUrl; + return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); + }; + TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); + }; + TemplateCompiler.prototype._processTemplateCodeGen = function(compMeta, directives, targetDeclarations, targetTemplateArguments) { + var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); + var parsedTemplate = this._templateParser.parse(compMeta.template.template, directives, compMeta.type.name); + var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); + var commandsExpr = this._commandCompiler.compileComponentCodeGen(compMeta, parsedTemplate, changeDetectorsExprs.expressions, codeGenComponentTemplateFactory); + addAll(styleExpr.declarations, targetDeclarations); + addAll(changeDetectorsExprs.declarations, targetDeclarations); + addAll(commandsExpr.declarations, targetDeclarations); + targetTemplateArguments.push([changeDetectorsExprs.expressions[0], commandsExpr.expression, styleExpr.expression]); + }; + TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler])], TemplateCompiler); + return TemplateCompiler; + })(); + exports.TemplateCompiler = TemplateCompiler; + var NormalizedComponentWithViewDirectives = (function() { + function NormalizedComponentWithViewDirectives(component, directives) { + this.component = component; + this.directives = directives; + } + return NormalizedComponentWithViewDirectives; + })(); + exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; + function assertComponent(meta) { + if (!meta.isComponent) { + throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); + } + } + function templateVariableName(type) { + return type.name + "Template"; + } + function templateGetterName(type) { + return templateVariableName(type) + "Getter"; + } + function templateModuleUrl(moduleUrl) { + var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); + return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; + } + function addAll(source, target) { + for (var i = 0; i < source.length; i++) { + target.push(source[i]); + } + } + function codeGenComponentTemplateFactory(nestedCompType) { + return "" + source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + templateGetterName(nestedCompType.type); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_common", ["angular2/src/common/forms", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/dom/browser_adapter", "angular2/src/core/testability/browser_testability", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr", "angular2/src/compiler/xhr_impl", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/events/key_events", "angular2/src/core/render/dom/events/hammer_gestures", "angular2/src/core/testability/testability", "angular2/src/core/render/api", "angular2/src/core/render/render", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/platform_bindings", "angular2/src/animate/animation_builder", "angular2/src/animate/browser_details", "angular2/src/core/profile/wtf_init", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var forms_1 = require("angular2/src/common/forms"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var browser_testability_1 = require("angular2/src/core/testability/browser_testability"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var key_events_1 = require("angular2/src/core/render/dom/events/key_events"); + var hammer_gestures_1 = require("angular2/src/core/render/dom/events/hammer_gestures"); + var testability_1 = require("angular2/src/core/testability/testability"); + var api_1 = require("angular2/src/core/render/api"); + var render_1 = require("angular2/src/core/render/render"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var platform_bindings_1 = require("angular2/src/core/platform_bindings"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); + var application_ref_1 = require("angular2/src/core/application_ref"); + function applicationDomProviders() { + if (lang_1.isBlank(dom_adapter_1.DOM)) { + throw "Must set a root DOM adapter first."; + } + return [di_1.provide(render_1.DOCUMENT, {useValue: dom_adapter_1.DOM.defaultDoc()}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: key_events_1.KeyEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: hammer_gestures_1.HammerGesturesPlugin, + multi: true + }), di_1.provide(render_1.DomRenderer, {useClass: render_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), shared_styles_host_1.DomSharedStylesHost, di_1.provide(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), platform_bindings_1.EXCEPTION_PROVIDER, di_1.provide(xhr_1.XHR, {useValue: new xhr_impl_1.XHRImpl()}), testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, forms_1.FORM_PROVIDERS]; + } + exports.applicationDomProviders = applicationDomProviders; + function platform(providers) { + return application_ref_1.platformCommon(providers, function() { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + wtf_init_1.wtfInit(); + browser_testability_1.BrowserGetTestability.init(); + }); + } + exports.platform = platform; + function commonBootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var p = platform(); + var bindings = [application_ref_1.applicationCommonProviders(), applicationDomProviders()]; + if (lang_1.isPresent(appProviders)) { + bindings.push(appProviders); + } + return p.application(bindings).bootstrap(appComponentType); + } + exports.commonBootstrap = commonBootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter"); + exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter; + exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/proto_view_factory", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var compiler_1 = require("angular2/src/core/linker/compiler"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + var di_1 = require("angular2/src/core/di"); + var RuntimeCompiler = (function(_super) { + __extends(RuntimeCompiler, _super); + function RuntimeCompiler() { + _super.apply(this, arguments); + } + return RuntimeCompiler; + })(compiler_1.Compiler); + exports.RuntimeCompiler = RuntimeCompiler; + var RuntimeCompiler_ = (function(_super) { + __extends(RuntimeCompiler_, _super); + function RuntimeCompiler_(_protoViewFactory, _templateCompiler) { + _super.call(this, _protoViewFactory); + this._templateCompiler = _templateCompiler; + } + RuntimeCompiler_.prototype.compileInHost = function(componentType) { + var _this = this; + return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(compiledHostTemplate) { + return compiler_1.internalCreateProtoView(_this, compiledHostTemplate); + }); + }; + RuntimeCompiler_.prototype.clearCache = function() { + _super.prototype.clearCache.call(this); + this._templateCompiler.clearCache(); + }; + RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory, template_compiler_1.TemplateCompiler])], RuntimeCompiler_); + return RuntimeCompiler_; + })(compiler_1.Compiler_); + exports.RuntimeCompiler_ = RuntimeCompiler_; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/compiler/app_root_url", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + exports.TemplateCompiler = template_compiler_1.TemplateCompiler; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; + exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; + exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; + var source_module_1 = require("angular2/src/compiler/source_module"); + exports.SourceModule = source_module_1.SourceModule; + exports.SourceWithImports = source_module_1.SourceWithImports; + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; + exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_compiler_2 = require("angular2/src/compiler/template_compiler"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); + function compilerProviders() { + return [change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_1.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler, di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true)}), template_compiler_2.TemplateCompiler, di_1.provide(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), di_1.provide(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), url_resolver_1.UrlResolver]; + } + exports.compilerProviders = compilerProviders; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application", ["angular2/src/facade/lang", "angular2/src/compiler/compiler", "angular2/src/core/application_common", "angular2/src/core/application_tokens", "angular2/src/core/application_common", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT; + exports.APP_ID = application_tokens_1.APP_ID; + var application_common_2 = require("angular2/src/core/application_common"); + exports.platform = application_common_2.platform; + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.PlatformRef = application_ref_1.PlatformRef; + exports.ApplicationRef = application_ref_1.ApplicationRef; + exports.applicationCommonProviders = application_ref_1.applicationCommonProviders; + exports.createNgZone = application_ref_1.createNgZone; + exports.platformCommon = application_ref_1.platformCommon; + exports.platformProviders = application_ref_1.platformProviders; + function bootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var providers = [compiler_1.compilerProviders()]; + if (lang_1.isPresent(appProviders)) { + providers.push(appProviders); + } + return application_common_1.commonBootstrap(appComponentType, providers); + } + exports.bootstrap = bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/di", "angular2/src/common/pipes", "angular2/src/facade/facade", "angular2/src/core/application", "angular2/src/core/bootstrap", "angular2/src/core/services", "angular2/src/core/linker", "angular2/src/core/application_ref", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/core/debug", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/dev_mode"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/metadata")); + __export(require("angular2/src/core/util")); + __export(require("angular2/src/core/di")); + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/application")); + __export(require("angular2/src/core/bootstrap")); + __export(require("angular2/src/core/services")); + __export(require("angular2/src/core/linker")); + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.ApplicationRef = application_ref_1.ApplicationRef; + __export(require("angular2/src/core/zone")); + __export(require("angular2/src/core/render")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/core/debug")); + __export(require("angular2/src/core/change_detection")); + __export(require("angular2/src/core/platform_directives_and_pipes")); + __export(require("angular2/src/core/dev_mode")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/angular2", ["angular2/common", "angular2/core", "angular2/profile", "angular2/lifecycle_hooks", "angular2/bootstrap", "angular2/upgrade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/common")); + __export(require("angular2/core")); + __export(require("angular2/profile")); + __export(require("angular2/lifecycle_hooks")); + __export(require("angular2/bootstrap")); + __export(require("angular2/upgrade")); + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=angular2.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/angular2.min.js b/2.0.0-alpha.46/angular2.min.js new file mode 100644 index 0000000000..1834ceea21 --- /dev/null +++ b/2.0.0-alpha.46/angular2.min.js @@ -0,0 +1,26 @@ +!function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s-1;if(s&&!a){var c=Promise.resolve();o._setScheduler(function(e){c.then(e)})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":17}],5:[function(e,t,r){(function(r){"use strict";function n(){i.patchSetClearFunction(r,["timeout","interval","immediate"]),i.patchRequestAnimationFrame(r,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame"]),i.patchFunction(r,["alert","prompt"]),u.apply(),l.apply(),o.apply(),s.patchClass("MutationObserver"),s.patchClass("WebKitMutationObserver"),a.apply(),c.apply(),p.apply(),f.apply()}var i=e("./functions"),o=e("./promise"),s=e("./mutation-observer"),a=e("./define-property"),c=e("./register-element"),u=(e("./websocket"),e("./event-target")),l=e("./property-descriptor"),p=e("./geolocation"),f=e("./file-reader");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(e,t,r){"use strict";function n(){Object.defineProperty=function(e,t,r){if(o(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);return"prototype"!==t&&(r=s(e,t,r)),c(e,t,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(r){Object.defineProperty(e,r,t[r])}),e},Object.create=function(e,t){return"object"==typeof t&&Object.keys(t).forEach(function(r){t[r]=s(e,r,t[r])}),l(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var r=u(e,t);return o(e,t)&&(r.configurable=!1),r}}function i(e,t,r){return r=s(e,t,r),c(e,t,r)}function o(e,t){return e&&e[p]&&e[p][t]}function s(e,t,r){return r.configurable=!0,r.configurable||(e[p]||c(e,p,{writable:!0,value:{}}),e[p][t]=!0),r}var a=e("../keys"),c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l=Object.create,p=a.create("unconfigurables");t.exports={apply:n,_redefineProperty:i}},{"../keys":3}],7:[function(e,t,r){(function(r){"use strict";function n(){if(r.EventTarget)i.patchEventTargetMethods(r.EventTarget.prototype);else{var e=["ApplicationCache","EventSource","FileReader","InputMethodContext","MediaController","MessagePort","Node","Performance","SVGElementInstance","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebKitNamedFlow","Worker","WorkerGlobalScope","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];e.forEach(function(e){var t=r[e]&&r[e].prototype;t&&t.addEventListener&&i.patchEventTargetMethods(t)}),"undefined"!=typeof window&&i.patchEventTargetMethods(window)}}var i=e("../utils");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],8:[function(e,t,r){"use strict";function n(){i.patchClass("FileReader")}var i=e("../utils");t.exports={apply:n}},{"../utils":16}],9:[function(e,t,r){(function(r){"use strict";function n(e,t){t.map(function(e){return e[0].toUpperCase()+e.substr(1)}).forEach(function(t){var n="set"+t,i=e[n];if(i){var o="clear"+t,s={},c="setInterval"===n?a.bindArguments:a.bindArgumentsOnce;r.zone[n]=function(t){var r,n=t;arguments[0]=function(){return delete s[r],n.apply(this,arguments)};var o=c(arguments);return r=i.apply(e,o),s[r]=!0,r},e[n]=function(){return r.zone[n].apply(this,arguments)};var u=e[o];r.zone[o]=function(e){return s[e]&&(delete s[e],r.zone.dequeueTask()),u.apply(this,arguments)},e[o]=function(){return r.zone[o].apply(this,arguments)}}})}function i(e,t){t.forEach(function(t){var n=e[t];n&&(r.zone[t]=function(t){var i=r.zone.isRootZone()?r.zone.fork():r.zone;return t&&(arguments[0]=function(){return i.run(t,this,arguments)}),n.apply(e,arguments)},e[t]=function(){return r.zone[t].apply(this,arguments)})})}function o(e,t){t.forEach(function(t){var n=e[t];n&&(r.zone[t]=function(t){arguments[0]=function(){return t.apply(this,arguments)};var r=a.bindArgumentsOnce(arguments);return n.apply(e,r)},e[t]=function(){return zone[t].apply(this,arguments)})})}function s(e,t){t.forEach(function(t){var n=e[t];r.zone[t]=function(){return n.apply(e,arguments)},e[t]=function(){return r.zone[t].apply(this,arguments)}})}var a=e("../utils");t.exports={patchSetClearFunction:n,patchSetFunction:o,patchRequestAnimationFrame:i,patchFunction:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],10:[function(e,t,r){(function(r){"use strict";function n(){r.navigator&&r.navigator.geolocation&&i.patchPrototype(r.navigator.geolocation,["getCurrentPosition","watchPosition"])}var i=e("../utils");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],11:[function(e,t,r){(function(r){"use strict";function n(e){var t=r[e];if(t){r[e]=function(e){this[o]=new t(r.zone.bind(e,!0)),this[s]=r.zone};var n=new t(function(){});r[e].prototype.disconnect=function(){var e=this[o].disconnect.apply(this[o],arguments);return this[a]&&(this[s].dequeueTask(),this[a]=!1),e},r[e].prototype.observe=function(){return this[a]||(this[s].enqueueTask(),this[a]=!0),this[o].observe.apply(this[o],arguments)};var i;for(i in n)!function(t){void 0===typeof r[e].prototype&&("function"==typeof n[t]?r[e].prototype[t]=function(){return this[o][t].apply(this[o],arguments)}:Object.defineProperty(r[e].prototype,t,{set:function(e){"function"==typeof e?this[o][t]=r.zone.bind(e):this[o][t]=e},get:function(){return this[o][t]}}))}(i)}}var i=e("../keys"),o=i.create("originalInstance"),s=i.create("creationZone"),a=i.create("isActive");t.exports={patchClass:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../keys":3}],12:[function(e,t,r){(function(r){"use strict";function n(e,t){var n=r,i=e.every(function(e){return n=n[e]});i&&t.forEach(function(e){var t=n[e];t&&(n[e]=s(t))})}function i(e){var t=e.then;e.then=function(){var r=a.bindArguments(arguments),n=t.apply(e,r);return i(n)};var r=e["catch"];return e["catch"]=function(){var t=a.bindArguments(arguments),n=r.apply(e,t);return i(n)},e}function o(){if(r.Promise){a.patchPrototype(Promise.prototype,["then","catch"]);var e=[[[],["fetch"]],[["Response","prototype"],["arrayBuffer","blob","json","text"]]];e.forEach(function(e){n(e[0],e[1])})}}var s,a=e("../utils");s=r.Promise?function(e){return function(){var t=e.apply(this,arguments);return t instanceof Promise?t:new Promise(function(e,r){t.then(e,r)})}}:function(e){return function(){return i(e.apply(this,arguments))}},t.exports={apply:o,bindPromiseFn:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],13:[function(e,t,r){(function(r){"use strict";function n(){if(!a.isWebWorker()){var e="undefined"!=typeof WebSocket;if(i()){var t=u.map(function(e){return"on"+e});a.patchProperties(HTMLElement.prototype,t),a.patchProperties(XMLHttpRequest.prototype),e&&a.patchProperties(WebSocket.prototype)}else o(),a.patchClass("XMLHttpRequest"),e&&s.apply()}}function i(){if(!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(HTMLElement.prototype,"onclick",{get:function(){return!0}});var t=document.createElement("div"),r=!!t.onclick;return Object.defineProperty(HTMLElement.prototype,"onclick",{}),r}function o(){u.forEach(function(e){var t="on"+e;document.addEventListener(e,function(e){for(var n,i=e.target;i;)i[t]&&!i[t][l]&&(n=r.zone.bind(i[t]),n[l]=i[t],i[t]=n),i=i.parentElement},!0)})}var s=e("./websocket"),a=e("../utils"),c=e("../keys"),u="copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror".split(" "),l=c.create("unbound");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(e,t,r){(function(r){"use strict";function n(){if(!o.isWebWorker()&&"registerElement"in r.document){var e=document.registerElement,t=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(n,o){return o&&o.prototype&&t.forEach(function(e){if(o.prototype.hasOwnProperty(e)){var t=Object.getOwnPropertyDescriptor(o.prototype,e);t&&t.value?(t.value=r.zone.bind(t.value),i(o.prototype,e,t)):o.prototype[e]=r.zone.bind(o.prototype[e])}else o.prototype[e]&&(o.prototype[e]=r.zone.bind(o.prototype[e]))}),e.apply(document,[n,o])}}}var i=e("./define-property")._redefineProperty,o=e("../utils");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16,"./define-property":6}],15:[function(e,t,r){(function(r){"use strict";function n(){var e=r.WebSocket;i.patchEventTargetMethods(e.prototype),r.WebSocket=function(t,r){var n,o=arguments.length>1?new e(t,r):new e(t),s=Object.getOwnPropertyDescriptor(o,"onmessage");return s&&s.configurable===!1?(n=Object.create(o),["addEventListener","removeEventListener","send","close"].forEach(function(e){n[e]=function(){return o[e].apply(o,arguments)}})):n=o,i.patchProperties(n,["onclose","onerror","onmessage","onopen"]),n}}var i=e("../utils");t.exports={apply:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],16:[function(e,t,r){(function(r){"use strict";function n(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=r.zone.bind(e[t]));return e}function i(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=r.zone.bindOnce(e[t]));return e}function o(e,t){t.forEach(function(t){var r=e[t];r&&(e[t]=function(){return r.apply(this,n(arguments))})})}function s(){return"undefined"==typeof document}function a(e,t){var r=Object.getOwnPropertyDescriptor(e,t)||{enumerable:!0,configurable:!0};delete r.writable,delete r.value;var n=t.substr(2),i="_"+t;r.set=function(e){this[i]&&this.removeEventListener(n,this[i]),"function"==typeof e?(this[i]=e,this.addEventListener(n,e,!1)):this[i]=null},r.get=function(){return this[i]},Object.defineProperty(e,t,r)}function c(e,t){(t||function(){var t=[];for(var r in e)t.push(r);return t}().filter(function(e){return"on"===e.substr(0,2)})).forEach(function(t){a(e,t)})}function u(e){e[p.common.addEventListener]=e.addEventListener,e.addEventListener=function(e,t,n){var i,o=e+(n?"$capturing":"$bubbling");"[object FunctionWrapper]"!==t.toString()&&(i=t.handleEvent?function(e){return function(){e.handleEvent.apply(e,arguments)}}(t):t,t[f]=i,t[d]=t[d]||{},t[d][o]=t[d][o]||zone.bind(i),arguments[1]=t[d][o]);var s=this||r;return r.zone.addEventListener.apply(s,arguments)},e[p.common.removeEventListener]=e.removeEventListener,e.removeEventListener=function(e,t,n){var i=e+(n?"$capturing":"$bubbling");if(t[d]&&t[d][i]){var o=t[d];arguments[1]=o[i],delete o[i]}var s=this||r,a=r.zone.removeEventListener.apply(s,arguments);return r.zone.dequeueTask(t[f]),a}}function l(e){var t=r[e];if(t){r[e]=function(){var e=n(arguments);switch(e.length){case 0:this[h]=new t;break;case 1:this[h]=new t(e[0]);break;case 2:this[h]=new t(e[0],e[1]);break;case 3:this[h]=new t(e[0],e[1],e[2]);break;case 4:this[h]=new t(e[0],e[1],e[2],e[3]);break;default:throw new Error("what are you even doing?")}};var i,o=new t;for(i in o)!function(t){"function"==typeof o[t]?r[e].prototype[t]=function(){return this[h][t].apply(this[h],arguments)}:Object.defineProperty(r[e].prototype,t,{set:function(e){"function"==typeof e?this[h][t]=r.zone.bind(e):this[h][t]=e},get:function(){return this[h][t]}})}(i);for(i in t)"prototype"!==i&&t.hasOwnProperty(i)&&(r[e][i]=t[i])}}var p=e("./keys"),f=p.create("originalFn"),d=p.create("boundFns"),h=p.create("originalInstance");t.exports={bindArguments:n,bindArgumentsOnce:i,patchPrototype:o,patchProperty:a,patchProperties:c,patchEventTargetMethods:u,patchClass:l,isWebWorker:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":3}],17:[function(e,t,r){(function(r,n){(function(){"use strict";function i(e){return"function"==typeof e||"object"==typeof e&&null!==e}function o(e){return"function"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){G=e}function c(e){Q=e}function u(){return function(){r.nextTick(h)}}function l(){return function(){z(h)}}function p(){var e=0,t=new J(h),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(h,1)}}function h(){for(var e=0;$>e;e+=2){var t=te[e],r=te[e+1];t(r),te[e]=void 0,te[e+1]=void 0}$=0}function g(){try{var t=e,r=t("vertx");return z=r.runOnLoop||r.runOnContext,l()}catch(n){return d()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function _(e){try{return e.then}catch(t){return oe.error=t,oe}}function b(e,t,r,n){try{e.call(t,r,n)}catch(i){return i}}function x(e,t,r){Q(function(e){var n=!1,i=b(r,t,function(r){n||(n=!0,t!==r?C(e,r):E(e,r))},function(t){n||(n=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&i&&(n=!0,O(e,i))},e)}function w(e,t){t._state===ne?E(e,t._result):t._state===ie?O(e,t._result):P(t,void 0,function(t){C(e,t)},function(t){O(e,t)})}function j(e,t){if(t.constructor===e.constructor)w(e,t);else{var r=_(t);r===oe?O(e,oe.error):void 0===r?E(e,t):o(r)?x(e,t,r):E(e,t)}}function C(e,t){e===t?O(e,m()):i(t)?j(e,t):E(e,t)}function S(e){e._onerror&&e._onerror(e._result),R(e)}function E(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(R,e))}function O(e,t){e._state===re&&(e._state=ie,e._result=t,Q(S,e))}function P(e,t,r,n){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+ne]=r,i[o+ie]=n,0===o&&e._state&&Q(R,e)}function R(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,i,o=e._result,s=0;ss;s++)P(n.resolve(e[s]),void 0,t,r);return i}function V(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(v);return C(r,e),r}function B(e){var t=this,r=new t(v);return O(r,e),r}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function W(e){this._id=fe++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&(o(e)||L(),this instanceof W||F(),k(this,e))}function U(){var e;if("undefined"!=typeof n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=e.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(e.Promise=de)}var H;H=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var z,G,q,K=H,$=0,Q=({}.toString,function(e,t){te[$]=e,te[$+1]=t,$+=2,2===$&&(G?G(h):q())}),X="undefined"!=typeof window?window:void 0,Z=X||{},J=Z.MutationObserver||Z.WebKitMutationObserver,Y="undefined"!=typeof r&&"[object process]"==={}.toString.call(r),ee="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);q=Y?u():J?p():ee?f():void 0===X&&"function"==typeof e?g():d();var re=void 0,ne=1,ie=2,oe=new I,se=new I;A.prototype._validateInput=function(e){return K(e)},A.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},A.prototype._init=function(){this._result=new Array(this.length)};var ae=A;A.prototype._enumerate=function(){for(var e=this,t=e.length,r=e.promise,n=e._input,i=0;r._state===re&&t>i;i++)e._eachEntry(n[i],i)},A.prototype._eachEntry=function(e,t){var r=this,n=r._instanceConstructor;s(e)?e.constructor===n&&e._state!==re?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(n.resolve(e),t):(r._remaining--,r._result[t]=e)},A.prototype._settledAt=function(e,t,r){var n=this,i=n.promise;i._state===re&&(n._remaining--,e===ie?O(i,r):n._result[t]=r),0===n._remaining&&E(i,n._result)},A.prototype._willSettleAt=function(e,t){var r=this;P(e,void 0,function(e){r._settledAt(ne,t,e)},function(e){r._settledAt(ie,t,e)})};var ce=N,ue=M,le=V,pe=B,fe=0,de=W;W.all=ce,W.race=ue,W.resolve=le,W.reject=pe,W._setScheduler=a,W._setAsap=c,W._asap=Q,W.prototype={constructor:W,then:function(e,t){var r=this,n=r._state;if(n===ne&&!e||n===ie&&!t)return this;var i=new this.constructor(v),o=r._result;if(n){var s=arguments[n-1];Q(function(){D(n,i,s,o)})}else P(r,i,e,t);return i},"catch":function(e){return this.then(null,e)}};var he=U,ge={Promise:de,polyfill:he};"function"==typeof define&&define.amd?define(function(){return ge}):"undefined"!=typeof t&&t.exports?t.exports=ge:"undefined"!=typeof this&&(this.ES6Promise=ge),he()}).call(this)}).call(this,{},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]),function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s0)return!0;var i=M.get(t);return i["delete"](r),i.size>0?!0:(M["delete"](t),!0)}function p(e,t){for(var r=e.length-1;r>=0;--r){var n=e[r],i=n(t);if(!w(i)){if(!S(i))throw new TypeError;t=i}}return t}function f(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=e[i],s=o(t,r,n);if(!w(s)){if(!C(s))throw new TypeError;n=s}}return n}function d(e,t,r){for(var n=e.length-1;n>=0;--n){var i=e[n];i(t,r)}}function h(e,t,r){var n=M.get(e);if(!n){if(!r)return void 0;n=new k,M.set(e,n)}var i=n.get(t);if(!i){if(!r)return void 0;i=new k,n.set(t,i)}return i}function g(e,t,r){var n=v(e,t,r);if(n)return!0;var i=P(t);return null!==i?g(e,i,r):!1}function v(e,t,r){var n=h(t,r,!1);return void 0===n?!1:Boolean(n.has(e))}function m(e,t,r){var n=v(e,t,r);if(n)return y(e,t,r);var i=P(t);return null!==i?m(e,i,r):void 0}function y(e,t,r){var n=h(t,r,!1);return void 0===n?void 0:n.get(e)}function _(e,t,r,n){var i=h(r,n,!0);i.set(e,t)}function b(e,t){var r=x(e,t),n=P(e);if(null===n)return r;var i=b(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new A,s=[],a=0;a=0?(this._cache=e,!0):!1},get:function(e){var t=this._find(e);return t>=0?(this._cache=e,this._values[t]):void 0},set:function(e,t){return this["delete"](e),this._keys.push(e),this._values.push(t),this._cache=e,this},"delete":function(e){var r=this._find(e);return r>=0?(this._keys.splice(r,1),this._values.splice(r,1),this._cache=t,!0):!1},clear:function(){this._keys.length=0,this._values.length=0,this._cache=t},forEach:function(e,t){for(var r=this.size,n=0;r>n;++n){var i=this._keys[n],o=this._values[n];this._cache=i,e.call(this,o,i,this)}},_find:function(e){for(var t=this._keys,r=t.length,n=0;r>n;++n)if(t[n]===e)return n;return-1}},e}function I(){function e(){this._map=new k}return e.prototype={get size(){return this._map.length},has:function(e){return this._map.has(e)},add:function(e){return this._map.set(e,e),this},"delete":function(e){return this._map["delete"](e)},clear:function(){this._map.clear()},forEach:function(e,t){this._map.forEach(e,t)}},e}function T(){function e(){this._key=i()}function t(e,t){for(var r=0;t>r;++r)e[r]=255*Math.random()|0}function r(e){if(c){var r=c.randomBytes(e);return r}if("function"==typeof Uint8Array){var r=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(r):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(r):t(r,e),r}var r=new Array(e);return t(r,e),r}function n(){var e=r(s);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",n=0;s>n;++n){var i=e[n];(4===n||6===n||8===n)&&(t+="-"),16>i&&(t+="0"),t+=i.toString(16).toLowerCase()}return t}function i(){var e;do e="@@WeakMap@@"+n();while(u.call(l,e));return l[e]=!0,e}function o(e,t){if(!u.call(e,p)){if(!t)return void 0;Object.defineProperty(e,p,{value:Object.create(null)})}return e[p]}var s=16,a="undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process),c=a&&require("crypto"),u=Object.prototype.hasOwnProperty,l={},p=i();return e.prototype={has:function(e){var t=o(e,!1);return t?this._key in t:!1},get:function(e){var t=o(e,!1);return t?t[this._key]:void 0},set:function(e,t){var r=o(e,!0);return r[this._key]=t,this},"delete":function(e){var t=o(e,!1);return t&&this._key in t?delete t[this._key]:!1},clear:function(){this._key=i()}},e}var D=Object.getPrototypeOf(Function),k="function"==typeof Map?Map:R(),A="function"==typeof Set?Set:I(),N="function"==typeof WeakMap?WeakMap:T(),M=new N;e.decorate=t,e.metadata=r,e.defineMetadata=n,e.hasMetadata=i,e.hasOwnMetadata=o,e.getMetadata=s,e.getOwnMetadata=a,e.getMetadataKeys=c,e.getOwnMetadataKeys=u,e.deleteMetadata=l,function(t){if("undefined"!=typeof t.Reflect){if(t.Reflect!==e)for(var r in e)t.Reflect[r]=e[r]}else t.Reflect=e}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:"undefined"!=typeof global?global:Function("return this;")())}(Reflect||(Reflect={})),System.register("angular2/src/facade/lang",[],!0,function(e,t,r){function n(e){return e.name}function i(){M=!0}function o(){if(M)throw"Cannot enable dev mode after platform setup.";N=!0}function s(){return N}function a(e){return e}function c(){return function(e){return e}}function u(e){return void 0!==e&&null!==e}function l(e){return void 0===e||null===e}function p(e){return"string"==typeof e}function f(e){return"function"==typeof e}function d(e){return f(e)}function h(e){return"object"==typeof e&&null!==e}function g(e){return e instanceof A.Promise}function v(e){return Array.isArray(e)}function m(e){return"number"==typeof e}function y(e){return e instanceof t.Date&&!isNaN(e.valueOf())}function _(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function b(e){return e}function x(e,t){return e}function w(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function j(e){return e}function C(e){return l(e)?null:e}function S(e){return l(e)?!1:e}function E(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function O(e){console.log(e)}function P(e,t,r){for(var n=t.split("."),i=e;n.length>1;){var o=n.shift();i=i.hasOwnProperty(o)?i[o]:i[o]={}}(void 0===i||null===i)&&(i={}),i[n.shift()]=r}function R(){if(l(q))if(u(Symbol)&&u(Symbol.iterator))q=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;te?-1:e>t?1:0},e}();t.StringWrapper=V;var B=function(){function e(e){void 0===e&&(e=[]),this.parts=e}return e.prototype.add=function(e){this.parts.push(e)},e.prototype.toString=function(){return this.parts.join("")},e}();t.StringJoiner=B;var L=function(e){function t(t){e.call(this),this.message=t}return k(t,e),t.prototype.toString=function(){return this.message},t}(Error);t.NumberParseError=L;var F=function(){function e(){}return e.toFixed=function(e,t){return e.toFixed(t)},e.equal=function(e,t){return e===t},e.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new L("Invalid integer literal when parsing "+e);return t},e.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new L("Invalid integer literal when parsing "+e+" in base "+t)},e.parseFloat=function(e){return parseFloat(e)},Object.defineProperty(e,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),e.isNaN=function(e){return isNaN(e)},e.isInteger=function(e){return Number.isInteger(e)},e}();t.NumberWrapper=F,t.RegExp=A.RegExp;var W=function(){function e(){}return e.create=function(e,t){return void 0===t&&(t=""),t=t.replace(/g/g,""),new A.RegExp(e,t+"g")},e.firstMatch=function(e,t){return e.lastIndex=0,e.exec(t)},e.test=function(e,t){return e.lastIndex=0,e.test(t)},e.matcher=function(e,t){return e.lastIndex=0,{re:e,input:t}},e}();t.RegExpWrapper=W;var U=function(){function e(){}return e.next=function(e){return e.re.exec(e.input)},e}();t.RegExpMatcherWrapper=U;var H=function(){function e(){}return e.apply=function(e,t){return e.apply(null,t)},e}();t.FunctionWrapper=H,t.looseIdentical=w,t.getMapKey=j,t.normalizeBlank=C,t.normalizeBool=S,t.isJsObject=E,t.print=O;var z=function(){function e(){}return e.parse=function(e){return A.JSON.parse(e)},e.stringify=function(e){return A.JSON.stringify(e,null,2)},e}();t.Json=z;var G=function(){function e(){}return e.create=function(e,r,n,i,o,s,a){return void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),new t.Date(e,r-1,n,i,o,s,a)},e.fromISOString=function(e){return new t.Date(e)},e.fromMillis=function(e){return new t.Date(e)},e.toMillis=function(e){return e.getTime()},e.now=function(){return new t.Date},e.toJson=function(e){return e.toJSON()},e}();t.DateWrapper=G,t.setValueOnPath=P;var q=null;return t.getSymbolIterator=R,I.define=T,r.exports}),System.register("angular2/src/facade/promise",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e.resolve=function(e){return Promise.resolve(e)},e.reject=function(e,t){return Promise.reject(e)},e.catchError=function(e,t){return e["catch"](t)},e.all=function(e){return 0==e.length?Promise.resolve([]):Promise.all(e)},e.then=function(e,t,r){return e.then(t,r)},e.wrap=function(e){return new Promise(function(t,r){try{t(e())}catch(n){r(n)}})},e.scheduleMicrotask=function(t){e.then(e.resolve(null),t,function(e){})},e.isPromise=function(e){return e instanceof Promise},e.completer=function(){var e,t,r=new Promise(function(r,n){e=r,t=n});return{promise:r,resolve:e,reject:t}},e}();return t.PromiseWrapper=o,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/noop",[],!0,function(e,t,r){function n(){}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/throwError",[],!0,function(e,t,r){function n(e){throw e}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError",[],!0,function(e,t,r){function n(e){function t(){try{t.target.apply(this,arguments)}catch(e){this.error(e)}}return t.target=e,t}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Subscription",[],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var s=function(){function e(t){n(this,e),this.isUnsubscribed=!1,t&&(this._unsubscribe=t)}return e.prototype._unsubscribe=function(){},e.prototype.unsubscribe=function t(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var t=this._unsubscribe,e=this._subscriptions;if(this._subscriptions=void 0,t&&t.call(this),null!=e)for(var r=-1,n=e.length;++rr;r++)t.push(null);return t}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0;var l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=function(e){function t(r){i(this,t),e.call(this),this.observables=r}return o(t,e),t.create=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return new t(r)},t.prototype._subscribe=function(e){for(var t=this.observables,r=t.length,n={complete:0,total:r,values:a(r)},i=0;r>i;i++)t[i].subscribe(new g(e,this,i,n))},t}(p["default"]);t["default"]=h;var g=function(e){function t(r,n,o,s){i(this,t),e.call(this,r),this.parent=n,this.index=o,this.context=s}return o(t,e),t.prototype._next=function(e){this._value=e},t.prototype._complete=function(){var e=this.context;e.values[this.index]=this._value,e.values.every(s)&&(this.destination.next(e.values),this.destination.complete())},t}(d["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.value,r=e.subscriber;r.next(t),r.complete()}function a(e){var t=e.err,r=e.subscriber;r.error(t)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0;var l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscription"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),g=n(h),v=function(e){function t(r,n){i(this,t),e.call(this),this.promise=r,this.scheduler=n,this._isScalar=!1}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?g["default"]:arguments[1];return new t(e,r)},t.prototype._subscribe=function(e){var t=this,r=this.scheduler,n=this.promise;if(r===g["default"])this._isScalar?(e.next(this.value),e.complete()):n.then(function(r){t._isScalar=!0,t.value=r,e.next(r),e.complete()},function(t){return e.error(t)}).then(null,function(e){setTimeout(function(){throw e})});else{var i=function(){var i=new d["default"];if(t._isScalar){var o=t.value;i.add(r.schedule(s,0,{value:o,subscriber:e}))}else n.then(function(n){t._isScalar=!0,t.value=n,i.add(r.schedule(s,0,{value:n,subscriber:e}))},function(t){return i.add(r.schedule(a,0,{err:t,subscriber:e}))}).then(null,function(e){r.schedule(function(){throw e})});return{v:i}}();if("object"==typeof i)return i.v}},t}(p["default"]);return t["default"]=v,r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/util/root","@reactivex/rxjs/dist/cjs/util/Symbol_iterator","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e[v["default"]];if(!t&&"string"==typeof e)return new w(e);if(!t&&void 0!==e.length)return new j(e);if(!t)throw new TypeError("Object is not iterable");return e[v["default"]]()}function a(e){var t=+e.length;return isNaN(t)?0:0!==t&&c(t)?(t=u(t)*Math.floor(Math.abs(t)),0>=t?0:t>x?x:t):t}function c(e){return"number"==typeof e&&h.root.isFinite(e)}function u(e){var t=+e;return 0===t?t:isNaN(t)?t:0>t?-1:1}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0;var f=e("@reactivex/rxjs/dist/cjs/Observable"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/root"),g=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),v=n(g),m=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),y=n(m),_=e("@reactivex/rxjs/dist/cjs/util/errorObject"),b=function(e){function t(r,n,o,s){i(this,t),e.call(this),this.iterator=r,this.project=n,this.thisArg=o,this.scheduler=s}return o(t,e),t.create=function(e,r,n,i){if(null==e)throw new Error("iterator cannot be null.");if(r&&"function"!=typeof r)throw new Error("When provided, `project` must be a function.");return new t(e,r,n,i)},t.dispatch=function(e){var t=e.index,r=e.hasError,n=e.thisArg,i=e.project,o=e.iterator,s=e.subscriber;if(r)return void s.error(e.error);var a=o.next();return a.done?void s.complete():(i?(a=y["default"](i).call(n,a.value,t),a===_.errorObject?(e.error=_.errorObject.e,e.hasError=!0):(s.next(a),e.index=t+1)):(s.next(a.value),e.index=t+1),void(s.isUnsubscribed||this.schedule(e)))},t.prototype._subscribe=function(e){var r=0,n=this.project,i=this.thisArg,o=s(Object(this.iterator)),a=this.scheduler;if(a)e.add(a.schedule(t.dispatch,0,{index:r,thisArg:i,project:n,iterator:o,subscriber:e}));else for(;;){var c=o.next();if(c.done){e.complete();break}if(n){if(c=y["default"](n).call(i,c.value,r++),c===_.errorObject){e.error(_.errorObject.e);break}e.next(c)}else e.next(c.value);if(e.isUnsubscribed)break}},t}(d["default"]);t["default"]=b;var x=Math.pow(2,53)-1,w=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?t.length:arguments[2];return function(){i(this,e),this.str=t,this.idx=r,this.len=n}.apply(this,arguments)}return e.prototype[v["default"]]=function(){return this},e.prototype.next=function(){return this.idxa;a++)t.setupSubscription(e[a],r,n,i);else"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener?(e.addEventListener(r,n),o=function(){return e.removeEventListener(r,n)}):"function"==typeof e.on&&"function"==typeof e.off?(e.on(r,n),o=function(){return e.off(r,n)}):"function"==typeof e.addListener&&"function"==typeof e.removeListener&&(e.addListener(r,n),o=function(){return e.removeListener(r,n)});i.add(new h["default"](o))},t.prototype._subscribe=function(e){var r=this.sourceObj,n=this.eventName,i=this.selector,o=i?function(t){var r=p["default"](i)(t);r===f.errorObject?e.error(r.e):e.next(r)}:function(t){return e.next(t)};t.setupSubscription(r,n,o,e)},t}(u["default"]);return t["default"]=g,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscription"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/errorObject"),g=function(e){function t(r,n,o){i(this,t),e.call(this),this.addHandler=r,this.removeHandler=n,this.selector=o}return o(t,e),t.create=function(e,r,n){return new t(e,r,n)},t.prototype._subscribe=function(e){var t=this.addHandler,r=this.removeHandler,n=this.selector,i=n?function(t){var r=d["default"](n).apply(null,arguments);r===h.errorObject?e.error(r.e):e.next(r)}:function(t){e.next(t)},o=d["default"](t)(i);o===h.errorObject&&e.error(o.e),e.add(new p["default"](function(){r(i)}))},t}(u["default"]);return t["default"]=g,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/isNumeric",[],!0,function(e,t,r){function n(e){return!s(e)&&e-parseFloat(e)+1>=0}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=Array.isArray;return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Immediate",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root"),s={setImmediate:function(e){return 0},clearImmediate:function(e){}};return t.Immediate=s,o.root&&o.root.setImmediate?(s.setImmediate=o.root.setImmediate,s.clearImmediate=o.root.clearImmediate):t.Immediate=s=function(e,t){function r(e){delete d[e]}function n(e){return d[f]=i.apply(void 0,e),f++}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return function(){"function"==typeof e?e.apply(void 0,r):new Function(""+e)()}}function o(e){if(h)setTimeout(i(o,e),0);else{var t=d[e];if(t){h=!0;try{t()}finally{r(e),h=!1}}}}function s(){return function(){var t=n(arguments);return e.process.nextTick(i(o,t)),t}}function a(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}function c(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&o(+r.data.slice(t.length))};return e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),function(){var r=n(arguments);return e.postMessage(t+r,"*"),r}}function u(){var e=new MessageChannel;return e.port1.onmessage=function(e){var t=e.data;o(t)},function(){var t=n(arguments);return e.port2.postMessage(t),t}}function l(){var e=g.documentElement;return function(){var t=n(arguments),r=g.createElement("script");return r.onreadystatechange=function(){o(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r),t}}function p(){return function(){var e=n(arguments);return setTimeout(i(o,e),0),e}}var f=1,d={},h=!1,g=e.document,v=void 0;return v="[object process]"==={}.toString.call(e.process)?s():a()?c():e.MessageChannel?u():g&&"onreadystatechange"in g.createElement("script")?l():p(),t.setImmediate=v,t.clearImmediate=r,t}(o.root,s),n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support",["@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t); +e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),p=n(l),f=function(){function e(t){o(this,e),this.concurrent=t}return e.prototype.call=function(e){return new d(e,this.concurrent)},e}();t.MergeAllOperator=f;var d=function(e){function t(r,n){o(this,t),e.call(this,r),this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0}return i(t,e),t.prototype._next=function(e){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(u["default"]);return t.MergeAllSubscriber=d,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(){i(this,t),e.call(this)}return o(t,e),t.create=function(){return new t},t.prototype._subscribe=function(e){},t}(u["default"]);return t["default"]=l,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(r,n,o){i(this,t),e.call(this),this.start=r,this.end=n,this.scheduler=o}return o(t,e),t.create=function(e,r,n){return void 0===e&&(e=0),void 0===r&&(r=0),new t(e,r,n)},t.dispatch=function(e){var t=e.start,r=e.index,n=e.end,i=e.subscriber;return r>=n?void i.complete():(i.next(t),void(i.isUnsubscribed||(e.index=r+1,e.start=t+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,n=this.start,i=this.end,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{index:r,end:i,start:n,subscriber:e}));else for(;;){if(r++>=i){e.complete();break}if(e.next(n++),e.isUnsubscribed)break}},t}(u["default"]);return t["default"]=l,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable",["@reactivex/rxjs/dist/cjs/util/isNumeric","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/isNumeric"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(e){function t(r,n,o){void 0===r&&(r=0),i(this,t),e.call(this),this.dueTime=r,this.period=n,this.scheduler=o,u["default"](n)?this._period=Number(n)<1&&1||Number(n):n&&"function"==typeof n.schedule&&(o=n),o&&"function"==typeof o.schedule||(o=d["default"]),this.scheduler=o}return o(t,e),t.create=function(e,r,n){return void 0===e&&(e=0),new t(e,r,n)},t.dispatch=function(e){var r=e.index,n=e.period,i=e.subscriber,o=this;return i.next(r),"undefined"==typeof n?void i.complete():void(i.isUnsubscribed||("undefined"==typeof o.delay?o.add(o.scheduler.schedule(t.dispatch,n,{index:r+1,period:n,subscriber:i})):(e.index=r+1,o.schedule(e,n))))},t.prototype._subscribe=function(e){var r=0,n=this._period,i=this.dueTime,o=this.scheduler;e.add(o.schedule(t.dispatch,i,{index:r,period:n,subscriber:e}))},t}(p["default"]);return t["default"]=h,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip-support",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult","@reactivex/rxjs/dist/cjs/util/Symbol_iterator"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscriber"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/errorObject"),d=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),v=n(g),m=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),y=n(m),_=Array.isArray,b=function(){function e(t){o(this,e),this.project=t}return e.prototype.call=function(e){return new x(e,this.project)},e}();t.ZipOperator=b;var x=function(e){function t(r,n){var i=arguments.length<=2||void 0===arguments[2]?Object.create(null):arguments[2];o(this,t),e.call(this,r),this.index=0,this.iterators=[],this.active=0,this.project="function"==typeof n?n:null,this.values=i}return i(t,e),t.prototype._next=function(e){var t=this.iterators,r=this.index++;_(e)?t.push(new j(e)):"function"==typeof e[y["default"]]?t.push(new w(e[y["default"]]())):t.push(new C(this.destination,this,e,r))},t.prototype._complete=function(){var e=this.iterators,t=e.length;this.active=t;for(var r=0;t>r;r++){var n=e[r];n.stillUnsubscribed?n.subscribe(n,r):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;t>n;n++){var i=e[n];if("function"==typeof i.hasValue&&!i.hasValue())return}for(var o=!1,s=[],n=0;t>n;n++){var i=e[n],a=i.next();if(i.hasCompleted()&&(o=!0),a.done)return void r.complete();s.push(a.value)}var c=this.project;if(c){var a=p["default"](c).apply(this,s);a===f.errorObject?r.error(f.errorObject.e):r.next(a)}else r.next(s);o&&r.complete()},t}(u["default"]);t.ZipSubscriber=x;var w=function(){function e(t){o(this,e),this.iterator=t,this.nextResult=t.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return e&&e.done},e}(),j=function(){function e(t){o(this,e),this.array=t,this.index=0,this.length=0,this.length=t.length}return e.prototype[y["default"]]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return tthis.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),C=function(e){function t(r,n,i,s){o(this,t),e.call(this,r),this.parent=n,this.observable=i,this.index=s,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(t,e),t.prototype[y["default"]]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){this.add(v["default"](this,this.observable,this,t))},t}(h["default"]);return s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/buffer",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.closingNotifier=t}return e.prototype.call=function(e){return new f(e,this.closingNotifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.buffer=[],this.notifierSubscriber=null,this.notifierSubscriber=new d(this),this.add(n._subscribe(this.notifierSubscriber))}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){this.destination.complete()},t.prototype.flushBuffer=function(){var e=this.buffer;this.buffer=[],this.destination.next(e),this.isUnsubscribed&&this.notifierSubscriber.unsubscribe()},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.flushBuffer()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.lift(new p(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t,r){o(this,e),this.bufferSize=t,this.startBufferEvery=r}return e.prototype.call=function(e){return new f(e,this.bufferSize,this.startBufferEvery)},e}(),f=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[[]],this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.count+=1,r=this.destination,n=this.bufferSize,i=null==this.startBufferEvery?n:this.startBufferEvery,o=this.buffers,s=o.length,a=-1;t%i===0&&o.push([]);for(var c=0;s>c;c++){var u=o[c];u.push(e),u.length===n&&(a=c,r.next(u))}-1!==a&&o.splice(a,1)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){for(var e=this.destination,t=this.buffers;t.length>0;){var r=t.shift();r.length>0&&e.next(r)}e.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?g["default"]:arguments[2];return this.lift(new v(e,t,r))}function a(e){var t=e.subscriber,r=e.buffer;r&&t.closeBuffer(r),e.buffer=t.openBuffer(),t.isUnsubscribed||this.schedule(e,e.bufferTimeSpan)}function c(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openBuffer(),s=this;n.isUnsubscribed||(s.add(i.schedule(u,r,{subscriber:n,buffer:o})),s.schedule(e,t))}function u(e){var t=e.subscriber,r=e.buffer;t.closeBuffer(r)}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0,t["default"]=s;var f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),g=n(h),v=function(){function e(t,r,n){o(this,e),this.bufferTimeSpan=t,this.bufferCreationInterval=r,this.scheduler=n}return e.prototype.call=function(e){return new m(e,this.bufferTimeSpan,this.bufferCreationInterval,this.scheduler)},e}(),m=function(e){function t(r,n,i,s){o(this,t),e.call(this,r),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.scheduler=s,this.buffers=[];var l=this.openBuffer();if(null!==i&&i>=0){var p={subscriber:this,buffer:l},f={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(u,n,p)),this.add(s.schedule(c,i,f))}else{var d={subscriber:this,buffer:l,bufferTimeSpan:n};this.add(s.schedule(a,n,d))}}return i(t,e),t.prototype._next=function(e){for(var t=this.buffers,r=t.length,n=0;r>n;n++)t[n].push(e)},t.prototype._error=function(e){this.buffers.length=0,this.destination.error(e)},t.prototype._complete=function(){for(var e=this.buffers;e.length>0;)this.destination.next(e.shift());this.destination.complete()},t.prototype.openBuffer=function(){var e=[];return this.buffers.push(e),e},t.prototype.closeBuffer=function(e){this.destination.next(e);var t=this.buffers;t.splice(t.indexOf(e),1)},t}(d["default"]);return r.exports=t["default"],l.define=p,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new v(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subscription"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t,r){o(this,e),this.openings=t,this.closingSelector=r}return e.prototype.call=function(e){return new m(e,this.openings,this.closingSelector)},e}(),m=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openings._subscribe(new _(this)))}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;r>n;n++)t[n].buffer.push(e)},t.prototype._error=function(e){this.contexts=null,this.destination.error(e)},t.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var t=e.shift();this.destination.next(t.buffer),t.subscription.unsubscribe(),t.buffer=null}this.destination.complete()},t.prototype.openBuffer=function(e){var t=this.closingSelector,r=this.contexts,n=h["default"](t)(e);if(n===g.errorObject){var i=n.e;this.contexts=null,this.destination.error(i)}else{var o={buffer:[],subscription:new f["default"]};r.push(o);var s=new y(this,o),a=n._subscribe(s);this.add(o.subscription.add(a))}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(null!==t){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t}(l["default"]),y=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.context=n}return i(t,e),t.prototype._next=function(){this.parent.closeBuffer(this.context)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.closeBuffer(this.context)},t}(l["default"]),_=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.openBuffer(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new h(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t){o(this,e),this.closingSelector=t}return e.prototype.call=function(e){return new g(e,this.closingSelector)},e}(),g=function(e){function t(r,n){o(this,t),e.call(this,r),this.closingSelector=n,this.openBuffer()}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._error=function(e){this.buffer=null,this.destination.error(e)},t.prototype._complete=function(){var e=this.buffer;this.destination.next(e),this.buffer=null,this.destination.complete()},t.prototype.openBuffer=function(){var e=this.closingNotification;e&&(this.remove(e),e.unsubscribe());var t=this.buffer;t&&this.destination.next(t),this.buffer=[];var r=f["default"](this.closingSelector)();if(r===d.errorObject){var n=r.e;this.buffer=null,this.destination.error(n)}else this.add(this.closingNotification=r._subscribe(new v(this)))},t}(l["default"]),v=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.openBuffer()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.openBuffer()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/catch",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=new h(e),r=this.lift(t);return t.caught=r,r}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t){o(this,e),this.selector=t}return e.prototype.call=function(e){return new g(e,this.selector,this.caught)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.selector=n,this.caught=i}return i(t,e),t.prototype._error=function(e){var t=f["default"](this.selector)(e,this.caught);t===d.errorObject?this.destination.error(d.errorObject.e):this.add(t.subscribe(this.destination))},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineAll",["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"],!0,function(e,t,r){function n(e){return this.lift(new s.CombineLatestOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/combineLatest-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];t.unshift(this);var n=void 0;return"function"==typeof t[t.length-1]&&(n=t.pop()),new c["default"](t).lift(new u.CombineLatestOperator(n))}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concat",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t;return n.unshift(this),n.length>1&&"function"==typeof n[n.length-1].schedule&&n.splice(n.length-2,0,1),c["default"].fromArray(n).mergeAll(1)}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/Observable"),c=n(a);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatAll",["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"],!0,function(e,t,r){function n(){return this.lift(new s.MergeAllOperator(1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeAll-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/subscribeToResult","@reactivex/rxjs/dist/cjs/OuterSubscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/errorObject"),p=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),h=n(d),g=function(){function e(t,r){var n=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];o(this,e),this.project=t,this.resultSelector=r,this.concurrent=n}return e.prototype.call=function(e){return new v(e,this.project,this.resultSelector,this.concurrent)},e}();t.MergeMapOperator=g;var v=function(e){function t(r,n,i){var s=arguments.length<=3||void 0===arguments[3]?Number.POSITIVE_INFINITY:arguments[3];o(this,t),e.call(this,r),this.project=n,this.resultSelector=i,this.concurrent=s,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(h["default"]);return t.MergeMapSubscriber=v,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/errorObject"),p=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),h=n(d),g=function(){function e(t,r){var n=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];o(this,e),this.ish=t,this.resultSelector=r,this.concurrent=n}return e.prototype.call=function(e){return new v(e,this.ish,this.resultSelector,this.concurrent)},e}();t.MergeMapToOperator=g;var v=function(e){function t(r,n,i){var s=arguments.length<=3||void 0===arguments[3]?Number.POSITIVE_INFINITY:arguments[3];o(this,t),e.call(this,r),this.ish=n,this.resultSelector=i,this.concurrent=s,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return i(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(f["default"]);return t.MergeMapToSubscriber=v,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/bindCallback",[],!0,function(e,t,r){function n(e,t,r){if("undefined"==typeof t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){return this.lift(new p)}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new f(e)},e}(),f=function(e){function t(r){o(this,t),e.call(this,r)}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/debounce",["@reactivex/rxjs/dist/cjs/observables/PromiseObservable","@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new m(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0;var u=function(){function e(e,t){for(var r=0;r0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n){this._next(t)},t}(f["default"]);return t.ExpandSubscriber=v,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/filter",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new v(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),g=n(h),v=function(){function e(t,r){o(this,e),this.select=g["default"](t,r,2)}return e.prototype.call=function(e){return new m(e,this.select)},e}(),m=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.select=n}return i(t,e),t.prototype._next=function(e){var t=f["default"](this.select)(e,this.count++);t===d.errorObject?this.destination.error(d.errorObject.e):Boolean(t)&&this.destination.next(e)},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/finally",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new g(t?h["default"](e,t,2):e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subscription"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),h=n(d),g=function(){function e(t){o(this,e),this.finallySelector=t}return e.prototype.call=function(e){return new v(e,this.finallySelector)},e}(),v=function(e){function t(r,n){o(this,t),e.call(this,r),this.add(new f["default"](n))}return i(t,e),t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/EmptyError",[],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var s=function a(){n(this,a),this.name="EmptyError",this.message="no elements in sequence"};return t["default"]=s,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription",["@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscription"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=function(e){function t(r,n){i(this,t),e.call(this),this.subject=r,this.observer=n,this.isUnsubscribed=!1}return o(t,e),t.prototype.unsubscribe=function(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var e=this.subject,t=e.observers;if(this.subject=void 0,t&&0!==t.length&&!e.isUnsubscribed){this.observer instanceof p["default"]&&this.observer.unsubscribe();var r=t.indexOf(this.observer);-1!==r&&t.splice(r,1)}}},t}(u["default"]);return t["default"]=f,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Map",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root");return t["default"]=o.root.Map||function(){function e(){this.size=0,this._values=[],this._keys=[]}return e.prototype["delete"]=function(e){var t=this._keys.indexOf(e);return-1===t?!1:(this._values.splice(t,1),this._keys.splice(t,1),this.size--,!0)},e.prototype.get=function(e){var t=this._keys.indexOf(e);return-1===t?void 0:this._values[t]},e.prototype.set=function(e,t){var r=this._keys.indexOf(e);return-1===r?(this._keys.push(e),this._values.push(t),this.size++):this._values[r]=t,this},e.prototype.forEach=function(e,t){for(var r=0;rr;r++)t[r]=arguments[r];return t.unshift(this),c["default"].apply(this,t)}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/operators/merge-static"),c=n(a);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll",["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"],!0,function(e,t,r){function n(){var e=arguments.length<=0||void 0===arguments[0]?Number.POSITIVE_INFINITY:arguments[0];return this.lift(new s.MergeAllOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeAll-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap",["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"],!0,function(e,t,r){function n(e,t){var r=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];return this.lift(new s.MergeMapOperator(e,t,r))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeMap-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo",["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"],!0,function(e,t,r){function n(e,t){var r=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];return this.lift(new s.MergeMapToOperator(e,t,r))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscription"),p=n(l),f=function(e){function t(r,n){i(this,t),e.call(this),this.source=r,this.subjectFactory=n}return o(t,e),t.prototype._subscribe=function(e){return this._getSubject().subscribe(e)},t.prototype._getSubject=function(){var e=this.subject;return e&&!e.isUnsubscribed?e:this.subject=this.subjectFactory()},t.prototype.connect=function(){var e=this.source,t=this.subscription;return t&&!t.isUnsubscribed?t:(t=e.subscribe(this._getSubject()), +t.add(new d(this)),this.subscription=t)},t.prototype.refCount=function(){return new h(this)},t}(u["default"]);t["default"]=f;var d=function(e){function t(r){i(this,t),e.call(this),this.connectable=r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;e.subject=void 0,e.subscription=void 0,this.connectable=void 0},t}(p["default"]),h=function(e){function t(r){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];i(this,t),e.call(this),this.connectable=r,this.refCount=n}return o(t,e),t.prototype._subscribe=function(e){var t=this.connectable,r=t.subscribe(e);return 1===++this.refCount&&(this.connection=t.connect()),r.add(new g(this)),r},t}(u["default"]),g=function(e){function t(r){i(this,t),e.call(this),this.refCountObservable=r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.refCountObservable;0===--e.refCount&&(e.connection.unsubscribe(),e.connection=void 0)},t}(p["default"]);return r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/observeOn",["@reactivex/rxjs/dist/cjs/operators/observeOn-support"],!0,function(e,t,r){function n(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return this.lift(new s.ObserveOnOperator(e,t))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/observeOn-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/not",[],!0,function(e,t,r){function n(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/publish",["@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/operators/multicast"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){return new u["default"]}function o(){return p["default"].call(this,i)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0,t["default"]=o;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/operators/multicast"),p=n(l);return r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject",["@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=function(e){function t(r){i(this,t),e.call(this),this.value=r}return o(t,e),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r?(r.isUnsubscribed||t.next(this.value),r):void 0},t.prototype._next=function(t){e.prototype._next.call(this,this.value=t)},t}(u["default"]);return t["default"]=l,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject",["@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),p=n(l),f=function(e){function t(r,n,o){void 0===r&&(r=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY),i(this,t),e.call(this),this.events=[],this.bufferSize=1>r?1:r,this._windowTime=1>n?1:n,this.scheduler=o}return o(t,e),t.prototype._next=function(t){var r=this._getNow();this.events.push(new d(r,t)),e.prototype._next.call(this,t)},t.prototype._subscribe=function(t){for(var r=this._getEvents(this._getNow()),n=-1,i=r.length;!t.isUnsubscribed&&++no&&!(e-n[o].timet&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(u["default"]);t["default"]=f;var d=function h(e,t){i(this,h),this.time=e,this.value=t};return r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscriber"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/errorObject"),d=function(){function e(t,r){o(this,e),this.acc=r,this.project=t}return e.prototype.call=function(e){return new h(e,this.project,this.acc)},e}();t.ReduceOperator=d;var h=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.hasValue=!1,this.acc=i,this.project=n,this.hasSeed="undefined"!=typeof i}return i(t,e),t.prototype._next=function(e){if(this.hasValue||(this.hasValue=this.hasSeed)){var t=p["default"](this.project).call(this,this.acc,e);t===f.errorObject?this.destination.error(f.errorObject.e):this.acc=t}else this.acc=e,this.hasValue=!0},t.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc),this.destination.complete()},t}(u["default"]);return t.ReduceSubscriber=h,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/repeat",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/observables/EmptyObservable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){var e=arguments.length<=0||void 0===arguments[0]?-1:arguments[0];return 0===e?f["default"].create():this.lift(new d(e,this))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"),f=n(p),d=function(){function e(t,r){o(this,e),this.count=t,this.source=r}return e.prototype.call=function(e){return new h(e,this.count,this.source)},e}(),h=function(e){function t(r,n,i){o(this,t),e.call(this,null),this.destination=r,this.count=n,this.source=i,0===n&&(this.destination.complete(),e.prototype.unsubscribe.call(this)),this.lastSubscription=this}return i(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e)},t.prototype.complete=function(){this.isUnsubscribed||this.resubscribe(this.count)},t.prototype.unsubscribe=function(){var t=this.lastSubscription;t===this?e.prototype.unsubscribe.call(this):t.unsubscribe()},t.prototype.resubscribe=function(e){if(this.lastSubscription.unsubscribe(),e-1===0)this.destination.complete();else{var t=new g(this,e-1);this.lastSubscription=this.source.subscribe(t)}},t}(l["default"]),g=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.count=n}return i(t,e),t.prototype._next=function(e){this.parent.destination.next(e)},t.prototype._error=function(e){this.parent.destination.error(e)},t.prototype._complete=function(){var e=this.count;this.parent.resubscribe(0>e?-1:e)},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/retry",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.lift(new p(e,this))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t,r){o(this,e),this.count=t,this.source=r}return e.prototype.call=function(e){return new f(e,this.count,this.source)},e}(),f=function(e){function t(r,n,i){o(this,t),e.call(this,null),this.destination=r,this.count=n,this.source=i,this.lastSubscription=this}return i(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype.error=function(t){this.isUnsubscribed||(e.prototype.unsubscribe.call(this),this.resubscribe())},t.prototype._complete=function(){e.prototype.unsubscribe.call(this),this.destination.complete()},t.prototype.unsubscribe=function(){var t=this.lastSubscription;t===this?e.prototype.unsubscribe.call(this):t.unsubscribe()},t.prototype.resubscribe=function(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0];this.lastSubscription.unsubscribe();var t=new d(this,this.count,e+1);this.lastSubscription=this.source.subscribe(t)},t}(l["default"]),d=function(e){function t(r,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];o(this,t),e.call(this,null),this.parent=r,this.count=n,this.retried=i}return i(t,e),t.prototype._next=function(e){this.parent.destination.next(e)},t.prototype._error=function(e){var t=this.parent,r=this.retried,n=this.count;n&&r===n?t.destination.error(e):t.resubscribe(r)},t.prototype._complete=function(){this.parent.destination.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new v(e,this))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t,r){o(this,e),this.notifier=t,this.source=r}return e.prototype.call=function(e){return new m(e,this.notifier,this.source)},e}(),m=function(e){function t(r,n,i){o(this,t),e.call(this,null),this.destination=r,this.notifier=n,this.source=i,this.lastSubscription=this}return i(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype.error=function(t){if(!this.isUnsubscribed){if(e.prototype.unsubscribe.call(this),!this.retryNotifications){this.errors=new f["default"];var r=h["default"](this.notifier).call(this,this.errors);if(r===g.errorObject)this.destination.error(g.errorObject.e);else{this.retryNotifications=r;var n=new _(this);this.notificationSubscription=r.subscribe(n)}}this.errors.next(t)}},t.prototype.destinationError=function(e){this.tearDown(),this.destination.error(e)},t.prototype._complete=function(){this.destinationComplete()},t.prototype.destinationComplete=function(){this.tearDown(),this.destination.complete()},t.prototype.unsubscribe=function(){var t=this.lastSubscription;t===this?e.prototype.unsubscribe.call(this):this.tearDown()},t.prototype.tearDown=function(){e.prototype.unsubscribe.call(this),this.lastSubscription.unsubscribe();var t=this.notificationSubscription;t&&t.unsubscribe()},t.prototype.resubscribe=function(){this.lastSubscription.unsubscribe();var e=new y(this);this.lastSubscription=this.source.subscribe(e)},t}(l["default"]),y=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.destination.next(e)},t.prototype._error=function(e){this.parent.errors.next(e)},t.prototype._complete=function(){this.parent.destinationComplete()},t}(l["default"]),_=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.resubscribe()},t.prototype._error=function(e){this.parent.destinationError(e)},t.prototype._complete=function(){this.parent.destinationComplete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/sample",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.notifier=t}return e.prototype.call=function(e){return new f(e,this.notifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.notifier=n,this.hasValue=!1,this.add(n._subscribe(new d(this)))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&this.destination.next(this.lastValue)},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.notifyNext()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return this.lift(new h(e,t))}function a(e){var t=e.subscriber,r=e.delay;t.notifyNext(),this.schedule(e,r)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=s;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new g(e,this.delay,this.scheduler)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.delay=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(a,n,{subscriber:this,delay:n}))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&this.destination.next(this.lastValue)},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/scan",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new g(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0;var u=function(){function e(e,t){for(var r=0;r0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new m["default"])},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/skip",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.total=t}return e.prototype.call=function(e){return new f(e,this.total)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.notifier=t}return e.prototype.call=function(e){return new f(e,this.notifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.notifier=n,this.notificationSubscriber=null,this.notificationSubscriber=new d(this),this.add(this.notifier.subscribe(this.notificationSubscriber))}return i(t,e),t.prototype._next=function(e){this.notificationSubscriber.hasValue&&this.destination.next(e)},t.prototype._complete=function(){this.notificationSubscriber.hasCompleted&&this.destination.complete(),this.notificationSubscriber.unsubscribe()},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r,this.hasValue=!1,this.hasCompleted=!1}return i(t,e),t.prototype._next=function(e){this.hasValue=!0},t.prototype._error=function(e){this.parent.error(e),this.hasValue=!0},t.prototype._complete=function(){this.hasCompleted=!0},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/startWith",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/observables/ScalarObservable","@reactivex/rxjs/dist/cjs/observables/EmptyObservable","@reactivex/rxjs/dist/cjs/operators/concat-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];n&&"function"==typeof n.schedule?t.pop():n=void 0;var i=t.length;return 1===i?h["default"](new l["default"](t[0],n),this):i>1?h["default"](new c["default"](t,n),this):h["default"](new f["default"](n),this)}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/operators/concat-static"),h=n(d);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),p=n(l),f=function(e){function t(r){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1],o=arguments.length<=2||void 0===arguments[2]?p["default"]:arguments[2];i(this,t),e.call(this),this.source=r,this.delayTime=n,this.scheduler=o}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?p["default"]:arguments[2];return new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return t.subscribe(r)},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source,i=this.scheduler;e.add(i.schedule(t.dispatch,r,{source:n,subscriber:e}))},t}(u["default"]);return t["default"]=f,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switch",["@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){return this.lift(new d)}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),f=n(p),d=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new h(e)},e}(),h=function(e){function t(r){o(this,t),e.call(this,r),this.active=0,this.hasCompleted=!1}return i(t,e),t.prototype._next=function(e){this.unsubscribeInner(),this.active++,this.add(this.innerSubscription=f["default"](this,e))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&this.destination.complete()},t.prototype.unsubscribeInner=function(){this.active=this.active>0?this.active-1:0;var e=this.innerSubscription;e&&(e.unsubscribe(),this.remove(e))},t.prototype.notifyNext=function(e,t){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.unsubscribeInner(),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switchMap",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new v(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/errorObject"),f=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),g=n(h),v=function(){function e(t,r){o(this,e),this.project=t,this.resultSelector=r}return e.prototype.call=function(e){return new m(e,this.project,this.resultSelector)},e}(),m=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.project=n,this.resultSelector=i,this.hasCompleted=!1,this.index=0}return i(t,e),t.prototype._next=function(e){var t=this.index++,r=this.destination,n=l["default"](this.project)(e,t);if(n===p.errorObject)r.error(n.e);else{var i=this.innerSubscription;i&&i.unsubscribe(),this.add(this.innerSubscription=g["default"](this,n,e,t))}},t.prototype._complete=function(){var e=this.innerSubscription;this.hasCompleted=!0,(!e||e.isUnsubscribed)&&this.destination.complete()},t.prototype.notifyComplete=function(e){this.remove(e);var t=this.innerSubscription;t&&t.unsubscribe(),this.innerSubscription=null,this.hasCompleted&&this.destination.complete()},t.prototype.notifyError=function(e){ +this.destination.error(e)},t.prototype.notifyNext=function(e,t,r,n){var i=this.resultSelector,o=this.destination;if(i){var s=l["default"](i)(e,t,r,n);s===p.errorObject?o.error(p.errorObject.e):o.next(s)}else o.next(t)},t}(d["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new v(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/errorObject"),f=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),g=n(h),v=function(){function e(t,r){o(this,e),this.observable=t,this.resultSelector=r}return e.prototype.call=function(e){return new m(e,this.observable,this.resultSelector)},e}(),m=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.inner=n,this.resultSelector=i,this.hasCompleted=!1,this.index=0}return i(t,e),t.prototype._next=function(e){var t=this.index++,r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=g["default"](this,this.inner,e,t))},t.prototype._complete=function(){var e=this.innerSubscription;this.hasCompleted=!0,(!e||e.isUnsubscribed)&&this.destination.complete()},t.prototype.notifyComplete=function(e){this.remove(e);var t=this.innerSubscription;t&&t.unsubscribe(),this.innerSubscription=null,this.hasCompleted&&this.destination.complete()},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyNext=function(e,t,r,n){var i=this.resultSelector,o=this.destination;if(i){var s=l["default"](i)(e,t,r,n);s===p.errorObject?o.error(p.errorObject.e):o.next(s)}else o.next(t)},t}(d["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/take",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.total=t}return e.prototype.call=function(e){return new f(e,this.total)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.total=n,this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.total;++this.count<=t&&(this.destination.next(e),this.count===t&&this.destination.complete())},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new p(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.notifier=t}return e.prototype.call=function(e){return new f(e,this.notifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.notifier=n,this.notificationSubscriber=null,this.notificationSubscriber=new d(r),this.add(n.subscribe(this.notificationSubscriber))}return i(t,e),t.prototype._complete=function(){this.destination.complete(),this.notificationSubscriber.unsubscribe()},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.destination=r}return i(t,e),t.prototype._next=function(){this.destination.complete()},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/throttle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return this.lift(new h(e,t))}function a(e){var t=e.value,r=e.subscriber;r.throttledNext(t)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=s;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new g(e,this.delay,this.scheduler)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.delay=n,this.scheduler=i}return i(t,e),t.prototype._next=function(e){this.throttled||this.add(this.throttled=this.scheduler.schedule(a,this.delay,{value:e,subscriber:this}))},t.prototype.throttledNext=function(e){this.clearThrottle(),this.destination.next(e)},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(e.unsubscribe(),this.remove(e))},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/timeout",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/immediate","@reactivex/rxjs/dist/cjs/util/isDate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?d["default"]:arguments[2],n=g["default"](e),i=n?+e-r.now():e;return this.lift(new v(i,n,t,r))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0;var u=function(){function e(e,t){for(var r=0;r0?this.startWindowEvery:this.windowSize,r=this.windowSize,n=this.windows,i=n.length,o=0;i>o;o++)n[o].next(e);var s=this.count-r+1;if(s>=0&&s%t===0&&n.shift().complete(),++this.count%t===0){var a=new f["default"];n.push(a),this.destination.next(a)}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;)e.shift().complete();this.destination.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?m["default"]:arguments[2];return this.lift(new y(e,t,r))}function a(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&n.complete(),e.window=t.openWindow(),this.schedule(e,r)}function c(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),s=this,a={action:s,subscription:null},c={subscriber:r,window:o,context:a};a.subscription=n.schedule(u,t,c),s.add(a.subscription),s.schedule(e,i)}function u(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0,t["default"]=s;var f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/Subject"),g=n(h),v=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),m=n(v),y=function(){function e(t,r,n){o(this,e),this.windowTimeSpan=t,this.windowCreationInterval=r,this.scheduler=n}return e.prototype.call=function(e){return new _(e,this.windowTimeSpan,this.windowCreationInterval,this.scheduler)},e}(),_=function(e){function t(r,n,i,s){if(o(this,t),e.call(this,r),this.windowTimeSpan=n,this.windowCreationInterval=i,this.scheduler=s,this.windows=[],null!==i&&i>=0){var l=this.openWindow(),p={subscriber:this,window:l,context:null},f={windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:s};this.add(s.schedule(u,n,p)),this.add(s.schedule(c,i,f))}else{var d=this.openWindow(),h={subscriber:this,window:d,windowTimeSpan:n};this.add(s.schedule(a,n,h))}}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;r>n;n++)t[n].next(e)},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;)e.shift().complete();this.destination.complete()},t.prototype.openWindow=function(){var e=new g["default"];return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(d["default"]);return r.exports=t["default"],l.define=p,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new y(e,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/Subscription"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),v=n(g),m=e("@reactivex/rxjs/dist/cjs/util/errorObject"),y=function(){function e(t,r){o(this,e),this.openings=t,this.closingSelector=r}return e.prototype.call=function(e){return new _(e,this.openings,this.closingSelector)},e}(),_=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.openings=n,this.closingSelector=i,this.contexts=[],this.add(this.openings._subscribe(new x(this)))}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;r>n;n++)t[n].window.next(e)},t.prototype._error=function(e){for(var t=this.contexts;t.length>0;)t.shift().window.error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var t=e.shift();t.window.complete(),t.subscription.unsubscribe()}this.destination.complete()},t.prototype.openWindow=function(e){var t=this.closingSelector,r=v["default"](t)(e);if(r===m.errorObject)this.error(r.e);else{var n={window:new f["default"],subscription:new h["default"]};this.contexts.push(n),this.destination.next(n.window);var i=new b(this,n),o=r._subscribe(i);this.add(n.subscription.add(o))}},t.prototype.closeWindow=function(e){var t=e.window,r=e.subscription,n=this.contexts;n.splice(n.indexOf(e),1),t.complete(),this.remove(r),r.unsubscribe()},t}(l["default"]),b=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.windowContext=n}return i(t,e),t.prototype._next=function(){this.parent.closeWindow(this.windowContext)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.closeWindow(this.windowContext)},t}(l["default"]),x=function(e){function t(r){o(this,t),e.call(this),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.openWindow(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return this.lift(new y(e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/Subscription"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),v=n(g),m=e("@reactivex/rxjs/dist/cjs/util/errorObject"),y=function(){function e(t){o(this,e),this.closingSelector=t}return e.prototype.call=function(e){return new _(e,this.closingSelector)},e}(),_=function(e){function t(r,n){o(this,t),e.call(this,r),this.closingSelector=n,this.window=new f["default"],this.openWindow()}return i(t,e),t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype.openWindow=function(){var e=this.closingNotification;e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete(),this.destination.next(this.window=new f["default"]);var r=v["default"](this.closingSelector)();if(r===m.errorObject){var n=r.e;this.destination.error(n),this.window.error(n)}else{var i=this.closingNotification=new h["default"];this.add(i.add(r._subscribe(new b(this))))}},t}(l["default"]),b=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.openWindow()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){for(var e=void 0,t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];"function"==typeof r[r.length-1]&&(e=r.pop());var i=r;return this.lift(new v(i,e))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/errorObject"),f=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),g=n(h),v=function(){function e(t,r){o(this,e),this.observables=t,this.project=r}return e.prototype.call=function(e){return new m(e,this.observables,this.project)},e}(),m=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.observables=n,this.project=i,this.toRespond=[];var s=n.length;this.values=new Array(s);for(var a=0;s>a;a++)this.toRespond.push(a);for(var a=0;s>a;a++){var c=n[a];this.add(g["default"](this,c,c,a))}}return i(t,e),t.prototype.notifyNext=function(e,t,r,n){this.values[r]=t;var i=this.toRespond;if(i.length>0){var o=i.indexOf(r);-1!==o&&i.splice(o,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=this.values,r=this.destination,n=this.project,i=[e].concat(t);if(n){var o=l["default"](this.project).apply(this,i);o===p.errorObject?r.error(o.e):r.next(o)}else r.next(i)}},t}(d["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip",["@reactivex/rxjs/dist/cjs/operators/zip-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return t.unshift(this),c["default"].apply(this,t)}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/operators/zip-static"),c=n(a);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zipAll",["@reactivex/rxjs/dist/cjs/operators/zip-support"],!0,function(e,t,r){function n(e){return this.lift(new s.ZipOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/zip-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError",[],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var s=function a(){n(this,a),this.name="ArgumentOutOfRangeError",this.message="argument out of range"};return t["default"]=s,r.exports=t["default"],i.define=o,r.exports}),System.register("angular2/src/core/di/metadata",["angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=function(){function e(e){this.token=e}return e.prototype.toString=function(){return"@Inject("+a.stringify(this.token)+")"},e=o([a.CONST(),s("design:paramtypes",[Object])],e)}();t.InjectMetadata=c;var u=function(){function e(){}return e.prototype.toString=function(){return"@Optional()"},e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.OptionalMetadata=u;var l=function(){function e(){}return Object.defineProperty(e.prototype,"token",{get:function(){return null},enumerable:!0,configurable:!0}),e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.DependencyMetadata=l;var p=function(){function e(){}return e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.InjectableMetadata=p;var f=function(){function e(){}return e.prototype.toString=function(){return"@Self()"},e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.SelfMetadata=f;var d=function(){function e(){}return e.prototype.toString=function(){return"@SkipSelf()"},e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.SkipSelfMetadata=d;var h=function(){function e(){}return e.prototype.toString=function(){return"@Host()"},e=o([a.CONST(),s("design:paramtypes",[])],e)}();return t.HostMetadata=h,n.define=i,r.exports}),System.register("angular2/src/core/util/decorators",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){return p.isFunction(e)&&e.hasOwnProperty("annotation")&&(e=e.annotation),e}function i(e,t){if(e===Object||e===String||e===Function||e===Number||e===Array)throw new Error("Can not use native "+p.stringify(e)+" as constructor");if(p.isFunction(e))return e;if(e instanceof Array){var r=e,i=e[e.length-1];if(!p.isFunction(i))throw new Error("Last position of Class method array must be Function in key "+t+" was '"+p.stringify(i)+"'");var o=r.length-1;if(o!=i.length)throw new Error("Number of annotations ("+o+") does not match number of arguments ("+i.length+") in the function: "+p.stringify(i)); +for(var s=[],a=0,c=r.length-1;c>a;a++){var u=[];s.push(u);var l=r[a];if(l instanceof Array)for(var d=0;d-1?(e.splice(r,1),!0):!1},e.clear=function(e){e.length=0},e.isEmpty=function(e){return 0==e.length},e.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},e.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;rn&&(r=o,n=s)}}return r},e}();t.ListWrapper=h,t.isListLikeIterable=n,t.iterateListLike=i;var g=function(){var e=new t.Set([1,2,3]);return 3===e.size?function(e){return new t.Set(e)}:function(e){var r=new t.Set(e);if(r.size!==e.length)for(var n=0;n1){var t=n(c.ListWrapper.reversed(e)),r=t.map(function(e){return u.stringify(e.token)});return" ("+r.join(" -> ")+")"}return""}var o=System.global,s=o.define;o.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/facade/collection"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/exceptions"),p=function(e){function t(t,r,n){e.call(this,"DI Exception"),this.keys=[r],this.injectors=[t],this.constructResolvingMessage=n,this.message=this.constructResolvingMessage(this.keys)}return a(t,e),t.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t),this.message=this.constructResolvingMessage(this.keys)},Object.defineProperty(t.prototype,"context",{get:function(){return this.injectors[this.injectors.length-1].debugContext()},enumerable:!0,configurable:!0}),t}(l.BaseException);t.AbstractProviderError=p;var f=function(e){function t(t,r){e.call(this,t,r,function(e){var t=u.stringify(c.ListWrapper.first(e).token);return"No provider for "+t+"!"+i(e)})}return a(t,e),t}(p);t.NoProviderError=f;var d=function(e){function t(t,r){e.call(this,t,r,function(e){return"Cannot instantiate cyclic dependency!"+i(e)})}return a(t,e),t}(p);t.CyclicDependencyError=d;var h=function(e){function t(t,r,n,i){e.call(this,"DI Exception",r,n,null),this.keys=[i],this.injectors=[t]}return a(t,e),t.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t)},Object.defineProperty(t.prototype,"wrapperMessage",{get:function(){var e=u.stringify(c.ListWrapper.first(this.keys).token);return"Error during instantiation of "+e+"!"+i(this.keys)+"."},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"causeKey",{get:function(){return this.keys[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.injectors[this.injectors.length-1].debugContext()},enumerable:!0,configurable:!0}),t}(l.WrappedException);t.InstantiationError=h;var g=function(e){function t(t){e.call(this,"Invalid provider - only instances of Provider and Type are allowed, got: "+t.toString())}return a(t,e),t}(l.BaseException);t.InvalidProviderError=g;var v=function(e){function t(r,n){e.call(this,t._genMessage(r,n))}return a(t,e),t._genMessage=function(e,t){for(var r=[],n=0,i=t.length;i>n;n++){var o=t[n];u.isBlank(o)||0==o.length?r.push("?"):r.push(o.map(u.stringify).join(" "))}return"Cannot resolve all parameters for "+u.stringify(e)+"("+r.join(", ")+"). Make sure they all have valid type or annotations."},t}(l.BaseException);t.NoAnnotationError=v;var m=function(e){function t(t){e.call(this,"Index "+t+" is out-of-bounds.")}return a(t,e),t}(l.BaseException);t.OutOfBoundsError=m;var y=function(e){function t(t,r){e.call(this,"Cannot mix multi providers and regular providers, got: "+t.toString()+" "+r.toString())}return a(t,e),t}(l.BaseException);return t.MixingMultiProvidersWithRegularProvidersError=y,o.define=s,r.exports}),System.register("angular2/src/core/di/opaque_token",["angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=function(){function e(e){this._desc=e}return e.prototype.toString=function(){return"Token "+this._desc},e=o([a.CONST(),s("design:paramtypes",[String])],e)}();return t.OpaqueToken=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/iterable_differs",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/facade/exceptions"),u=e("angular2/src/facade/collection"),l=e("angular2/src/core/di"),p=function(){function e(e){this.factories=e}return e.create=function(t,r){if(a.isPresent(r)){var n=u.ListWrapper.clone(r.factories);return t=t.concat(n),new e(t)}return new e(t)},e.extend=function(t){return new l.Provider(e,{useFactory:function(r){if(a.isBlank(r))throw new c.BaseException("Cannot extend IterableDiffers without a parent injector");return e.create(t,r)},deps:[[e,new l.SkipSelfMetadata,new l.OptionalMetadata]]})},e.prototype.find=function(e){var t=this.factories.find(function(t){return t.supports(e)});if(a.isPresent(t))return t;throw new c.BaseException("Cannot find a differ supporting object '"+e+"'")},e=o([l.Injectable(),a.CONST(),s("design:paramtypes",[Array])],e)}();return t.IterableDiffers=p,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/default_iterable_differ",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/facade/exceptions"),u=e("angular2/src/facade/collection"),l=e("angular2/src/facade/lang"),p=function(){function e(){}return e.prototype.supports=function(e){return u.isListLikeIterable(e)},e.prototype.create=function(e){return new f},e=o([a.CONST(),s("design:paramtypes",[])],e)}();t.DefaultIterableDifferFactory=p;var f=function(){function e(){this._collection=null,this._length=null,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(e.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)},e.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},e.prototype.forEachMovedItem=function(e){var t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)},e.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},e.prototype.diff=function(e){if(l.isBlank(e)&&(e=[]),!u.isListLikeIterable(e))throw new c.BaseException("Error trying to diff '"+e+"'");return this.check(e)?this:null},e.prototype.onDestroy=function(){},e.prototype.check=function(e){var t=this;this._reset();var r,n,i=this._itHead,o=!1;if(l.isArray(e)){var s=e;for(this._length=e.length,r=0;r"+l.stringify(this.currentIndex)+"]"},e}();t.CollectionChangeRecord=d;var h=function(){function e(){this._head=null,this._tail=null}return e.prototype.add=function(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)},e.prototype.get=function(e,t){var r;for(r=this._head;null!==r;r=r._nextDup)if((null===t||t"+c.stringify(this.currentValue)+"]"},e}();return t.KVChangeRecord=f,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/parser/ast",["angular2/src/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/collection"),a=function(){function e(){}return e.prototype.visit=function(e){return null},e.prototype.toString=function(){return"AST"},e}();t.AST=a;var c=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.visit=function(e){},t}(a);t.EmptyExpr=c;var u=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.visit=function(e){return e.visitImplicitReceiver(this)},t}(a);t.ImplicitReceiver=u;var l=function(e){function t(t){e.call(this),this.expressions=t}return o(t,e),t.prototype.visit=function(e){return e.visitChain(this)},t}(a);t.Chain=l;var p=function(e){function t(t,r,n){e.call(this),this.condition=t,this.trueExp=r,this.falseExp=n}return o(t,e),t.prototype.visit=function(e){return e.visitConditional(this)},t}(a);t.Conditional=p;var f=function(e){function t(t,r,n){e.call(this),this.receiver=t,this.name=r,this.getter=n}return o(t,e),t.prototype.visit=function(e){return e.visitPropertyRead(this)},t}(a);t.PropertyRead=f;var d=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.setter=n,this.value=i}return o(t,e),t.prototype.visit=function(e){return e.visitPropertyWrite(this)},t}(a);t.PropertyWrite=d;var h=function(e){function t(t,r,n){e.call(this),this.receiver=t,this.name=r,this.getter=n}return o(t,e),t.prototype.visit=function(e){return e.visitSafePropertyRead(this)},t}(a);t.SafePropertyRead=h;var g=function(e){function t(t,r){e.call(this),this.obj=t,this.key=r}return o(t,e),t.prototype.visit=function(e){return e.visitKeyedRead(this)},t}(a);t.KeyedRead=g;var v=function(e){function t(t,r,n){e.call(this),this.obj=t,this.key=r,this.value=n}return o(t,e),t.prototype.visit=function(e){return e.visitKeyedWrite(this)},t}(a);t.KeyedWrite=v;var m=function(e){function t(t,r,n){e.call(this),this.exp=t,this.name=r,this.args=n}return o(t,e),t.prototype.visit=function(e){return e.visitPipe(this)},t}(a);t.BindingPipe=m;var y=function(e){function t(t){e.call(this),this.value=t}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralPrimitive(this)},t}(a);t.LiteralPrimitive=y;var _=function(e){function t(t){e.call(this),this.expressions=t}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralArray(this)},t}(a);t.LiteralArray=_;var b=function(e){function t(t,r){e.call(this),this.keys=t,this.values=r}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralMap(this)},t}(a);t.LiteralMap=b;var x=function(e){function t(t,r){e.call(this),this.strings=t,this.expressions=r}return o(t,e),t.prototype.visit=function(e){e.visitInterpolation(this)},t}(a);t.Interpolation=x;var w=function(e){function t(t,r,n){e.call(this),this.operation=t,this.left=r,this.right=n}return o(t,e),t.prototype.visit=function(e){return e.visitBinary(this)},t}(a);t.Binary=w;var j=function(e){function t(t){e.call(this),this.expression=t}return o(t,e),t.prototype.visit=function(e){return e.visitPrefixNot(this)},t}(a);t.PrefixNot=j;var C=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.fn=n,this.args=i}return o(t,e),t.prototype.visit=function(e){return e.visitMethodCall(this)},t}(a);t.MethodCall=C;var S=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.fn=n,this.args=i}return o(t,e),t.prototype.visit=function(e){return e.visitSafeMethodCall(this)},t}(a);t.SafeMethodCall=S;var E=function(e){function t(t,r){e.call(this),this.target=t,this.args=r}return o(t,e),t.prototype.visit=function(e){return e.visitFunctionCall(this)},t}(a);t.FunctionCall=E;var O=function(e){function t(t,r,n){e.call(this),this.ast=t,this.source=r,this.location=n}return o(t,e),t.prototype.visit=function(e){return this.ast.visit(e)},t.prototype.toString=function(){return this.source+" in "+this.location},t}(a);t.ASTWithSource=O;var P=function(){function e(e,t,r,n){this.key=e,this.keyIsVar=t,this.name=r,this.expression=n}return e}();t.TemplateBinding=P;var R=function(){function e(){}return e.prototype.visitBinary=function(e){return e.left.visit(this),e.right.visit(this),null},e.prototype.visitChain=function(e){return this.visitAll(e.expressions)},e.prototype.visitConditional=function(e){return e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this),null},e.prototype.visitPipe=function(e){return e.exp.visit(this),this.visitAll(e.args),null},e.prototype.visitFunctionCall=function(e){return e.target.visit(this),this.visitAll(e.args),null},e.prototype.visitImplicitReceiver=function(e){return null},e.prototype.visitInterpolation=function(e){return this.visitAll(e.expressions)},e.prototype.visitKeyedRead=function(e){return e.obj.visit(this),e.key.visit(this),null},e.prototype.visitKeyedWrite=function(e){return e.obj.visit(this),e.key.visit(this),e.value.visit(this),null},e.prototype.visitLiteralArray=function(e){return this.visitAll(e.expressions)},e.prototype.visitLiteralMap=function(e){return this.visitAll(e.values)},e.prototype.visitLiteralPrimitive=function(e){return null},e.prototype.visitMethodCall=function(e){return e.receiver.visit(this),this.visitAll(e.args)},e.prototype.visitPrefixNot=function(e){return e.expression.visit(this),null},e.prototype.visitPropertyRead=function(e){return e.receiver.visit(this),null},e.prototype.visitPropertyWrite=function(e){return e.receiver.visit(this),e.value.visit(this),null},e.prototype.visitSafePropertyRead=function(e){return e.receiver.visit(this),null},e.prototype.visitSafeMethodCall=function(e){return e.receiver.visit(this),this.visitAll(e.args)},e.prototype.visitAll=function(e){var t=this;return e.forEach(function(e){return e.visit(t)}),null},e}();t.RecursiveAstVisitor=R;var I=function(){function e(){}return e.prototype.visitImplicitReceiver=function(e){return e},e.prototype.visitInterpolation=function(e){return new x(e.strings,this.visitAll(e.expressions))},e.prototype.visitLiteralPrimitive=function(e){return new y(e.value)},e.prototype.visitPropertyRead=function(e){return new f(e.receiver.visit(this),e.name,e.getter)},e.prototype.visitPropertyWrite=function(e){return new d(e.receiver.visit(this),e.name,e.setter,e.value)},e.prototype.visitSafePropertyRead=function(e){return new h(e.receiver.visit(this),e.name,e.getter)},e.prototype.visitMethodCall=function(e){return new C(e.receiver.visit(this),e.name,e.fn,this.visitAll(e.args))},e.prototype.visitSafeMethodCall=function(e){return new S(e.receiver.visit(this),e.name,e.fn,this.visitAll(e.args))},e.prototype.visitFunctionCall=function(e){return new E(e.target.visit(this),this.visitAll(e.args))},e.prototype.visitLiteralArray=function(e){return new _(this.visitAll(e.expressions))},e.prototype.visitLiteralMap=function(e){return new b(e.keys,this.visitAll(e.values))},e.prototype.visitBinary=function(e){return new w(e.operation,e.left.visit(this),e.right.visit(this))},e.prototype.visitPrefixNot=function(e){return new j(e.expression.visit(this))},e.prototype.visitConditional=function(e){return new p(e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))},e.prototype.visitPipe=function(e){return new m(e.exp.visit(this),e.name,this.visitAll(e.args))},e.prototype.visitKeyedRead=function(e){return new g(e.obj.visit(this),e.key.visit(this))},e.prototype.visitKeyedWrite=function(e){return new v(e.obj.visit(this),e.key.visit(this),e.value.visit(this))},e.prototype.visitAll=function(e){for(var t=s.ListWrapper.createFixedSize(e.length),r=0;r=t.$TAB&&e<=t.$SPACE||e==z}function l(e){return e>=N&&H>=e||e>=I&&D>=e||e==A||e==t.$$}function p(e){return e>=N&&H>=e||e>=I&&D>=e||e>=P&&R>=e||e==A||e==t.$$}function f(e){return e>=P&&R>=e}function d(e){return e==M||e==T}function h(e){return e==t.$MINUS||e==t.$PLUS}function g(e){switch(e){case B:return t.$LF;case V:return t.$FF;case L:return t.$CR;case F:return t.$TAB;case U:return t.$VTAB;default:return e}}var v=System.global,m=v.define;v.define=void 0;var y=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},_=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},b=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},x=e("angular2/src/core/di/decorators"),w=e("angular2/src/facade/collection"),j=e("angular2/src/facade/lang"),C=e("angular2/src/facade/exceptions");!function(e){e[e.Character=0]="Character",e[e.Identifier=1]="Identifier",e[e.Keyword=2]="Keyword",e[e.String=3]="String",e[e.Operator=4]="Operator",e[e.Number=5]="Number"}(t.TokenType||(t.TokenType={}));var S=t.TokenType,E=function(){function e(){}return e.prototype.tokenize=function(e){for(var t=new q(e),r=[],n=t.scanToken();null!=n;)r.push(n),n=t.scanToken();return r},e=_([x.Injectable(),b("design:paramtypes",[])],e)}();t.Lexer=E;var O=function(){function e(e,t,r,n){this.index=e,this.type=t,this.numValue=r,this.strValue=n}return e.prototype.isCharacter=function(e){return this.type==S.Character&&this.numValue==e},e.prototype.isNumber=function(){return this.type==S.Number},e.prototype.isString=function(){return this.type==S.String},e.prototype.isOperator=function(e){return this.type==S.Operator&&this.strValue==e},e.prototype.isIdentifier=function(){return this.type==S.Identifier},e.prototype.isKeyword=function(){return this.type==S.Keyword},e.prototype.isKeywordVar=function(){return this.type==S.Keyword&&"var"==this.strValue},e.prototype.isKeywordNull=function(){return this.type==S.Keyword&&"null"==this.strValue},e.prototype.isKeywordUndefined=function(){return this.type==S.Keyword&&"undefined"==this.strValue},e.prototype.isKeywordTrue=function(){return this.type==S.Keyword&&"true"==this.strValue},e.prototype.isKeywordFalse=function(){return this.type==S.Keyword&&"false"==this.strValue},e.prototype.toNumber=function(){return this.type==S.Number?this.numValue:-1},e.prototype.toString=function(){switch(this.type){case S.Character:case S.Identifier:case S.Keyword:case S.Operator:case S.String:return this.strValue;case S.Number:return this.numValue.toString();default:return null}},e}();t.Token=O,t.EOF=new O(-1,S.Character,0,""),t.$EOF=0,t.$TAB=9,t.$LF=10,t.$VTAB=11,t.$FF=12,t.$CR=13,t.$SPACE=32,t.$BANG=33,t.$DQ=34,t.$HASH=35,t.$$=36,t.$PERCENT=37,t.$AMPERSAND=38,t.$SQ=39,t.$LPAREN=40,t.$RPAREN=41,t.$STAR=42,t.$PLUS=43,t.$COMMA=44,t.$MINUS=45,t.$PERIOD=46,t.$SLASH=47,t.$COLON=58,t.$SEMICOLON=59,t.$LT=60,t.$EQ=61,t.$GT=62,t.$QUESTION=63;var P=48,R=57,I=65,T=69,D=90;t.$LBRACKET=91,t.$BACKSLASH=92,t.$RBRACKET=93;var k=94,A=95,N=97,M=101,V=102,B=110,L=114,F=116,W=117,U=118,H=122;t.$LBRACE=123,t.$BAR=124,t.$RBRACE=125;var z=160,G=function(e){function t(t){e.call(this),this.message=t}return y(t,e),t.prototype.toString=function(){return this.message},t}(C.BaseException);t.ScannerError=G;var q=function(){function e(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}return e.prototype.advance=function(){this.peek=++this.index>=this.length?t.$EOF:j.StringWrapper.charCodeAt(this.input,this.index)},e.prototype.scanToken=function(){for(var e=this.input,r=this.length,i=this.peek,o=this.index;i<=t.$SPACE;){if(++o>=r){i=t.$EOF;break}i=j.StringWrapper.charCodeAt(e,o)}if(this.peek=i,this.index=o,o>=r)return null;if(l(i))return this.scanIdentifier();if(f(i))return this.scanNumber(o);var s=o;switch(i){case t.$PERIOD:return this.advance(),f(this.peek)?this.scanNumber(s):n(s,t.$PERIOD);case t.$LPAREN:case t.$RPAREN:case t.$LBRACE:case t.$RBRACE:case t.$LBRACKET:case t.$RBRACKET:case t.$COMMA:case t.$COLON:case t.$SEMICOLON:return this.scanCharacter(s,i);case t.$SQ:case t.$DQ:return this.scanString();case t.$HASH:case t.$PLUS:case t.$MINUS:case t.$STAR:case t.$SLASH:case t.$PERCENT:case k:return this.scanOperator(s,j.StringWrapper.fromCharCode(i));case t.$QUESTION:return this.scanComplexOperator(s,"?",t.$PERIOD,".");case t.$LT:case t.$GT:return this.scanComplexOperator(s,j.StringWrapper.fromCharCode(i),t.$EQ,"=");case t.$BANG:case t.$EQ:return this.scanComplexOperator(s,j.StringWrapper.fromCharCode(i),t.$EQ,"=",t.$EQ,"=");case t.$AMPERSAND:return this.scanComplexOperator(s,"&",t.$AMPERSAND,"&");case t.$BAR:return this.scanComplexOperator(s,"|",t.$BAR,"|");case z:for(;u(this.peek);)this.advance();return this.scanToken()}return this.error("Unexpected character ["+j.StringWrapper.fromCharCode(i)+"]",0),null},e.prototype.scanCharacter=function(e,t){return assert(this.peek==t),this.advance(),n(e,t)},e.prototype.scanOperator=function(e,t){return assert(this.peek==j.StringWrapper.charCodeAt(t,0)),assert(w.SetWrapper.has(K,t)),this.advance(),s(e,t)},e.prototype.scanComplexOperator=function(e,t,r,n,i,o){assert(this.peek==j.StringWrapper.charCodeAt(t,0)),this.advance();var a=t;return this.peek==r&&(this.advance(),a+=n),j.isPresent(i)&&this.peek==i&&(this.advance(),a+=o),assert(w.SetWrapper.has(K,a)),s(e,a)},e.prototype.scanIdentifier=function(){assert(l(this.peek));var e=this.index;for(this.advance();p(this.peek);)this.advance();var t=this.input.substring(e,this.index);return w.SetWrapper.has($,t)?o(e,t):i(e,t)},e.prototype.scanNumber=function(e){assert(f(this.peek));var r=this.index===e;for(this.advance();;){if(f(this.peek));else if(this.peek==t.$PERIOD)r=!1;else{if(!d(this.peek))break;this.advance(),h(this.peek)&&this.advance(),f(this.peek)||this.error("Invalid exponent",-1),r=!1}this.advance()}var n=this.input.substring(e,this.index),i=r?j.NumberWrapper.parseIntAutoRadix(n):j.NumberWrapper.parseFloat(n);return c(e,i)},e.prototype.scanString=function(){assert(this.peek==t.$SQ||this.peek==t.$DQ);var e=this.index,r=this.peek;this.advance();for(var n,i=this.index,o=this.input;this.peek!=r;)if(this.peek==t.$BACKSLASH){null==n&&(n=new j.StringJoiner),n.add(o.substring(i,this.index)),this.advance();var s;if(this.peek==W){var c=o.substring(this.index+1,this.index+5);try{s=j.NumberWrapper.parseInt(c,16)}catch(u){this.error("Invalid unicode escape [\\u"+c+"]",0)}for(var l=0;5>l;l++)this.advance()}else s=g(this.peek),this.advance();n.add(j.StringWrapper.fromCharCode(s)),i=this.index}else this.peek==t.$EOF?this.error("Unterminated quote",0):this.advance();var p=o.substring(i,this.index);this.advance();var f=p;return null!=n&&(n.add(p),f=n.toString()),a(e,f)},e.prototype.error=function(e,t){var r=this.index+t;throw new G("Lexer Error: "+e+" at column "+r+" in expression ["+this.input+"]")},e}(),K=w.SetWrapper.createFromList(["+","-","*","/","%","^","=","==","!=","===","!==","<",">","<=",">=","&&","||","&","|","!","?","#","?."]),$=w.SetWrapper.createFromList(["var","null","undefined","true","false","if","else"]);return v.define=m,r.exports}),System.register("angular2/src/core/change_detection/parser/parser",["angular2/src/core/di/decorators","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/change_detection/parser/lexer","angular2/src/core/reflection/reflection","angular2/src/core/change_detection/parser/ast"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di/decorators"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/exceptions"),p=e("angular2/src/facade/collection"),f=e("angular2/src/core/change_detection/parser/lexer"),d=e("angular2/src/core/reflection/reflection"),h=e("angular2/src/core/change_detection/parser/ast"),g=new h.ImplicitReceiver,v=/\{\{(.*?)\}\}/g,m=function(e){function t(t,r,n,i){e.call(this,"Parser Error: "+t+" "+n+" ["+r+"] in "+i)}return o(t,e),t}(l.BaseException),y=function(){function e(e,t){void 0===t&&(t=null),this._lexer=e,this._reflector=u.isPresent(t)?t:d.reflector}return e.prototype.parseAction=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!0).parseChain();return new h.ASTWithSource(n,e,t)},e.prototype.parseBinding=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!1).parseChain();return new h.ASTWithSource(n,e,t)},e.prototype.parseSimpleBinding=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!1).parseSimpleBinding();return new h.ASTWithSource(n,e,t)},e.prototype.parseTemplateBindings=function(e,t){var r=this._lexer.tokenize(e);return new _(e,t,r,this._reflector,!1).parseTemplateBindings()},e.prototype.parseInterpolation=function(e,t){var r=u.StringWrapper.split(e,v);if(r.length<=1)return null;for(var n=[],i=[],o=0;o0))throw new m("Blank expressions are not allowed in interpolated strings",e,"at column "+this._findInterpolationErrorColumn(r,o)+" in",t);var a=this._lexer.tokenize(s),c=new _(e,t,a,this._reflector,!1).parseChain();i.push(c)}}return new h.ASTWithSource(new h.Interpolation(n,i),e,t)},e.prototype.wrapLiteralPrimitive=function(e,t){return new h.ASTWithSource(new h.LiteralPrimitive(e),e,t)},e.prototype._checkNoInterpolation=function(e,t){var r=u.StringWrapper.split(e,v);if(r.length>1)throw new m("Got interpolation ({{}}) where expression was expected",e,"at column "+this._findInterpolationErrorColumn(r,1)+" in",t)},e.prototype._findInterpolationErrorColumn=function(e,t){for(var r="",n=0;t>n;n++)r+=n%2===0?e[n]:"{{"+e[n]+"}}";return r.length},e=s([c.Injectable(),a("design:paramtypes",[f.Lexer,d.Reflector])],e)}();t.Parser=y;var _=function(){function e(e,t,r,n,i){this.input=e,this.location=t,this.tokens=r,this.reflector=n,this.parseAction=i,this.index=0}return e.prototype.peek=function(e){var t=this.index+e;return t"))e=new h.Binary(">",e,this.parseAdditive());else if(this.optionalOperator("<="))e=new h.Binary("<=",e,this.parseAdditive());else{if(!this.optionalOperator(">="))return e;e=new h.Binary(">=",e,this.parseAdditive())}},e.prototype.parseAdditive=function(){for(var e=this.parseMultiplicative();;)if(this.optionalOperator("+"))e=new h.Binary("+",e,this.parseMultiplicative());else{if(!this.optionalOperator("-"))return e;e=new h.Binary("-",e,this.parseMultiplicative())}},e.prototype.parseMultiplicative=function(){for(var e=this.parsePrefix();;)if(this.optionalOperator("*"))e=new h.Binary("*",e,this.parsePrefix());else if(this.optionalOperator("%"))e=new h.Binary("%",e,this.parsePrefix());else{if(!this.optionalOperator("/"))return e;e=new h.Binary("/",e,this.parsePrefix())}},e.prototype.parsePrefix=function(){return this.optionalOperator("+")?this.parsePrefix():this.optionalOperator("-")?new h.Binary("-",new h.LiteralPrimitive(0),this.parsePrefix()):this.optionalOperator("!")?new h.PrefixNot(this.parsePrefix()):this.parseCallChain()},e.prototype.parseCallChain=function(){for(var e=this.parsePrimary();;)if(this.optionalCharacter(f.$PERIOD))e=this.parseAccessMemberOrMethodCall(e,!1);else if(this.optionalOperator("?."))e=this.parseAccessMemberOrMethodCall(e,!0);else if(this.optionalCharacter(f.$LBRACKET)){var t=this.parsePipe();if(this.expectCharacter(f.$RBRACKET),this.optionalOperator("=")){var r=this.parseConditional();e=new h.KeyedWrite(e,t,r)}else e=new h.KeyedRead(e,t)}else{if(!this.optionalCharacter(f.$LPAREN))return e; +var n=this.parseCallArguments();this.expectCharacter(f.$RPAREN),e=new h.FunctionCall(e,n)}},e.prototype.parsePrimary=function(){if(this.optionalCharacter(f.$LPAREN)){var e=this.parsePipe();return this.expectCharacter(f.$RPAREN),e}if(this.next.isKeywordNull()||this.next.isKeywordUndefined())return this.advance(),new h.LiteralPrimitive(null);if(this.next.isKeywordTrue())return this.advance(),new h.LiteralPrimitive(!0);if(this.next.isKeywordFalse())return this.advance(),new h.LiteralPrimitive(!1);if(this.optionalCharacter(f.$LBRACKET)){var t=this.parseExpressionList(f.$RBRACKET);return this.expectCharacter(f.$RBRACKET),new h.LiteralArray(t)}if(this.next.isCharacter(f.$LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(g,!1);if(this.next.isNumber()){var r=this.next.toNumber();return this.advance(),new h.LiteralPrimitive(r)}if(this.next.isString()){var n=this.next.toString();return this.advance(),new h.LiteralPrimitive(n)}throw this.index>=this.tokens.length?this.error("Unexpected end of expression: "+this.input):this.error("Unexpected token "+this.next),new l.BaseException("Fell through all cases in parsePrimary")},e.prototype.parseExpressionList=function(e){var t=[];if(!this.next.isCharacter(e))do t.push(this.parsePipe());while(this.optionalCharacter(f.$COMMA));return t},e.prototype.parseLiteralMap=function(){var e=[],t=[];if(this.expectCharacter(f.$LBRACE),!this.optionalCharacter(f.$RBRACE)){do{var r=this.expectIdentifierOrKeywordOrString();e.push(r),this.expectCharacter(f.$COLON),t.push(this.parsePipe())}while(this.optionalCharacter(f.$COMMA));this.expectCharacter(f.$RBRACE)}return new h.LiteralMap(e,t)},e.prototype.parseAccessMemberOrMethodCall=function(e,t){void 0===t&&(t=!1);var r=this.expectIdentifierOrKeyword();if(this.optionalCharacter(f.$LPAREN)){var n=this.parseCallArguments();this.expectCharacter(f.$RPAREN);var i=this.reflector.method(r);return t?new h.SafeMethodCall(e,r,i,n):new h.MethodCall(e,r,i,n)}if(!t){if(this.optionalOperator("=")){this.parseAction||this.error("Bindings cannot contain assignments");var o=this.parseConditional();return new h.PropertyWrite(e,r,this.reflector.setter(r),o)}return new h.PropertyRead(e,r,this.reflector.getter(r))}return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),null):new h.SafePropertyRead(e,r,this.reflector.getter(r))},e.prototype.parseCallArguments=function(){if(this.next.isCharacter(f.$RPAREN))return[];var e=[];do e.push(this.parsePipe());while(this.optionalCharacter(f.$COMMA));return e},e.prototype.parseBlockContent=function(){this.parseAction||this.error("Binding expression cannot contain chained expression");for(var e=[];this.index0);n.set(p.selfIndex,g.selfIndex)}}return i(t)}function i(e){for(var t=[],r=h.ListWrapper.createFixedSize(e.length),n=new h.Map,i=0;ii+1){var c=a(s,t,n);t.push(c),r[c.fixedArgs[0]]=c}}else{var c=a(s,t,n);t.push(c),n.set(s.selfIndex,c.selfIndex)}}return t}function o(e,t,r,n){var i=s(e,t,r);return d.isPresent(i)?(e.lastInBinding?(t.push(u(e,i.selfIndex,t.length+1)),i.referencedBySelf=!0):e.argumentToPureFunction&&(i.argumentToPureFunction=!0),i):(n&&r.push(e.selfIndex),t.push(e),e)}function s(e,t,r){return t.find(function(t){return-1==r.indexOf(t.selfIndex)&&t.mode!==g.RecordType.DirectiveLifecycle&&l(t,e)&&t.mode===e.mode&&d.looseIdentical(t.funcOrValue,e.funcOrValue)&&t.contextIndex===e.contextIndex&&d.looseIdentical(t.name,e.name)&&h.ListWrapper.equals(t.args,e.args)})}function a(e,t,r){var n=e.args.map(function(e){return c(r,e)}),i=c(r,e.contextIndex),o=t.length+1;return new g.ProtoRecord(e.mode,e.name,e.funcOrValue,n,e.fixedArgs,i,e.directiveIndex,o,e.bindingRecord,e.lastInBinding,e.lastInDirective,e.argumentToPureFunction,e.referencedBySelf,e.propertyBindingIndex)}function c(e,t){var r=e.get(t);return d.isPresent(r)?r:t}function u(e,t,r){return new g.ProtoRecord(g.RecordType.Self,"self",null,[],e.fixedArgs,t,e.directiveIndex,r,e.bindingRecord,e.lastInBinding,e.lastInDirective,!1,!1,e.propertyBindingIndex)}function l(e,t){var r=d.isBlank(e.directiveIndex)?null:e.directiveIndex.directiveIndex,n=d.isBlank(e.directiveIndex)?null:e.directiveIndex.elementIndex,i=d.isBlank(t.directiveIndex)?null:t.directiveIndex.directiveIndex,o=d.isBlank(t.directiveIndex)?null:t.directiveIndex.elementIndex;return r===i&&n===o}var p=System.global,f=p.define;p.define=void 0;var d=e("angular2/src/facade/lang"),h=e("angular2/src/facade/collection"),g=e("angular2/src/core/change_detection/proto_record");return t.coalesce=n,p.define=f,r.exports}),System.register("angular2/src/core/change_detection/codegen_name_util",["angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(e,t,r){function n(e){return s.StringWrapper.replaceAll(e,m,"")}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/collection"),c="state",u="propertyBindingIndex",l="directiveIndices",p="dispatcher",f="locals",d="mode",h="pipes",g="protos";t.CONTEXT_ACCESSOR="context",t.CONTEXT_INDEX=0;var v="this.",m=/\W/g;t.sanitizeName=n;var y=function(){function e(e,r,i,o){this._records=e,this._eventBindings=r,this._directiveRecords=i,this._utilName=o,this._sanitizedEventNames=new a.Map,this._sanitizedNames=a.ListWrapper.createFixedSize(this._records.length+1),this._sanitizedNames[t.CONTEXT_INDEX]=t.CONTEXT_ACCESSOR;for(var s=0,c=this._records.length;c>s;++s)this._sanitizedNames[s+1]=n(""+this._records[s].name+s);for(var u=0;us;++s)p.push(n(""+l.records[s].name+s+"_"+u));this._sanitizedEventNames.set(l,p)}}return e.prototype._addFieldPrefix=function(e){return""+v+e},e.prototype.getDispatcherName=function(){return this._addFieldPrefix(p)},e.prototype.getPipesAccessorName=function(){return this._addFieldPrefix(h)},e.prototype.getProtosName=function(){return this._addFieldPrefix(g)},e.prototype.getDirectivesAccessorName=function(){return this._addFieldPrefix(l)},e.prototype.getLocalsAccessorName=function(){return this._addFieldPrefix(f)},e.prototype.getStateName=function(){return this._addFieldPrefix(c)},e.prototype.getModeName=function(){return this._addFieldPrefix(d)},e.prototype.getPropertyBindingIndex=function(){return this._addFieldPrefix(u)},e.prototype.getLocalName=function(e){return"l_"+this._sanitizedNames[e]},e.prototype.getEventLocalName=function(e,t){return"l_"+this._sanitizedEventNames.get(e)[t]},e.prototype.getChangeName=function(e){return"c_"+this._sanitizedNames[e]},e.prototype.genInitLocals=function(){for(var e=[],r=[],n=0,i=this.getFieldCount();i>n;++n)if(n==t.CONTEXT_INDEX)e.push(this.getLocalName(n)+" = "+this.getFieldName(n));else{var o=this._records[n-1];if(o.argumentToPureFunction){var s=this.getChangeName(n);e.push(this.getLocalName(n)+","+s),r.push(s)}else e.push(""+this.getLocalName(n))}var c=a.ListWrapper.isEmpty(r)?"":r.join("=")+" = false;";return"var "+e.join(",")+";"+c},e.prototype.genInitEventLocals=function(){var e=this,r=[this.getLocalName(t.CONTEXT_INDEX)+" = "+this.getFieldName(t.CONTEXT_INDEX)];return this._sanitizedEventNames.forEach(function(n,i){for(var o=0;o1?"var "+r.join(",")+";":""},e.prototype.getPreventDefaultAccesor=function(){return"preventDefault"},e.prototype.getFieldCount=function(){return this._sanitizedNames.length},e.prototype.getFieldName=function(e){return this._addFieldPrefix(this._sanitizedNames[e])},e.prototype.getAllFieldNames=function(){for(var e=[],t=0,r=this.getFieldCount();r>t;++t)(0===t||this._records[t-1].shouldBeChecked())&&e.push(this.getFieldName(t));for(var n=0,i=this._records.length;i>n;++n){var o=this._records[n];o.isPipeRecord()&&e.push(this.getPipeName(o.selfIndex))}for(var s=0,a=this._directiveRecords.length;a>s;++s){var c=this._directiveRecords[s];e.push(this.getDirectiveName(c.directiveIndex)),c.isDefaultChangeDetection()||e.push(this.getDetectorName(c.directiveIndex))}return e},e.prototype.genDehydrateFields=function(){var e=this.getAllFieldNames();return a.ListWrapper.removeAt(e,t.CONTEXT_INDEX),a.ListWrapper.isEmpty(e)?"":(e.push(this._utilName+".uninitialized;"),e.join(" = "))},e.prototype.genPipeOnDestroy=function(){var e=this;return this._records.filter(function(e){return e.isPipeRecord()}).map(function(t){return e._utilName+".callPipeOnDestroy("+e.getPipeName(t.selfIndex)+");"}).join("\n")},e.prototype.getPipeName=function(e){return this._addFieldPrefix(this._sanitizedNames[e]+"_pipe")},e.prototype.getDirectiveName=function(e){return this._addFieldPrefix("directive_"+e.name)},e.prototype.getDetectorName=function(e){return this._addFieldPrefix("detector_"+e.name)},e}();return t.CodegenNameUtil=y,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/codegen_facade",[],!0,function(e,t,r){function n(e){return JSON.stringify(e)}function i(e){return"'"+e+"'"}function o(e){return e.join(" + ")}var s=System.global,a=s.define;return s.define=void 0,t.codify=n,t.rawString=i,t.combineGeneratedStrings=o,s.define=a,r.exports}),System.register("angular2/src/core/metadata/view",["angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang");!function(e){e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None"}(t.ViewEncapsulation||(t.ViewEncapsulation={}));var c=t.ViewEncapsulation;t.VIEW_ENCAPSULATION_VALUES=[c.Emulated,c.Native,c.None];var u=function(){function e(e){var t=void 0===e?{}:e,r=t.templateUrl,n=t.template,i=t.directives,o=t.pipes,s=t.encapsulation,a=t.styles,c=t.styleUrls;this.templateUrl=r,this.template=n,this.styleUrls=c,this.styles=a,this.directives=i,this.pipes=o,this.encapsulation=s}return e=o([a.CONST(),s("design:paramtypes",[Object])],e)}();return t.ViewMetadata=u,n.define=i,r.exports}),System.register("angular2/src/common/pipes/invalid_pipe_argument_exception",["angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/exceptions"),a=function(e){function t(t,r){e.call(this,"Invalid argument '"+r+"' for pipe '"+t+"'")}return o(t,e),t}(s.BaseException);return t.InvalidPipeArgumentException=a,n.define=i,r.exports}),System.register("angular2/src/common/pipes/uppercase_pipe",["angular2/src/facade/lang","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/core/metadata"),u=e("angular2/src/core/di"),l=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),p=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),a.isBlank(t))return t;if(!a.isString(t))throw new l.InvalidPipeArgumentException(e,t);return t.toUpperCase()},e=o([a.CONST(),c.Pipe({name:"uppercase"}),u.Injectable(),s("design:paramtypes",[])],e)}();return t.UpperCasePipe=p,n.define=i,r.exports}),System.register("angular2/src/common/pipes/lowercase_pipe",["angular2/src/facade/lang","angular2/src/core/di","angular2/src/core/metadata","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/core/di"),u=e("angular2/src/core/metadata"),l=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),p=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),a.isBlank(t))return t;if(!a.isString(t))throw new l.InvalidPipeArgumentException(e,t);return t.toLowerCase()},e=o([a.CONST(),u.Pipe({name:"lowercase"}),c.Injectable(),s("design:paramtypes",[])],e)}();return t.LowerCasePipe=p,n.define=i,r.exports}),System.register("angular2/src/common/pipes/json_pipe",["angular2/src/facade/lang","angular2/src/core/di","angular2/src/core/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/core/di"),u=e("angular2/src/core/metadata"),l=function(){function e(){}return e.prototype.transform=function(e,t){return void 0===t&&(t=null),a.Json.stringify(e)},e=o([a.CONST(),u.Pipe({name:"json",pure:!1}),c.Injectable(),s("design:paramtypes",[])],e)}();return t.JsonPipe=l,n.define=i,r.exports}),System.register("angular2/src/common/pipes/slice_pipe",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/di","angular2/src/common/pipes/invalid_pipe_argument_exception","angular2/src/core/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/facade/exceptions"),u=e("angular2/src/facade/collection"),l=e("angular2/src/core/di"),p=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),f=e("angular2/src/core/metadata"),d=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),a.isBlank(r)||0==r.length)throw new c.BaseException("Slice pipe requires one argument");if(!this.supports(t))throw new p.InvalidPipeArgumentException(e,t);if(a.isBlank(t))return t;var n=r[0],i=r.length>1?r[1]:null;return a.isString(t)?a.StringWrapper.slice(t,n,i):u.ListWrapper.slice(t,n,i)},e.prototype.supports=function(e){return a.isString(e)||a.isArray(e)},e=o([f.Pipe({name:"slice", +pure:!1}),l.Injectable(),s("design:paramtypes",[])],e)}();return t.SlicePipe=d,n.define=i,r.exports}),System.register("angular2/src/facade/intl",[],!0,function(e,t,r){function n(e){return 2==e?"2-digit":"numeric"}function i(e){return 4>e?"short":"long"}function o(e){for(var t,r={},o=0;o=3?r.month=i(s):r.month=n(s);break;case"d":r.day=n(s);break;case"E":r.weekday=i(s);break;case"j":r.hour=n(s);break;case"h":r.hour=n(s),r.hour12=!0;break;case"H":r.hour=n(s),r.hour12=!1;break;case"m":r.minute=n(s);break;case"s":r.second=n(s);break;case"z":r.timeZoneName="long";break;case"Z":r.timeZoneName="short"}o=t}return r}var s=System.global,a=s.define;s.define=void 0,function(e){e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency"}(t.NumberFormatStyle||(t.NumberFormatStyle={}));var c=t.NumberFormatStyle,u=function(){function e(){}return e.format=function(e,t,r,n){var i=void 0===n?{}:n,o=i.minimumIntegerDigits,s=void 0===o?1:o,a=i.minimumFractionDigits,u=void 0===a?0:a,l=i.maximumFractionDigits,p=void 0===l?3:l,f=i.currency,d=i.currencyAsSymbol,h=void 0===d?!1:d,g={minimumIntegerDigits:s,minimumFractionDigits:u,maximumFractionDigits:p};return g.style=c[r].toLowerCase(),r==c.Currency&&(g.currency=f,g.currencyDisplay=h?"symbol":"code"),new Intl.NumberFormat(t,g).format(e)},e}();t.NumberFormatter=u;var l=new Map,p=function(){function e(){}return e.format=function(e,t,r){var n=t+r;if(l.has(n))return l.get(n).format(e);var i=new Intl.DateTimeFormat(t,o(r));return l.set(n,i),i.format(e)},e}();return t.DateFormatter=p,s.define=a,r.exports}),System.register("angular2/src/common/pipes/number_pipe",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/intl","angular2/src/core/di","angular2/src/core/metadata","angular2/src/facade/collection","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/facade/lang"),u=e("angular2/src/facade/exceptions"),l=e("angular2/src/facade/intl"),p=e("angular2/src/core/di"),f=e("angular2/src/core/metadata"),d=e("angular2/src/facade/collection"),h=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),g="en-US",v=c.RegExpWrapper.create("^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$"),m=function(){function e(){}return e._format=function(t,r,n,i,o){if(void 0===i&&(i=null),void 0===o&&(o=!1),c.isBlank(t))return null;if(!c.isNumber(t))throw new h.InvalidPipeArgumentException(e,t);var s=1,a=0,p=3;if(c.isPresent(n)){var f=c.RegExpWrapper.firstMatch(v,n);if(c.isBlank(f))throw new u.BaseException(n+" is not a valid digit info for number pipes");c.isPresent(f[1])&&(s=c.NumberWrapper.parseIntAutoRadix(f[1])),c.isPresent(f[3])&&(a=c.NumberWrapper.parseIntAutoRadix(f[3])),c.isPresent(f[5])&&(p=c.NumberWrapper.parseIntAutoRadix(f[5]))}return l.NumberFormatter.format(t,g,r,{minimumIntegerDigits:s,minimumFractionDigits:a,maximumFractionDigits:p,currency:i,currencyAsSymbol:o})},e=s([c.CONST(),p.Injectable(),a("design:paramtypes",[])],e)}();t.NumberPipe=m;var y=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=d.ListWrapper.first(t);return m._format(e,l.NumberFormatStyle.Decimal,r)},t=s([c.CONST(),f.Pipe({name:"number"}),p.Injectable(),a("design:paramtypes",[])],t)}(m);t.DecimalPipe=y;var _=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=d.ListWrapper.first(t);return m._format(e,l.NumberFormatStyle.Percent,r)},t=s([c.CONST(),f.Pipe({name:"percent"}),p.Injectable(),a("design:paramtypes",[])],t)}(m);t.PercentPipe=_;var b=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=c.isPresent(t)&&t.length>0?t[0]:"USD",n=c.isPresent(t)&&t.length>1?t[1]:!1,i=c.isPresent(t)&&t.length>2?t[2]:null;return m._format(e,l.NumberFormatStyle.Currency,i,r,n)},t=s([c.CONST(),f.Pipe({name:"currency"}),p.Injectable(),a("design:paramtypes",[])],t)}(m);return t.CurrencyPipe=b,n.define=i,r.exports}),System.register("angular2/src/core/linker/directive_resolver",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/metadata","angular2/src/core/reflection/reflection"],!0,function(e,t,r){function n(e){return e instanceof f.DirectiveMetadata}var i=System.global,o=i.define;i.define=void 0;var s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/exceptions"),p=e("angular2/src/facade/collection"),f=e("angular2/src/core/metadata"),d=e("angular2/src/core/reflection/reflection"),h=function(){function e(){}return e.prototype.resolve=function(e){var t=d.reflector.annotations(c.resolveForwardRef(e));if(u.isPresent(t)){var r=t.find(n);if(u.isPresent(r)){var i=d.reflector.propMetadata(e);return this._mergeWithPropertyMetadata(r,i)}}throw new l.BaseException("No Directive annotation found on "+u.stringify(e))},e.prototype._mergeWithPropertyMetadata=function(e,t){var r=[],n=[],i={},o={};return p.StringMapWrapper.forEach(t,function(e,t){e.forEach(function(e){if(e instanceof f.InputMetadata&&(u.isPresent(e.bindingPropertyName)?r.push(t+": "+e.bindingPropertyName):r.push(t)),e instanceof f.OutputMetadata&&(u.isPresent(e.bindingPropertyName)?n.push(t+": "+e.bindingPropertyName):n.push(t)),e instanceof f.HostBindingMetadata&&(u.isPresent(e.hostPropertyName)?i["["+e.hostPropertyName+"]"]=t:i["["+t+"]"]=t),e instanceof f.HostListenerMetadata){var s=u.isPresent(e.args)?e.args.join(", "):"";i["("+e.eventName+")"]=t+"("+s+")"}e instanceof f.ContentChildrenMetadata&&(o[t]=e),e instanceof f.ViewChildrenMetadata&&(o[t]=e),e instanceof f.ContentChildMetadata&&(o[t]=e),e instanceof f.ViewChildMetadata&&(o[t]=e)})}),this._merge(e,r,n,i,o)},e.prototype._merge=function(e,t,r,n,i){var o=u.isPresent(e.inputs)?p.ListWrapper.concat(e.inputs,t):t,s=u.isPresent(e.outputs)?p.ListWrapper.concat(e.outputs,r):r,a=u.isPresent(e.host)?p.StringMapWrapper.merge(e.host,n):n,c=u.isPresent(e.queries)?p.StringMapWrapper.merge(e.queries,i):i;return e instanceof f.ComponentMetadata?new f.ComponentMetadata({selector:e.selector,inputs:o,outputs:s,host:a,exportAs:e.exportAs,moduleId:e.moduleId,queries:c,changeDetection:e.changeDetection,providers:e.providers,viewProviders:e.viewProviders}):new f.DirectiveMetadata({selector:e.selector,inputs:o,outputs:s,host:a,exportAs:e.exportAs,moduleId:e.moduleId,queries:c,providers:e.providers})},e=s([c.Injectable(),a("design:paramtypes",[])],e)}();return t.DirectiveResolver=h,i.define=o,r.exports}),System.register("angular2/src/core/linker/view_resolver",["angular2/src/core/di","angular2/src/core/metadata/view","angular2/src/core/metadata/directives","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/reflection/reflection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/di"),c=e("angular2/src/core/metadata/view"),u=e("angular2/src/core/metadata/directives"),l=e("angular2/src/facade/lang"),p=e("angular2/src/facade/exceptions"),f=e("angular2/src/facade/collection"),d=e("angular2/src/core/reflection/reflection"),h=function(){function e(){this._cache=new f.Map}return e.prototype.resolve=function(e){var t=this._cache.get(e);return l.isBlank(t)&&(t=this._resolve(e),this._cache.set(e,t)),t},e.prototype._resolve=function(e){var t,r;if(d.reflector.annotations(e).forEach(function(e){e instanceof c.ViewMetadata&&(r=e),e instanceof u.ComponentMetadata&&(t=e)}),!l.isPresent(t)){if(l.isBlank(r))throw new p.BaseException("No View decorator found on component '"+l.stringify(e)+"'");return r}if(l.isBlank(t.template)&&l.isBlank(t.templateUrl)&&l.isBlank(r))throw new p.BaseException("Component '"+l.stringify(e)+"' must have either 'template', 'templateUrl', or '@View' set.");if(l.isPresent(t.template)&&l.isPresent(r))this._throwMixingViewAndComponent("template",e);else if(l.isPresent(t.templateUrl)&&l.isPresent(r))this._throwMixingViewAndComponent("templateUrl",e);else if(l.isPresent(t.directives)&&l.isPresent(r))this._throwMixingViewAndComponent("directives",e);else if(l.isPresent(t.pipes)&&l.isPresent(r))this._throwMixingViewAndComponent("pipes",e);else if(l.isPresent(t.encapsulation)&&l.isPresent(r))this._throwMixingViewAndComponent("encapsulation",e);else if(l.isPresent(t.styles)&&l.isPresent(r))this._throwMixingViewAndComponent("styles",e);else{if(!l.isPresent(t.styleUrls)||!l.isPresent(r))return l.isPresent(r)?r:new c.ViewMetadata({templateUrl:t.templateUrl,template:t.template,directives:t.directives,pipes:t.pipes,encapsulation:t.encapsulation,styles:t.styles,styleUrls:t.styleUrls});this._throwMixingViewAndComponent("styleUrls",e)}return null},e.prototype._throwMixingViewAndComponent=function(e,t){throw new p.BaseException("Component '"+l.stringify(t)+"' cannot have both '"+e+"' and '@View' set at the same time\"")},e=o([a.Injectable(),s("design:paramtypes",[])],e)}();return t.ViewResolver=h,n.define=i,r.exports}),System.register("angular2/src/core/render/api",["angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/exceptions"),a=function(){function e(){}return e}();t.RenderProtoViewRef=a;var c=function(){function e(){}return e}();t.RenderFragmentRef=c;var u=function(){function e(){}return e}();t.RenderViewRef=u;var l=function(){function e(){}return e}();t.RenderTemplateCmd=l;var p=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"ngContentIndex",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBound",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(l);t.RenderBeginCmd=p;var f=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(p);t.RenderTextCmd=f;var d=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"index",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngContentIndex",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(l);t.RenderNgContentCmd=d;var h=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attrNameAndValues",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventTargetAndNames",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(p);t.RenderBeginElementCmd=h;var g=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"templateId",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(h);t.RenderBeginComponentCmd=g;var v=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"isMerged",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(h);t.RenderEmbeddedTemplateCmd=v;var m=function(){function e(e,t){this.viewRef=e,this.fragmentRefs=t}return e}();t.RenderViewWithFragments=m;var y=function(){function e(e,t,r,n,i){this.id=e,this.shortId=t,this.encapsulation=r,this.commands=n,this.styles=i}return e}();t.RenderComponentTemplate=y;var _=function(){function e(){}return e}();return t.Renderer=_,n.define=i,r.exports}),System.register("angular2/src/core/pipes/pipe_provider",["angular2/src/core/di/provider","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/di/provider"),a=e("angular2/src/core/di"),c=function(e){function t(t,r,n,i,o){e.call(this,n,i,o),this.name=t,this.pure=r}return o(t,e),t.createFromType=function(e,r){var n=new a.Provider(e,{useClass:e}),i=s.resolveProvider(n);return new t(r.name,r.pure,i.key,i.resolvedFactories,i.multiProvider)},t}(s.ResolvedProvider_);return t.PipeProvider=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/pipes",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e,t){this.pipe=e,this.pure=t}return e}();return t.SelectedPipe=o,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_ref",["angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(e,t,r){function n(e){return e._view}function i(e){return c.isPresent(e)?e._protoView:null}var o=System.global,s=o.define;o.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/facade/lang"),u=e("angular2/src/facade/exceptions");t.internalView=n,t.internalProtoView=i;var l=function(){function e(){}return Object.defineProperty(e.prototype,"changeDetectorRef",{get:function(){return u.unimplemented()},set:function(e){u.unimplemented()},enumerable:!0,configurable:!0}),e}();t.ViewRef=l;var p=function(e){function t(t){e.call(this),this._changeDetectorRef=null,this._view=t}return a(t,e),Object.defineProperty(t.prototype,"render",{get:function(){return this._view.render},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderFragment",{get:function(){return this._view.renderFragment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"changeDetectorRef",{get:function(){return null===this._changeDetectorRef&&(this._changeDetectorRef=this._view.changeDetector.ref),this._changeDetectorRef},enumerable:!0,configurable:!0}),t.prototype.setLocal=function(e,t){this._view.setLocal(e,t)},t}(l);t.ViewRef_=p;var f=function(){function e(){}return e}();t.ProtoViewRef=f;var d=function(e){function t(t){e.call(this),this._protoView=t}return a(t,e),t}(f);return t.ProtoViewRef_=d,o.define=s,r.exports}),System.register("angular2/src/core/render/dom/util",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){return a.StringWrapper.replaceAllMapped(e,c,function(e){return"-"+e[1].toLowerCase()})}function i(e){return a.StringWrapper.replaceAllMapped(e,u,function(e){return e[1].toUpperCase()})}var o=System.global,s=o.define;o.define=void 0;var a=e("angular2/src/facade/lang"),c=/([A-Z])/g,u=/-([a-z])/g;return t.camelCaseToDashCase=n,t.dashCaseToCamelCase=i,o.define=s,r.exports}),System.register("angular2/src/core/linker/element_binder",["angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),s=e("angular2/src/facade/exceptions"),a=function(){function e(e,t,r,n,i,a){if(this.index=e,this.parent=t,this.distanceToParent=r,this.protoElementInjector=n,this.componentDirective=i,this.nestedProtoView=a,o.isBlank(e))throw new s.BaseException("null index not allowed.")}return e}();return t.ElementBinder=a,n.define=i,r.exports}),System.register("angular2/src/core/linker/element_ref",["angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/exceptions"),a=function(){function e(){}return Object.defineProperty(e.prototype,"nativeElement",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderView",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),e}();t.ElementRef=a;var c=function(e){function t(t,r,n){e.call(this),this.parentView=t,this.boundElementIndex=r,this._renderer=n}return o(t,e),Object.defineProperty(t.prototype,"renderView",{get:function(){return this.parentView.render},set:function(e){s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nativeElement",{get:function(){return this._renderer.getNativeElementSync(this)},enumerable:!0,configurable:!0}),t}(a);return t.ElementRef_=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/template_ref",["angular2/src/core/linker/view_ref"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/linker/view_ref"),a=function(){function e(){}return e}();t.TemplateRef=a;var c=function(e){function t(t){e.call(this),this.elementRef=t}return o(t,e),t.prototype._getProtoView=function(){var e=this.elementRef,t=s.internalView(e.parentView);return t.proto.elementBinders[e.boundElementIndex-t.elementOffset].nestedProtoView},Object.defineProperty(t.prototype,"protoViewRef",{get:function(){return this._getProtoView().ref},enumerable:!0,configurable:!0}),t.prototype.hasLocal=function(e){return this._getProtoView().templateVariableBindings.has(e)},t}(a);return t.TemplateRef_=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_pool",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/collection");t.APP_VIEW_POOL_CAPACITY=u.CONST_EXPR(new c.OpaqueToken("AppViewPool.viewPoolCapacity"));var p=function(){function e(e){this._pooledViewsPerProtoView=new l.Map,this._poolCapacityPerProtoView=e}return e.prototype.getView=function(e){var t=this._pooledViewsPerProtoView.get(e);return u.isPresent(t)&&t.length>0?t.pop():null},e.prototype.returnView=function(e){var t=e.proto,r=this._pooledViewsPerProtoView.get(t);u.isBlank(r)&&(r=[],this._pooledViewsPerProtoView.set(t,r));var n=r.length=0;e--)this.remove(e)},Object.defineProperty(e.prototype,"length",{get:function(){return a.unimplemented()},enumerable:!0,configurable:!0}),e}();t.ViewContainerRef=l;var p=function(e){function t(t,r){e.call(this),this.viewManager=t,this.element=r}return o(t,e),t.prototype._getViews=function(){var e=this.element,t=u.internalView(e.parentView).viewContainers[e.boundElementIndex];return c.isPresent(t)?t.views:[]},t.prototype.get=function(e){return this._getViews()[e].ref},Object.defineProperty(t.prototype,"length",{get:function(){return this._getViews().length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.createEmbeddedViewInContainer(this.element,t,e)},t.prototype.createHostView=function(e,t,r){return void 0===e&&(e=null),void 0===t&&(t=-1),void 0===r&&(r=null),-1==t&&(t=this.length),this.viewManager.createHostViewInContainer(this.element,t,e,r)},t.prototype.insert=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.attachViewInContainer(this.element,t,e)},t.prototype.indexOf=function(e){return s.ListWrapper.indexOf(this._getViews(),u.internalView(e))},t.prototype.remove=function(e){void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.destroyViewInContainer(this.element,e)},t.prototype.detach=function(e){return void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.detachViewInContainer(this.element,e)},t}(l);return t.ViewContainerRef_=p,n.define=i,r.exports}),System.register("angular2/src/core/linker/interfaces",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,function(e){e[e.OnInit=0]="OnInit",e[e.OnDestroy=1]="OnDestroy",e[e.DoCheck=2]="DoCheck",e[e.OnChanges=3]="OnChanges",e[e.AfterContentInit=4]="AfterContentInit",e[e.AfterContentChecked=5]="AfterContentChecked",e[e.AfterViewInit=6]="AfterViewInit",e[e.AfterViewChecked=7]="AfterViewChecked"}(t.LifecycleHooks||(t.LifecycleHooks={}));var o=t.LifecycleHooks;return t.LIFECYCLE_HOOKS_VALUES=[o.OnInit,o.OnDestroy,o.DoCheck,o.OnChanges,o.AfterContentInit,o.AfterContentChecked,o.AfterViewInit,o.AfterViewChecked],n.define=i,r.exports}),System.register("angular2/src/core/linker/query_list",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/async"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/collection"),s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/async"),c=function(){function e(){this._results=[],this._emitter=new a.EventEmitter}return Object.defineProperty(e.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return o.ListWrapper.first(this._results)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return o.ListWrapper.last(this._results)},enumerable:!0,configurable:!0}),e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.toArray=function(){return o.ListWrapper.clone(this._results)},e.prototype[s.getSymbolIterator()]=function(){return this._results[s.getSymbolIterator()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=e},e.prototype.notifyOnChanges=function(){this._emitter.next(this)},e}();return t.QueryList=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/event_config",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.EVENT_TARGET_SEPARATOR=":";var o=function(){function e(e,t,r){this.fieldName=e,this.eventName=t,this.isLongForm=r}return e.parse=function(r){var n=r,i=r,o=!1,s=r.indexOf(t.EVENT_TARGET_SEPARATOR);return s>-1&&(n=r.substring(0,s).trim(),i=r.substring(s+1).trim(),o=!0),new e(n,i,o)},e.prototype.getFullName=function(){return this.isLongForm?""+this.fieldName+t.EVENT_TARGET_SEPARATOR+this.eventName:this.eventName},e}();return t.EventConfig=o,n.define=i,r.exports}),System.register("angular2/src/core/linker/pipe_resolver",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/metadata","angular2/src/core/reflection/reflection"],!0,function(e,t,r){function n(e){return e instanceof p.PipeMetadata}var i=System.global,o=i.define;i.define=void 0;var s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/exceptions"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/reflection/reflection"),d=function(){function e(){}return e.prototype.resolve=function(e){var t=f.reflector.annotations(c.resolveForwardRef(e));if(u.isPresent(t)){var r=t.find(n);if(u.isPresent(r))return r}throw new l.BaseException("No Pipe decorator found on "+u.stringify(e))},e=s([c.Injectable(),a("design:paramtypes",[])],e)}();return t.PipeResolver=d,i.define=o,r.exports}),System.register("angular2/src/core/platform_directives_and_pipes",["angular2/src/core/di","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),s=e("angular2/src/facade/lang");return t.PLATFORM_DIRECTIVES=s.CONST_EXPR(new o.OpaqueToken("Platform Directives")),t.PLATFORM_PIPES=s.CONST_EXPR(new o.OpaqueToken("Platform Pipes")),n.define=i,r.exports}),System.register("angular2/src/core/dom/dom_adapter",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){s.isBlank(t.DOM)&&(t.DOM=e)}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang");t.setRootDomAdapter=n;var a=function(){function e(){}return e}();return t.DomAdapter=a,i.define=o,r.exports}),System.register("angular2/src/core/render/dom/dom_tokens",["angular2/src/core/di","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),s=e("angular2/src/facade/lang");return t.DOCUMENT=s.CONST_EXPR(new o.OpaqueToken("DocumentToken")),n.define=i,r.exports}),System.register("angular2/src/animate/css_animation_options",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){this.classesToAdd=[],this.classesToRemove=[],this.animationClasses=[]}return e}();return t.CssAnimationOptions=o,n.define=i,r.exports}),System.register("angular2/src/facade/math",["angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang");return t.Math=o.global.Math,t.NaN=typeof t.NaN,n.define=i,r.exports}),System.register("angular2/src/animate/browser_details",["angular2/src/core/di","angular2/src/facade/math","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/di"),c=e("angular2/src/facade/math"),u=e("angular2/src/core/dom/dom_adapter"),l=function(){function e(){this.elapsedTimeIncludesDelay=!1,this.doesElapsedTimeIncludesDelay()}return e.prototype.doesElapsedTimeIncludesDelay=function(){var e=this,t=u.DOM.createElement("div");u.DOM.setAttribute(t,"style","position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"),this.raf(function(r){u.DOM.on(t,"transitionend",function(r){var n=c.Math.round(1e3*r.elapsedTime);e.elapsedTimeIncludesDelay=2==n,u.DOM.remove(t)}),u.DOM.setStyle(t,"width","2px")},2)},e.prototype.raf=function(e,t){void 0===t&&(t=1);var r=new p(e,t);return function(){return r.cancel()}},e=o([a.Injectable(),s("design:paramtypes",[])],e)}();t.BrowserDetails=l;var p=function(){function e(e,t){this.callback=e,this.frames=t,this._raf()}return e.prototype._raf=function(){var e=this;this.currentFrameId=u.DOM.requestAnimationFrame(function(t){return e._nextFrame(t)})},e.prototype._nextFrame=function(e){this.frames--,this.frames>0?this._raf():this.callback(e)},e.prototype.cancel=function(){u.DOM.cancelAnimationFrame(this.currentFrameId),this.currentFrameId=null},e}();return n.define=i,r.exports}),System.register("angular2/src/core/zone/ng_zone",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/async","angular2/src/core/profile/profile"],!0,function(e,t,r){ +var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/collection"),s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/async"),c=e("angular2/src/core/profile/profile"),u=function(){function e(e,t){this.error=e,this.stackTrace=t}return e}();t.NgZoneError=u;var l=function(){function e(e){var t=e.enableLongStackTrace;this._runScope=c.wtfCreateScope("NgZone#run()"),this._microtaskScope=c.wtfCreateScope("NgZone#microtask()"),this._pendingMicrotasks=0,this._hasExecutedCodeInInnerZone=!1,this._nestedRun=0,this._inVmTurnDone=!1,this._pendingTimeouts=[],s.global.zone?(this._disabled=!1,this._mountZone=s.global.zone,this._innerZone=this._createInnerZone(this._mountZone,t)):(this._disabled=!0,this._mountZone=null),this._onTurnStartEvents=new a.EventEmitter(!1),this._onTurnDoneEvents=new a.EventEmitter(!1),this._onEventDoneEvents=new a.EventEmitter(!1),this._onErrorEvents=new a.EventEmitter(!1)}return e.prototype.overrideOnTurnStart=function(e){this._onTurnStart=s.normalizeBlank(e)},Object.defineProperty(e.prototype,"onTurnStart",{get:function(){return this._onTurnStartEvents},enumerable:!0,configurable:!0}),e.prototype._notifyOnTurnStart=function(e){var t=this;e.call(this._innerZone,function(){t._onTurnStartEvents.next(null)})},e.prototype.overrideOnTurnDone=function(e){this._onTurnDone=s.normalizeBlank(e)},Object.defineProperty(e.prototype,"onTurnDone",{get:function(){return this._onTurnDoneEvents},enumerable:!0,configurable:!0}),e.prototype._notifyOnTurnDone=function(e){var t=this;e.call(this._innerZone,function(){t._onTurnDoneEvents.next(null)})},e.prototype.overrideOnEventDone=function(e,t){var r=this;void 0===t&&(t=!1);var n=s.normalizeBlank(e);t?this._onEventDone=function(){r._pendingTimeouts.length||n()}:this._onEventDone=n},Object.defineProperty(e.prototype,"onEventDone",{get:function(){return this._onEventDoneEvents},enumerable:!0,configurable:!0}),e.prototype._notifyOnEventDone=function(){var e=this;this.runOutsideAngular(function(){e._onEventDoneEvents.next(null)})},Object.defineProperty(e.prototype,"hasPendingMicrotasks",{get:function(){return this._pendingMicrotasks>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPendingTimers",{get:function(){return this._pendingTimeouts.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPendingAsyncTasks",{get:function(){return this.hasPendingMicrotasks||this.hasPendingTimers},enumerable:!0,configurable:!0}),e.prototype.overrideOnErrorHandler=function(e){this._onErrorHandler=s.normalizeBlank(e)},Object.defineProperty(e.prototype,"onError",{get:function(){return this._onErrorEvents},enumerable:!0,configurable:!0}),e.prototype.run=function(e){if(this._disabled)return e();var t=this._runScope();try{return this._innerZone.run(e)}finally{c.wtfLeave(t)}},e.prototype.runOutsideAngular=function(e){return this._disabled?e():this._mountZone.run(e)},e.prototype._createInnerZone=function(e,t){var r,n=this._microtaskScope,i=this;return r=t?o.StringMapWrapper.merge(Zone.longStackTraceZone,{onError:function(e){i._notifyOnError(this,e)}}):{onError:function(e){i._notifyOnError(this,e)}},e.fork(r).fork({$run:function(e){return function(){try{return i._nestedRun++,i._hasExecutedCodeInInnerZone||(i._hasExecutedCodeInInnerZone=!0,i._notifyOnTurnStart(e),i._onTurnStart&&e.call(i._innerZone,i._onTurnStart)),e.apply(this,arguments)}finally{if(i._nestedRun--,0==i._pendingMicrotasks&&0==i._nestedRun&&!this._inVmTurnDone){if(i._hasExecutedCodeInInnerZone)try{this._inVmTurnDone=!0,i._notifyOnTurnDone(e),i._onTurnDone&&e.call(i._innerZone,i._onTurnDone)}finally{this._inVmTurnDone=!1,i._hasExecutedCodeInInnerZone=!1}0===i._pendingMicrotasks&&(i._notifyOnEventDone(),s.isPresent(i._onEventDone)&&i.runOutsideAngular(i._onEventDone))}}}},$scheduleMicrotask:function(e){return function(t){i._pendingMicrotasks++;var r=function(){var e=n();try{t()}finally{i._pendingMicrotasks--,c.wtfLeave(e)}};e.call(this,r)}},$setTimeout:function(e){return function(t,r){for(var n=[],s=2;s")),t.APP_COMPONENT=c.CONST_EXPR(new a.OpaqueToken("AppComponent")),t.APP_ID=c.CONST_EXPR(new a.OpaqueToken("AppId")),t.APP_ID_RANDOM_PROVIDER=c.CONST_EXPR(new a.Provider(t.APP_ID,{useFactory:n,deps:[]})),o.define=s,r.exports}),System.register("angular2/src/core/linker/dynamic_component_loader",["angular2/src/core/di","angular2/src/core/linker/compiler","angular2/src/facade/lang","angular2/src/core/linker/view_manager"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/linker/compiler"),l=e("angular2/src/facade/lang"),p=e("angular2/src/core/linker/view_manager"),f=function(){function e(){}return Object.defineProperty(e.prototype,"hostView",{get:function(){return this.location.parentView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostComponent",{get:function(){return this.instance},enumerable:!0,configurable:!0}),e}();t.ComponentRef=f;var d=function(e){function t(t,r,n,i,o){e.call(this),this._dispose=o,this.location=t,this.instance=r,this.componentType=n,this.injector=i}return o(t,e),Object.defineProperty(t.prototype,"hostComponentType",{get:function(){return this.componentType},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._dispose()},t}(f);t.ComponentRef_=d;var h=function(){function e(){}return e}();t.DynamicComponentLoader=h;var g=function(e){function t(t,r){e.call(this),this._compiler=t,this._viewManager=r}return o(t,e),t.prototype.loadAsRoot=function(e,t,r,n){var i=this;return this._compiler.compileInHost(e).then(function(o){var s=i._viewManager.createRootHostView(o,t,r),a=i._viewManager.getHostElement(s),c=i._viewManager.getComponent(a),u=function(){i._viewManager.destroyRootHostView(s),l.isPresent(n)&&n()};return new d(a,c,e,r,u)})},t.prototype.loadIntoLocation=function(e,t,r,n){return void 0===n&&(n=null),this.loadNextToLocation(e,this._viewManager.getNamedElementInComponentView(t,r),n)},t.prototype.loadNextToLocation=function(e,t,r){var n=this;return void 0===r&&(r=null),this._compiler.compileInHost(e).then(function(i){var o=n._viewManager.getViewContainer(t),s=o.createHostView(i,o.length,r),a=n._viewManager.getHostElement(s),c=n._viewManager.getComponent(a),u=function(){var e=o.indexOf(s);-1!==e&&o.remove(e)};return new d(a,c,e,null,u)})},t=s([c.Injectable(),a("design:paramtypes",[u.Compiler,p.AppViewManager])],t)}(h);return t.DynamicComponentLoader_=g,n.define=i,r.exports}),System.register("angular2/src/common/directives/ng_for",["angular2/src/core/metadata","angular2/src/core/change_detection","angular2/src/core/linker","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/metadata"),c=e("angular2/src/core/change_detection"),u=e("angular2/src/core/linker"),l=e("angular2/src/facade/lang"),p=function(){function e(e,t,r,n){this._viewContainer=e,this._templateRef=t,this._iterableDiffers=r,this._cdr=n}return Object.defineProperty(e.prototype,"ngForOf",{set:function(e){this._ngForOf=e,l.isBlank(this._differ)&&l.isPresent(e)&&(this._differ=this._iterableDiffers.find(e).create(this._cdr))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){l.isPresent(e)&&(this._templateRef=e)},enumerable:!0,configurable:!0}),e.prototype.doCheck=function(){if(l.isPresent(this._differ)){var e=this._differ.diff(this._ngForOf);l.isPresent(e)&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=[];e.forEachRemovedItem(function(e){return t.push(new f(e,null))}),e.forEachMovedItem(function(e){return t.push(new f(e,null))});var r=this._bulkRemove(t);e.forEachAddedItem(function(e){return r.push(new f(e,null))}),this._bulkInsert(r);for(var n=0;nn;n++)this._viewContainer.get(n).setLocal("last",n===i-1)},e.prototype._perViewChange=function(e,t){e.setLocal("$implicit",t.item),e.setLocal("index",t.currentIndex),e.setLocal("even",t.currentIndex%2==0),e.setLocal("odd",t.currentIndex%2==1)},e.prototype._bulkRemove=function(e){e.sort(function(e,t){return e.record.previousIndex-t.record.previousIndex});for(var t=[],r=e.length-1;r>=0;r--){var n=e[r];l.isPresent(n.record.currentIndex)?(n.view=this._viewContainer.detach(n.record.previousIndex),t.push(n)):this._viewContainer.remove(n.record.previousIndex)}return t},e.prototype._bulkInsert=function(e){e.sort(function(e,t){return e.record.currentIndex-t.record.currentIndex});for(var t=0;tt?{maxlength:{requiredLength:t,actualLength:n.length}}:null}},e.nullValidator=function(e){return null},e.compose=function(e){if(c.isBlank(e))return null;var t=e.filter(c.isPresent);return 0==t.length?null:function(e){return o(i(e,t))}},e.composeAsync=function(e){if(c.isBlank(e))return null;var t=e.filter(c.isPresent);return 0==t.length?null:function(e){var r=i(e,t).map(n);return u.PromiseWrapper.all(r).then(o)}},e}();return t.Validators=d,s.define=a,r.exports}),System.register("angular2/src/common/forms/directives/default_value_accessor",["angular2/src/core/metadata","angular2/src/core/linker","angular2/src/core/render","angular2/src/core/di","angular2/src/common/forms/directives/control_value_accessor","angular2/src/facade/lang","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/metadata"),c=e("angular2/src/core/linker"),u=e("angular2/src/core/render"),l=e("angular2/src/core/di"),p=e("angular2/src/common/forms/directives/control_value_accessor"),f=e("angular2/src/facade/lang"),d=e("angular2/src/common/forms/directives/shared"),h=f.CONST_EXPR(new l.Provider(p.NG_VALUE_ACCESSOR,{useExisting:l.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){var t=f.isBlank(e)?"":e;d.setProperty(this._renderer,this._elementRef,"value",t)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e=o([a.Directive({selector:"input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[h]}),s("design:paramtypes",[u.Renderer,c.ElementRef])],e)}();return t.DefaultValueAccessor=g,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/number_value_accessor",["angular2/src/core/metadata","angular2/src/core/linker","angular2/src/core/render","angular2/src/core/di","angular2/src/common/forms/directives/control_value_accessor","angular2/src/facade/lang","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/metadata"),c=e("angular2/src/core/linker"),u=e("angular2/src/core/render"),l=e("angular2/src/core/di"),p=e("angular2/src/common/forms/directives/control_value_accessor"),f=e("angular2/src/facade/lang"),d=e("angular2/src/common/forms/directives/shared"),h=f.CONST_EXPR(new l.Provider(p.NG_VALUE_ACCESSOR,{useExisting:l.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){d.setProperty(this._renderer,this._elementRef,"value",e)},e.prototype.registerOnChange=function(e){this.onChange=function(t){e(f.NumberWrapper.parseFloat(t))}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e=o([a.Directive({selector:"input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[h]}),s("design:paramtypes",[u.Renderer,c.ElementRef])],e)}();return t.NumberValueAccessor=g,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/checkbox_value_accessor",["angular2/src/core/metadata","angular2/src/core/render","angular2/src/core/linker","angular2/src/core/di","angular2/src/common/forms/directives/control_value_accessor","angular2/src/facade/lang","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/metadata"),c=e("angular2/src/core/render"),u=e("angular2/src/core/linker"),l=e("angular2/src/core/di"),p=e("angular2/src/common/forms/directives/control_value_accessor"),f=e("angular2/src/facade/lang"),d=e("angular2/src/common/forms/directives/shared"),h=f.CONST_EXPR(new l.Provider(p.NG_VALUE_ACCESSOR,{useExisting:l.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){d.setProperty(this._renderer,this._elementRef,"checked",e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e=o([a.Directive({selector:"input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},bindings:[h]}),s("design:paramtypes",[c.Renderer,u.ElementRef])],e)}();return t.CheckboxControlValueAccessor=g,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/select_control_value_accessor",["angular2/src/core/di","angular2/src/core/render","angular2/src/core/linker","angular2/src/core/metadata","angular2/src/facade/async","angular2/src/common/forms/directives/control_value_accessor","angular2/src/facade/lang","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/core/render"),l=e("angular2/src/core/linker"),p=e("angular2/src/core/metadata"),f=e("angular2/src/facade/async"),d=e("angular2/src/common/forms/directives/control_value_accessor"),h=e("angular2/src/facade/lang"),g=e("angular2/src/common/forms/directives/shared"),v=h.CONST_EXPR(new c.Provider(d.NG_VALUE_ACCESSOR,{useExisting:c.forwardRef(function(){return y}),multi:!0})),m=function(){function e(){}return e=o([p.Directive({selector:"option"}),s("design:paramtypes",[])],e)}();t.NgSelectOption=m;var y=function(){function e(e,t,r){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){},this._updateValueWhenListOfOptionsChanges(r)}return e.prototype.writeValue=function(e){this.value=e,g.setProperty(this._renderer,this._elementRef,"value",e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype._updateValueWhenListOfOptionsChanges=function(e){var t=this;f.ObservableWrapper.subscribe(e.changes,function(e){return t.writeValue(t.value)})},e=o([p.Directive({selector:"select[ng-control],select[ng-form-control],select[ng-model]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[v]}),a(2,p.Query(m,{descendants:!0})),s("design:paramtypes",[u.Renderer,l.ElementRef,l.QueryList])],e)}();return t.SelectControlValueAccessor=y,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/normalize_validator",[],!0,function(e,t,r){function n(e){return void 0!==e.validate?function(t){return e.validate(t)}:e}var i=System.global,o=i.define;return i.define=void 0,t.normalizeValidator=n,i.define=o,r.exports}),System.register("angular2/src/common/forms/directives/ng_form_control",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/ng_control","angular2/src/common/forms/validators","angular2/src/common/forms/directives/control_value_accessor","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/collection"),p=e("angular2/src/facade/async"),f=e("angular2/src/core/metadata"),d=e("angular2/src/core/di"),h=e("angular2/src/common/forms/directives/ng_control"),g=e("angular2/src/common/forms/validators"),v=e("angular2/src/common/forms/directives/control_value_accessor"),m=e("angular2/src/common/forms/directives/shared"),y=u.CONST_EXPR(new d.Provider(h.NgControl,{useExisting:d.forwardRef(function(){return _})})),_=function(e){function t(t,r,n){e.call(this),this._validators=t,this._asyncValidators=r,this.update=new p.EventEmitter,this.valueAccessor=m.selectValueAccessor(this,n)}return o(t,e),t.prototype.onChanges=function(e){this._isControlChanged(e)&&(m.setUpControl(this.form,this),this.form.updateValueAndValidity({emitEvent:!1})),m.isPropertyUpdated(e,this.viewModel)&&(this.form.updateValue(this.model),this.viewModel=this.model)},Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return m.composeValidators(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return m.composeAsyncValidators(this._asyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,p.ObservableWrapper.callNext(this.update,e)},t.prototype._isControlChanged=function(e){return l.StringMapWrapper.contains(e,"form")},t=s([f.Directive({selector:"[ng-form-control]",bindings:[y],inputs:["form: ngFormControl","model: ngModel"],outputs:["update: ngModelChange"],exportAs:"form"}),c(0,d.Optional()),c(0,d.Inject(g.NG_VALIDATORS)),c(1,d.Optional()),c(1,d.Inject(g.NG_ASYNC_VALIDATORS)),c(2,d.Optional()),c(2,d.Inject(v.NG_VALUE_ACCESSOR)),a("design:paramtypes",[Array,Array,Array])],t)}(h.NgControl);return t.NgFormControl=_,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_model",["angular2/src/facade/lang","angular2/src/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/control_value_accessor","angular2/src/common/forms/directives/ng_control","angular2/src/common/forms/model","angular2/src/common/forms/validators","angular2/src/common/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/common/forms/directives/control_value_accessor"),h=e("angular2/src/common/forms/directives/ng_control"),g=e("angular2/src/common/forms/model"),v=e("angular2/src/common/forms/validators"),m=e("angular2/src/common/forms/directives/shared"),y=u.CONST_EXPR(new f.Provider(h.NgControl,{useExisting:f.forwardRef(function(){return _})})),_=function(e){function t(t,r,n){e.call(this),this._validators=t,this._asyncValidators=r,this._control=new g.Control,this._added=!1,this.update=new l.EventEmitter,this.valueAccessor=m.selectValueAccessor(this,n)}return o(t,e),t.prototype.onChanges=function(e){this._added||(m.setUpControl(this._control,this),this._control.updateValueAndValidity({emitEvent:!1}),this._added=!0),m.isPropertyUpdated(e,this.viewModel)&&(this._control.updateValue(this.model),this.viewModel=this.model)},Object.defineProperty(t.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return m.composeValidators(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return m.composeAsyncValidators(this._asyncValidators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,l.ObservableWrapper.callNext(this.update,e)},t=s([p.Directive({selector:"[ng-model]:not([ng-control]):not([ng-form-control])",bindings:[y],inputs:["model: ngModel"],outputs:["update: ngModelChange"],exportAs:"form"}),c(0,f.Optional()),c(0,f.Inject(v.NG_VALIDATORS)),c(1,f.Optional()),c(1,f.Inject(v.NG_ASYNC_VALIDATORS)),c(2,f.Optional()),c(2,f.Inject(d.NG_VALUE_ACCESSOR)),a("design:paramtypes",[Array,Array,Array])],t)}(h.NgControl);return t.NgModel=_,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_control_group",["angular2/src/core/metadata","angular2/src/core/di","angular2/src/facade/lang","angular2/src/common/forms/directives/control_container","angular2/src/common/forms/directives/shared","angular2/src/common/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/metadata"),l=e("angular2/src/core/di"),p=e("angular2/src/facade/lang"),f=e("angular2/src/common/forms/directives/control_container"),d=e("angular2/src/common/forms/directives/shared"),h=e("angular2/src/common/forms/validators"),g=p.CONST_EXPR(new l.Provider(f.ControlContainer,{useExisting:l.forwardRef(function(){return v})})),v=function(e){function t(t,r,n){e.call(this),this._validators=r,this._asyncValidators=n,this._parent=t}return o(t,e),t.prototype.onInit=function(){this.formDirective.addControlGroup(this)},t.prototype.onDestroy=function(){this.formDirective.removeControlGroup(this)},Object.defineProperty(t.prototype,"control",{get:function(){return this.formDirective.getControlGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return d.controlPath(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent.formDirective},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return d.composeValidators(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return d.composeAsyncValidators(this._asyncValidators)},enumerable:!0,configurable:!0}),t=s([u.Directive({selector:"[ng-control-group]",providers:[g],inputs:["name: ng-control-group"],exportAs:"form"}),c(0,l.Host()),c(0,l.SkipSelf()),c(1,l.Optional()),c(1,l.Inject(h.NG_VALIDATORS)),c(2,l.Optional()),c(2,l.Inject(h.NG_ASYNC_VALIDATORS)),a("design:paramtypes",[f.ControlContainer,Array,Array])],t)}(f.ControlContainer);return t.NgControlGroup=v,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_form_model",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/control_container","angular2/src/common/forms/directives/shared","angular2/src/common/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/collection"),p=e("angular2/src/facade/async"),f=e("angular2/src/core/metadata"),d=e("angular2/src/core/di"),h=e("angular2/src/common/forms/directives/control_container"),g=e("angular2/src/common/forms/directives/shared"),v=e("angular2/src/common/forms/validators"),m=u.CONST_EXPR(new d.Provider(h.ControlContainer,{useExisting:d.forwardRef(function(){return y})})),y=function(e){function t(t,r){e.call(this),this._validators=t,this._asyncValidators=r,this.form=null,this.directives=[],this.ngSubmit=new p.EventEmitter}return o(t,e),t.prototype.onChanges=function(e){if(l.StringMapWrapper.contains(e,"form")){var t=g.composeValidators(this._validators);this.form.validator=v.Validators.compose([this.form.validator,t]);var r=g.composeAsyncValidators(this._asyncValidators);this.form.asyncValidator=v.Validators.composeAsync([this.form.asyncValidator,r]),this.form.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}this._updateDomValue()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this.form.find(e.path);g.setUpControl(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e)},t.prototype.getControl=function(e){return this.form.find(e.path)},t.prototype.removeControl=function(e){l.ListWrapper.remove(this.directives,e)},t.prototype.addControlGroup=function(e){var t=this.form.find(e.path);g.setUpControlGroup(t,e),t.updateValueAndValidity({emitEvent:!1})},t.prototype.removeControlGroup=function(e){},t.prototype.getControlGroup=function(e){return this.form.find(e.path)},t.prototype.updateModel=function(e,t){var r=this.form.find(e.path);r.updateValue(t)},t.prototype.onSubmit=function(){return p.ObservableWrapper.callNext(this.ngSubmit,null),!1},t.prototype._updateDomValue=function(){var e=this;this.directives.forEach(function(t){var r=e.form.find(t.path);t.valueAccessor.writeValue(r.value)})},t=s([f.Directive({selector:"[ng-form-model]",bindings:[m],inputs:["form: ng-form-model"],host:{"(submit)":"onSubmit()"},outputs:["ngSubmit"],exportAs:"form"}),c(0,d.Optional()),c(0,d.Inject(v.NG_VALIDATORS)),c(1,d.Optional()),c(1,d.Inject(v.NG_ASYNC_VALIDATORS)),a("design:paramtypes",[Array,Array])],t)}(h.ControlContainer);return t.NgFormModel=y,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_form",["angular2/src/facade/async","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/control_container","angular2/src/common/forms/model","angular2/src/common/forms/directives/shared","angular2/src/common/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/async"),l=e("angular2/src/facade/collection"),p=e("angular2/src/facade/lang"),f=e("angular2/src/core/metadata"),d=e("angular2/src/core/di"),h=e("angular2/src/common/forms/directives/control_container"),g=e("angular2/src/common/forms/model"),v=e("angular2/src/common/forms/directives/shared"),m=e("angular2/src/common/forms/validators"),y=p.CONST_EXPR(new d.Provider(h.ControlContainer,{useExisting:d.forwardRef(function(){return _})})),_=function(e){function t(t,r){e.call(this),this.ngSubmit=new u.EventEmitter,this.form=new g.ControlGroup({},null,v.composeValidators(t),v.composeAsyncValidators(r))}return o(t,e),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;u.PromiseWrapper.scheduleMicrotask(function(){var r=t._findContainer(e.path),n=new g.Control;v.setUpControl(n,e),r.addControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})},t.prototype.getControl=function(e){return this.form.find(e.path)},t.prototype.removeControl=function(e){var t=this;u.PromiseWrapper.scheduleMicrotask(function(){var r=t._findContainer(e.path);p.isPresent(r)&&(r.removeControl(e.name),r.updateValueAndValidity({emitEvent:!1}))})},t.prototype.addControlGroup=function(e){var t=this;u.PromiseWrapper.scheduleMicrotask(function(){var r=t._findContainer(e.path),n=new g.ControlGroup({});v.setUpControlGroup(n,e),r.addControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})},t.prototype.removeControlGroup=function(e){var t=this;u.PromiseWrapper.scheduleMicrotask(function(){var r=t._findContainer(e.path);p.isPresent(r)&&(r.removeControl(e.name),r.updateValueAndValidity({emitEvent:!1}))})},t.prototype.getControlGroup=function(e){return this.form.find(e.path)},t.prototype.updateModel=function(e,t){var r=this;u.PromiseWrapper.scheduleMicrotask(function(){var n=r.form.find(e.path);n.updateValue(t)})},t.prototype.onSubmit=function(){return u.ObservableWrapper.callNext(this.ngSubmit,null),!1},t.prototype._findContainer=function(e){return e.pop(),l.ListWrapper.isEmpty(e)?this.form:this.form.find(e)},t=s([f.Directive({selector:"form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]",bindings:[y],host:{"(submit)":"onSubmit()"},outputs:["ngSubmit"],exportAs:"form"}),c(0,d.Optional()),c(0,d.Inject(m.NG_VALIDATORS)),c(1,d.Optional()),c(1,d.Inject(m.NG_ASYNC_VALIDATORS)),a("design:paramtypes",[Array,Array])],t)}(h.ControlContainer);return t.NgForm=_,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_control_status",["angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/ng_control","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/metadata"),u=e("angular2/src/core/di"),l=e("angular2/src/common/forms/directives/ng_control"),p=e("angular2/src/facade/lang"),f=function(){function e(e){this._cd=e}return Object.defineProperty(e.prototype,"ngClassUntouched",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.untouched:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassTouched",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.touched:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassPristine",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.pristine:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassDirty",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.dirty:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassValid",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.valid:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassInvalid",{get:function(){return p.isPresent(this._cd.control)?!this._cd.control.valid:!1; +},enumerable:!0,configurable:!0}),e=o([c.Directive({selector:"[ng-control],[ng-model],[ng-form-control]",host:{"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid"}}),a(0,u.Self()),s("design:paramtypes",[l.NgControl])],e)}();return t.NgControlStatus=f,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/validators",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/core/metadata","angular2/src/common/forms/validators","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/facade/lang"),l=e("angular2/src/core/metadata"),p=e("angular2/src/common/forms/validators"),f=e("angular2/src/facade/lang"),d=u.CONST_EXPR(new c.Provider(p.NG_VALIDATORS,{useValue:p.Validators.required,multi:!0})),h=function(){function e(){}return e=o([l.Directive({selector:"[required][ng-control],[required][ng-form-control],[required][ng-model]",providers:[d]}),s("design:paramtypes",[])],e)}();t.RequiredValidator=h;var g=u.CONST_EXPR(new c.Provider(p.NG_VALIDATORS,{useExisting:c.forwardRef(function(){return v}),multi:!0})),v=function(){function e(e){this._validator=p.Validators.minLength(f.NumberWrapper.parseInt(e,10))}return e.prototype.validate=function(e){return this._validator(e)},e=o([l.Directive({selector:"[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]",providers:[g]}),a(0,l.Attribute("minlength")),s("design:paramtypes",[String])],e)}();t.MinLengthValidator=v;var m=u.CONST_EXPR(new c.Provider(p.NG_VALIDATORS,{useExisting:c.forwardRef(function(){return y}),multi:!0})),y=function(){function e(e){this._validator=p.Validators.maxLength(f.NumberWrapper.parseInt(e,10))}return e.prototype.validate=function(e){return this._validator(e)},e=o([l.Directive({selector:"[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]",providers:[m]}),a(0,l.Attribute("maxlength")),s("design:paramtypes",[String])],e)}();return t.MaxLengthValidator=y,n.define=i,r.exports}),System.register("angular2/src/common/forms/form_builder",["angular2/src/core/di","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/common/forms/model"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/core/di"),c=e("angular2/src/facade/collection"),u=e("angular2/src/facade/lang"),l=e("angular2/src/common/forms/model"),p=function(){function e(){}return e.prototype.group=function(e,t){void 0===t&&(t=null);var r=this._reduceControls(e),n=u.isPresent(t)?c.StringMapWrapper.get(t,"optionals"):null,i=u.isPresent(t)?c.StringMapWrapper.get(t,"validator"):null,o=u.isPresent(t)?c.StringMapWrapper.get(t,"asyncValidator"):null;return new l.ControlGroup(r,n,i,o)},e.prototype.control=function(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=null),new l.Control(e,t,r)},e.prototype.array=function(e,t,r){var n=this;void 0===t&&(t=null),void 0===r&&(r=null);var i=e.map(function(e){return n._createControl(e)});return new l.ControlArray(i,t,r)},e.prototype._reduceControls=function(e){var t=this,r={};return c.StringMapWrapper.forEach(e,function(e,n){r[n]=t._createControl(e)}),r},e.prototype._createControl=function(e){if(e instanceof l.Control||e instanceof l.ControlGroup||e instanceof l.ControlArray)return e;if(u.isArray(e)){var t=e[0],r=e.length>1?e[1]:null,n=e.length>2?e[2]:null;return this.control(t,r,n)}return this.control(e)},e=o([a.Injectable(),s("design:paramtypes",[])],e)}();return t.FormBuilder=p,t.FORM_PROVIDERS=u.CONST_EXPR([p]),t.FORM_BINDINGS=t.FORM_PROVIDERS,n.define=i,r.exports}),System.register("angular2/src/common/common_directives",["angular2/src/facade/lang","angular2/src/common/forms","angular2/src/common/directives"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),s=e("angular2/src/common/forms"),a=e("angular2/src/common/directives");return t.COMMON_DIRECTIVES=o.CONST_EXPR([a.CORE_DIRECTIVES,s.FORM_DIRECTIVES]),n.define=i,r.exports}),System.register("angular2/src/core/util",["angular2/src/core/util/decorators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/util/decorators");return t.Class=o.Class,n.define=i,r.exports}),System.register("angular2/src/facade/facade",["angular2/src/facade/lang","angular2/src/facade/async","angular2/src/facade/exceptions","angular2/src/facade/exception_handler"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang");t.Type=o.Type;var s=e("angular2/src/facade/async");t.Observable=s.Observable,t.EventEmitter=s.EventEmitter;var a=e("angular2/src/facade/exceptions");t.WrappedException=a.WrappedException;var c=e("angular2/src/facade/exception_handler");return t.ExceptionHandler=c.ExceptionHandler,n.define=i,r.exports}),System.register("angular2/src/compiler/selector",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/collection"),s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/exceptions"),c="",u=s.RegExpWrapper.create("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)"),l=function(){function e(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return e.parse=function(t){for(var r,n=[],i=function(e,t){t.notSelectors.length>0&&s.isBlank(t.element)&&o.ListWrapper.isEmpty(t.classNames)&&o.ListWrapper.isEmpty(t.attrs)&&(t.element="*"),e.push(t)},c=new e,l=s.RegExpWrapper.matcher(u,t),p=c,f=!1;s.isPresent(r=s.RegExpMatcherWrapper.next(l));){if(s.isPresent(r[1])){if(f)throw new a.BaseException("Nesting :not is not allowed in a selector");f=!0,p=new e,c.notSelectors.push(p)}if(s.isPresent(r[2])&&p.setElement(r[2]),s.isPresent(r[3])&&p.addClassName(r[3]),s.isPresent(r[4])&&p.addAttribute(r[4],r[5]),s.isPresent(r[6])&&(f=!1,p=c),s.isPresent(r[7])){if(f)throw new a.BaseException("Multiple selectors in :not are not supported");i(n,c),c=p=new e}}return i(n,c),n},e.prototype.isElementSelector=function(){return s.isPresent(this.element)&&o.ListWrapper.isEmpty(this.classNames)&&o.ListWrapper.isEmpty(this.attrs)&&0===this.notSelectors.length},e.prototype.setElement=function(e){void 0===e&&(e=null),s.isPresent(e)&&(e=e.toLowerCase()),this.element=e},e.prototype.getMatchingElementTemplate=function(){for(var e=s.isPresent(this.element)?this.element:"div",t=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",r="",n=0;n"},e.prototype.addAttribute=function(e,t){void 0===t&&(t=c),this.attrs.push(e.toLowerCase()),t=s.isPresent(t)?t.toLowerCase():c,this.attrs.push(t)},e.prototype.addClassName=function(e){this.classNames.push(e.toLowerCase())},e.prototype.toString=function(){var e="";if(s.isPresent(this.element)&&(e+=this.element),s.isPresent(this.classNames))for(var t=0;t0&&(e+="="+n),e+="]"}return this.notSelectors.forEach(function(t){return e+=":not("+t+")"}),e},e}();t.CssSelector=l;var p=function(){function e(){this._elementMap=new o.Map,this._elementPartialMap=new o.Map,this._classMap=new o.Map,this._classPartialMap=new o.Map,this._attrValueMap=new o.Map,this._attrValuePartialMap=new o.Map,this._listContexts=[]}return e.createNotMatcher=function(t){var r=new e;return r.addSelectables(t,null),r},e.prototype.addSelectables=function(e,t){var r=null;e.length>1&&(r=new f(e),this._listContexts.push(r));for(var n=0;n0&&(s.isBlank(this.listContext)||!this.listContext.alreadyMatched)){var n=p.createNotMatcher(this.notSelectors);r=!n.match(e,null)}return r&&s.isPresent(t)&&(s.isBlank(this.listContext)||!this.listContext.alreadyMatched)&&(s.isPresent(this.listContext)&&(this.listContext.alreadyMatched=!0),t(this.selector,this.cbContext)),r},e}();return t.SelectorContext=d,n.define=i,r.exports}),System.register("angular2/src/compiler/util",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){return g.StringWrapper.replaceAllMapped(e,v,function(e){return"-"+e[1].toLowerCase()})}function i(e){return g.StringWrapper.replaceAllMapped(e,m,function(e){return e[1].toUpperCase()})}function o(e){return g.isBlank(e)?null:"'"+a(e,y)+"'"}function s(e){return g.isBlank(e)?null:'"'+a(e,_)+'"'}function a(e,t){return g.StringWrapper.replaceAllMapped(e,t,function(e){return"$"==e[0]?g.IS_DART?"\\$":"$":"\n"==e[0]?"\\n":"\\"+e[0]})}function c(e){return g.IS_DART?"const "+e+" = ":"var "+e+" = exports['"+e+"'] = "}function u(e){return g.IS_DART?"const "+e:"new "+e}function l(e,t,r){return void 0===r&&(r=""),g.IS_DART?r+"("+e.join(",")+") => "+t:"function "+r+"("+e.join(",")+") { return "+t+"; }"}function p(e){return g.IS_DART?"'${"+e+"}'":e}function f(e,t){var r=g.StringWrapper.split(e.trim(),/\s*:\s*/g);return r.length>1?r:t}var d=System.global,h=d.define;d.define=void 0;var g=e("angular2/src/facade/lang"),v=/([A-Z])/g,m=/-([a-z])/g,y=/'|\\|\n|\$/g,_=/"|\\|\n|\$/g;return t.MODULE_SUFFIX=g.IS_DART?".dart":".js",t.camelCaseToDashCase=n,t.dashCaseToCamelCase=i,t.escapeSingleQuoteString=o,t.escapeDoubleQuoteString=s,t.codeGenExportVariable=c,t.codeGenConstConstructorCall=u,t.codeGenValueFn=l,t.codeGenToString=p,t.splitAtColon=f,d.define=h,r.exports}),System.register("angular2/src/compiler/source_module",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){return"#MODULE["+e+"]"}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang"),a=/#MODULE\[([^\]]*)\]/g;t.moduleRef=n;var c=function(){function e(e,t){this.moduleUrl=e,this.sourceWithModuleRefs=t}return e.prototype.getSourceWithImports=function(){var e=this,t={},r=[],n=s.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs,a,function(n){var i=n[1],o=t[i];return s.isBlank(o)&&(i==e.moduleUrl?o="":(o="import"+r.length,r.push([i,o])),t[i]=o),o.length>0?o+".":""});return new p(n,r)},e}();t.SourceModule=c;var u=function(){function e(e,t){this.declarations=e,this.expression=t}return e}();t.SourceExpression=u;var l=function(){function e(e,t){this.declarations=e,this.expressions=t}return e}();t.SourceExpressions=l;var p=function(){function e(e,t){this.source=e,this.imports=t}return e}();return t.SourceWithImports=p,i.define=o,r.exports}),System.register("angular2/src/compiler/template_ast",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e,t,r){void 0===r&&(r=null);var n=[];return t.forEach(function(t){var i=t.visit(e,r);s.isPresent(i)&&n.push(i)}),n}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang"),a=function(){function e(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.TextAst=a;var c=function(){function e(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitBoundText(this,t)},e}();t.BoundTextAst=c;var u=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitAttr(this,t)},e}();t.AttrAst=u;var l=function(){function e(e,t,r,n,i){this.name=e,this.type=t,this.value=r,this.unit=n,this.sourceInfo=i}return e.prototype.visit=function(e,t){return e.visitElementProperty(this,t)},e}();t.BoundElementPropertyAst=l;var p=function(){function e(e,t,r,n){this.name=e,this.target=t,this.handler=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitEvent(this,t)},Object.defineProperty(e.prototype,"fullName",{get:function(){return s.isPresent(this.target)?this.target+":"+this.name:this.name},enumerable:!0,configurable:!0}),e}();t.BoundEventAst=p;var f=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitVariable(this,t)},e}();t.VariableAst=f;var d=function(){function e(e,t,r,n,i,o,s,a,c){this.name=e,this.attrs=t,this.inputs=r,this.outputs=n,this.exportAsVars=i,this.directives=o,this.children=s,this.ngContentIndex=a,this.sourceInfo=c}return e.prototype.visit=function(e,t){return e.visitElement(this,t)},e.prototype.isBound=function(){return this.inputs.length>0||this.outputs.length>0||this.exportAsVars.length>0||this.directives.length>0},e.prototype.getComponent=function(){return this.directives.length>0&&this.directives[0].directive.isComponent?this.directives[0].directive:null},e}();t.ElementAst=d;var h=function(){function e(e,t,r,n,i,o,s){this.attrs=e,this.outputs=t,this.vars=r,this.directives=n,this.children=i,this.ngContentIndex=o,this.sourceInfo=s}return e.prototype.visit=function(e,t){return e.visitEmbeddedTemplate(this,t)},e}();t.EmbeddedTemplateAst=h;var g=function(){function e(e,t,r,n){this.directiveName=e,this.templateName=t,this.value=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitDirectiveProperty(this,t)},e}();t.BoundDirectivePropertyAst=g;var v=function(){function e(e,t,r,n,i,o){this.directive=e,this.inputs=t,this.hostProperties=r,this.hostEvents=n,this.exportAsVars=i,this.sourceInfo=o}return e.prototype.visit=function(e,t){return e.visitDirective(this,t)},e}();t.DirectiveAst=v;var m=function(){function e(e,t,r){this.index=e,this.ngContentIndex=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitNgContent(this,t)},e}();return t.NgContentAst=m,function(e){e[e.Property=0]="Property",e[e.Attribute=1]="Attribute",e[e.Class=2]="Class",e[e.Style=3]="Style"}(t.PropertyBindingType||(t.PropertyBindingType={})),t.PropertyBindingType,t.templateVisitAll=n,i.define=o,r.exports}),System.register("angular2/src/transform/template_compiler/change_detector_codegen",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e){}return e.prototype.generate=function(e,t,r){throw"Not implemented in JS"},e.prototype.toString=function(){throw"Not implemented in JS"},e}();return t.Codegen=o,n.define=i,r.exports}),System.register("angular2/src/compiler/xhr",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e.prototype.get=function(e){return null},e}();return t.XHR=o,n.define=i,r.exports}),System.register("angular2/src/compiler/shadow_css",["angular2/src/facade/collection","angular2/src/facade/lang"],!0,function(e,t,r){function n(e){return u.StringWrapper.replaceAllMapped(e,S,function(e){return""})}function i(e,t){var r=o(e),n=0;return u.StringWrapper.replaceAllMapped(r.escapedString,E,function(e){var i=e[2],o="",s=e[4],a="";u.isPresent(e[4])&&e[4].startsWith("{"+I)&&(o=r.blocks[n++],s=e[4].substring(I.length+1),a="{");var c=t(new T(i,o));return""+e[1]+c.selector+e[3]+a+c.content+s})}function o(e){for(var t=u.StringWrapper.split(e,O),r=[],n=[],i=0,o=[],s=0;s0?o.push(a):(o.length>0&&(n.push(o.join("")),r.push(I),o=[]),r.push(a)),a==P&&i++}return o.length>0&&(n.push(o.join("")),r.push(I)),new D(r.join(""),n)}var s=System.global,a=s.define;s.define=void 0;var c=e("angular2/src/facade/collection"),u=e("angular2/src/facade/lang"),l=function(){function e(){this.strictStyling=!0}return e.prototype.shimCssText=function(e,t,r){return void 0===r&&(r=""),e=n(e),e=this._insertDirectives(e),this._scopeCssText(e,t,r)},e.prototype._insertDirectives=function(e){return e=this._insertPolyfillDirectivesInCssText(e),this._insertPolyfillRulesInCssText(e)},e.prototype._insertPolyfillDirectivesInCssText=function(e){return u.StringWrapper.replaceAllMapped(e,p,function(e){return e[1]+"{"})},e.prototype._insertPolyfillRulesInCssText=function(e){return u.StringWrapper.replaceAllMapped(e,f,function(e){var t=e[0];return t=u.StringWrapper.replace(t,e[1],""),t=u.StringWrapper.replace(t,e[2],""),e[3]+t})},e.prototype._scopeCssText=function(e,t,r){var n=this._extractUnscopedRulesFromCssText(e);return e=this._insertPolyfillHostInCssText(e),e=this._convertColonHost(e),e=this._convertColonHostContext(e),e=this._convertShadowDOMSelectors(e),u.isPresent(t)&&(e=this._scopeSelectors(e,t,r)),e=e+"\n"+n,e.trim()},e.prototype._extractUnscopedRulesFromCssText=function(e){for(var t,r="",n=u.RegExpWrapper.matcher(d,e);u.isPresent(t=u.RegExpMatcherWrapper.next(n));){var i=t[0];i=u.StringWrapper.replace(i,t[2],""),i=u.StringWrapper.replace(i,t[1],t[3]),r+=i+"\n\n"}return r},e.prototype._convertColonHost=function(e){return this._convertColonRule(e,m,this._colonHostPartReplacer)},e.prototype._convertColonHostContext=function(e){return this._convertColonRule(e,y,this._colonHostContextPartReplacer)},e.prototype._convertColonRule=function(e,t,r){return u.StringWrapper.replaceAllMapped(e,t,function(e){if(u.isPresent(e[2])){for(var t=e[2].split(","),n=[],i=0;i","+","~"],i=e,o="["+t+"]",s=0;s0&&!c.ListWrapper.contains(n,t)&&!u.StringWrapper.contains(t,o)){var r=/([^:]*)(:*)(.*)/g,i=u.RegExpWrapper.firstMatch(r,t);u.isPresent(i)&&(e=i[1]+o+i[2]+i[3])}return e}).join(a)}return i},e.prototype._insertPolyfillHostInCssText=function(e){return e=u.StringWrapper.replaceAll(e,C,g),e=u.StringWrapper.replaceAll(e,j,h)},e}();t.ShadowCss=l;var p=/polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,f=/(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,d=/(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,h="-shadowcsshost",g="-shadowcsscontext",v=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",m=u.RegExpWrapper.create("("+h+v,"im"),y=u.RegExpWrapper.create("("+g+v,"im"),_=h+"-no-combinator",b=[/>>>/g,/::shadow/g,/::content/g,/\/deep\//g,/\/shadow-deep\//g,/\/shadow\//g],x="([>\\s~+[.,{:][\\s\\S]*)?$",w=u.RegExpWrapper.create(h,"im"),j=/:host/gim,C=/:host-context/gim,S=/\/\*[\s\S]*?\*\//g,E=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,O=/([{}])/g,P="{",R="}",I="%BLOCK%",T=function(){function e(e,t){this.selector=e,this.content=t}return e}();t.CssRule=T,t.processRules=i;var D=function(){function e(e,t){this.escapedString=e,this.blocks=t}return e}();return s.define=a,r.exports}),System.register("angular2/src/compiler/url_resolver",["angular2/src/core/di","angular2/src/facade/lang"],!0,function(e,t,r){function n(){return new g}function i(e,t,r,n,i,o,s){var a=[];return h.isPresent(e)&&a.push(e+":"),h.isPresent(r)&&(a.push("//"),h.isPresent(t)&&a.push(t+"@"),a.push(r),h.isPresent(n)&&a.push(":"+n)),h.isPresent(i)&&a.push(i),h.isPresent(o)&&a.push("?"+o),h.isPresent(s)&&a.push("#"+s),a.join("")}function o(e){return h.RegExpWrapper.firstMatch(m,e)}function s(e){if("/"==e)return"/";for(var t="/"==e[0]?"/":"",r="/"===e[e.length-1]?"/":"",n=e.split("/"),i=[],o=0,s=0;s0?i.pop():o++;break;default:i.push(a)}}if(""==t){for(;o-->0;)i.unshift("..");0===i.length&&i.push(".")}return t+i.join("/")+r}function a(e){var t=e[v.Path];return t=h.isBlank(t)?"":s(t),e[v.Path]=t,i(e[v.Scheme],e[v.UserInfo],e[v.Domain],e[v.Port],t,e[v.QueryData],e[v.Fragment])}function c(e,t){var r=o(encodeURI(t)),n=o(e);if(h.isPresent(r[v.Scheme]))return a(r);r[v.Scheme]=n[v.Scheme];for(var i=v.Scheme;i<=v.Port;i++)h.isBlank(r[i])&&(r[i]=n[i]);if("/"==r[v.Path][0])return a(r);var s=n[v.Path];h.isBlank(s)&&(s="/");var c=s.lastIndexOf("/");return s=s.substring(0,c+1)+r[v.Path],r[v.Path]=s,a(r)}var u=System.global,l=u.define;u.define=void 0;var p=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},f=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},d=e("angular2/src/core/di"),h=e("angular2/src/facade/lang");t.createWithoutPackagePrefix=n;var g=function(){function e(){}return e.prototype.resolve=function(e,t){return c(e,t)},e=p([d.Injectable(),f("design:paramtypes",[])],e)}();t.UrlResolver=g;var v,m=h.RegExpWrapper.create("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");return function(e){e[e.Scheme=1]="Scheme",e[e.UserInfo=2]="UserInfo",e[e.Domain=3]="Domain",e[e.Port=4]="Port",e[e.Path=5]="Path",e[e.QueryData=6]="QueryData",e[e.Fragment=7]="Fragment"}(v||(v={})),u.define=l,r.exports}),System.register("angular2/src/compiler/style_url_resolver",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){if(a.isBlank(e)||0===e.length||"/"==e[0])return!1;var t=a.RegExpWrapper.firstMatch(l,e);return a.isBlank(t)||"package"==t[1]||"asset"==t[1]}function i(e,t,r){var i=[],o=a.StringWrapper.replaceAllMapped(r,u,function(r){var o=a.isPresent(r[1])?r[1]:r[2];return n(o)?(i.push(e.resolve(t,o)),""):r[0]});return new c(o,i)}var o=System.global,s=o.define;o.define=void 0;var a=e("angular2/src/facade/lang"),c=function(){function e(e,t){this.style=e,this.styleUrls=t}return e}();t.StyleWithImports=c,t.isStyleUrlResolvable=n,t.extractStyleUrls=i;var u=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,l=/^([a-zA-Z\-\+\.]+):/g;return o.define=s,r.exports}),System.register("angular2/src/compiler/command_compiler",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/core/linker/template_commands","angular2/src/compiler/template_ast","angular2/src/compiler/source_module","angular2/src/compiler/util","angular2/src/core/di"],!0,function(e,t,r){function n(e,t,r){return _.templateVisitAll(e,t,r),r}function i(e){for(var t=new Set,r=[],n=0;n0,s=[];t.vars.forEach(function(e){s.push(e.name),s.push(e.value.length>0?e.value:j)});var a=[];return m.ListWrapper.forEachWithIndex(t.directives,function(e,t){e.visit(n,new I(t,[],[],a))}),this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex,this._readAttrNameAndValues(a,t.attrs),s,a,o,t.ngContentIndex,i.result)),this.transitiveNgContentCount+=i.transitiveNgContentCount,this.embeddedTemplateIndex=i.embeddedTemplateIndex,null},e.prototype.visitElement=function(e,t){var r=this,o=e.getComponent(),s=n(this,e.outputs,[]),a=[];v.isBlank(o)&&e.exportAsVars.forEach(function(e){a.push(e.name),a.push(null)});var c=[];m.ListWrapper.forEachWithIndex(e.directives,function(e,t){e.visit(r,new I(t,s,a,c))}),s=i(s);var u=this._readAttrNameAndValues(c,e.attrs);return v.isPresent(o)?(this.result.push(this.commandFactory.createBeginComponent(e.name,u,s,a,c,o.template.encapsulation,e.ngContentIndex)),_.templateVisitAll(this,e.children),this.result.push(this.commandFactory.createEndComponent())):(this.result.push(this.commandFactory.createBeginElement(e.name,u,s,a,c,e.isBound(),e.ngContentIndex)),_.templateVisitAll(this,e.children),this.result.push(this.commandFactory.createEndElement())),null},e.prototype.visitVariable=function(e,t){return null},e.prototype.visitAttr=function(e,t){return t.push(e.name),t.push(e.value),null},e.prototype.visitBoundText=function(e,t){return this.result.push(this.commandFactory.createText(null,!0,e.ngContentIndex)),null},e.prototype.visitText=function(e,t){return this.result.push(this.commandFactory.createText(e.value,!1,e.ngContentIndex)),null},e.prototype.visitDirective=function(e,t){return t.targetDirectives.push(e.directive),_.templateVisitAll(this,e.hostEvents,t.eventTargetAndNames),e.exportAsVars.forEach(function(e){t.targetVariableNameAndValues.push(e.name),t.targetVariableNameAndValues.push(t.index)}),null},e.prototype.visitEvent=function(e,t){return t.push(e.target),t.push(e.name),null},e.prototype.visitDirectiveProperty=function(e,t){return null},e.prototype.visitElementProperty=function(e,t){return null},e}(),I=function(){function e(e,t,r,n){this.index=e,this.eventTargetAndNames=t,this.targetVariableNameAndValues=r,this.targetDirectives=n}return e}(),T=function(){function e(e){this.value=e}return e}();return f.define=d,r.exports}),System.register("angular2/src/compiler/html_ast",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e,t,r){void 0===r&&(r=null);var n=[];return t.forEach(function(t){var i=t.visit(e,r);s.isPresent(i)&&n.push(i)}),n}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang"),a=function(){function e(e,t){this.value=e,this.sourceInfo=t}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.HtmlTextAst=a;var c=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitAttr(this,t)},e}();t.HtmlAttrAst=c;var u=function(){function e(e,t,r,n){this.name=e,this.attrs=t,this.children=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitElement(this,t)},e}();return t.HtmlElementAst=u,t.htmlVisitAll=n,i.define=o,r.exports}),System.register("angular2/src/compiler/schema/element_schema_registry",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e.prototype.hasProperty=function(e,t){return!0},e.prototype.getMappedPropName=function(e){return e},e}();return t.ElementSchemaRegistry=o,n.define=i,r.exports}),System.register("angular2/src/compiler/template_preparser",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){var t=null,r=null,n=null,o=!1;e.attrs.forEach(function(e){e.name==c?t=e.value:e.name==f?r=e.value:e.name==p?n=e.value:e.name==v&&(o=!0)}),t=i(t);var s=e.name,a=m.OTHER;return s==u?a=m.NG_CONTENT:s==h?a=m.STYLE:s==g?a=m.SCRIPT:s==l&&n==d&&(a=m.STYLESHEET),new y(a,t,r,o)}function i(e){return a.isBlank(e)||0===e.length?"*":e}var o=System.global,s=o.define;o.define=void 0;var a=e("angular2/src/facade/lang"),c="select",u="ng-content",l="link",p="rel",f="href",d="stylesheet",h="style",g="script",v="ng-non-bindable";t.preparseElement=n,function(e){e[e.NG_CONTENT=0]="NG_CONTENT",e[e.STYLE=1]="STYLE",e[e.STYLESHEET=2]="STYLESHEET",e[e.SCRIPT=3]="SCRIPT",e[e.OTHER=4]="OTHER"}(t.PreparsedElementType||(t.PreparsedElementType={}));var m=t.PreparsedElementType,y=function(){function e(e,t,r,n){this.type=e,this.selectAttr=t,this.hrefAttr=r,this.nonBindable=n}return e}();return t.PreparsedElement=y,o.define=s,r.exports}),System.register("angular2/src/compiler/template_normalizer",["angular2/src/compiler/directive_metadata","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/async","angular2/src/compiler/xhr","angular2/src/compiler/url_resolver","angular2/src/compiler/style_url_resolver","angular2/src/core/di","angular2/src/core/metadata/view","angular2/src/compiler/html_ast","angular2/src/compiler/html_parser","angular2/src/compiler/template_preparser"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/compiler/directive_metadata"),c=e("angular2/src/facade/lang"),u=e("angular2/src/facade/exceptions"),l=e("angular2/src/facade/async"),p=e("angular2/src/compiler/xhr"),f=e("angular2/src/compiler/url_resolver"),d=e("angular2/src/compiler/style_url_resolver"),h=e("angular2/src/core/di"),g=e("angular2/src/core/metadata/view"),v=e("angular2/src/compiler/html_ast"),m=e("angular2/src/compiler/html_parser"),y=e("angular2/src/compiler/template_preparser"),_=function(){function e(e,t,r){this._xhr=e,this._urlResolver=t,this._domParser=r}return e.prototype.normalizeTemplate=function(e,t){var r=this;if(c.isPresent(t.template))return l.PromiseWrapper.resolve(this.normalizeLoadedTemplate(e,t,t.template,e.moduleUrl));if(c.isPresent(t.templateUrl)){var n=this._urlResolver.resolve(e.moduleUrl,t.templateUrl);return this._xhr.get(n).then(function(i){return r.normalizeLoadedTemplate(e,t,i,n)})}throw new u.BaseException("No template specified for component "+e.name)},e.prototype.normalizeLoadedTemplate=function(e,t,r,n){var i=this,o=this._domParser.parse(r,e.name),s=new b;v.htmlVisitAll(s,o);var c=t.styles.concat(s.styles),u=s.styleUrls.filter(d.isStyleUrlResolvable).map(function(e){return i._urlResolver.resolve(n,e)}).concat(t.styleUrls.filter(d.isStyleUrlResolvable).map(function(t){return i._urlResolver.resolve(e.moduleUrl,t)})),l=c.map(function(e){var t=d.extractStyleUrls(i._urlResolver,n,e);return t.styleUrls.forEach(function(e){return u.push(e)}),t.style}),p=t.encapsulation;return p===g.ViewEncapsulation.Emulated&&0===l.length&&0===u.length&&(p=g.ViewEncapsulation.None),new a.CompileTemplateMetadata({encapsulation:p,template:r,templateUrl:n,styles:l,styleUrls:u,ngContentSelectors:s.ngContentSelectors})},e=o([h.Injectable(),s("design:paramtypes",[p.XHR,f.UrlResolver,m.HtmlParser])],e)}();t.TemplateNormalizer=_;var b=function(){function e(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return e.prototype.visitElement=function(e,t){var r=y.preparseElement(e);switch(r.type){case y.PreparsedElementType.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(r.selectAttr);break;case y.PreparsedElementType.STYLE:var n="";e.children.forEach(function(e){e instanceof v.HtmlTextAst&&(n+=e.value)}),this.styles.push(n);break;case y.PreparsedElementType.STYLESHEET:this.styleUrls.push(r.hrefAttr)}return r.nonBindable&&this.ngNonBindableStackCount++,v.htmlVisitAll(this,e.children),r.nonBindable&&this.ngNonBindableStackCount--,null},e.prototype.visitAttr=function(e,t){return null},e.prototype.visitText=function(e,t){return null},e}();return n.define=i,r.exports}),System.register("angular2/src/compiler/runtime_metadata",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/compiler/directive_metadata","angular2/src/core/metadata/directives","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/view_resolver","angular2/src/core/linker/directive_lifecycle_reflector","angular2/src/core/linker/interfaces","angular2/src/core/reflection/reflection","angular2/src/core/di","angular2/src/core/platform_directives_and_pipes","angular2/src/compiler/util"],!0,function(e,t,r){function n(e){var t=new Map;return e.forEach(function(e){return t.set(e,null)}),v.MapWrapper.keys(t)}function i(e,t){var r=[];return h.isPresent(t)&&o(t,r),h.isPresent(e.directives)&&o(e.directives,r),r}function o(e,t){for(var r=0;r=200&&300>=i?t.resolve(n):t.reject("Failed to load "+e,null)},r.onerror=function(){t.reject("Failed to load "+e,null)},r.send(),t.promise},t}(c.XHR);return t.XHRImpl=u,n.define=i,r.exports}),System.register("angular2/src/core/testability/testability",["angular2/src/core/di","angular2/src/core/dom/dom_adapter","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/zone/ng_zone","angular2/src/facade/async"],!0,function(e,t,r){function n(e){y=e}var i=System.global,o=i.define;i.define=void 0;var s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/dom/dom_adapter"),l=e("angular2/src/facade/collection"),p=e("angular2/src/facade/lang"),f=e("angular2/src/facade/exceptions"),d=e("angular2/src/core/zone/ng_zone"),h=e("angular2/src/facade/async"),g=function(){function e(e){this._pendingCount=0,this._callbacks=[],this._isAngularEventPending=!1,this._watchAngularEvents(e)}return e.prototype._watchAngularEvents=function(e){var t=this;h.ObservableWrapper.subscribe(e.onTurnStart,function(e){t._isAngularEventPending=!0}),e.runOutsideAngular(function(){h.ObservableWrapper.subscribe(e.onEventDone,function(r){e.hasPendingTimers||(t._isAngularEventPending=!1,t._runCallbacksIfReady())})})},e.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._pendingCount},e.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new f.BaseException("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},e.prototype.isStable=function(){return 0==this._pendingCount&&!this._isAngularEventPending},e.prototype._runCallbacksIfReady=function(){var e=this;this.isStable()&&h.PromiseWrapper.resolve(null).then(function(t){for(;0!==e._callbacks.length;)e._callbacks.pop()()})},e.prototype.whenStable=function(e){this._callbacks.push(e),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.isAngularEventPending=function(){return this._isAngularEventPending},e.prototype.findBindings=function(e,t,r){return[]},e.prototype.findProviders=function(e,t,r){return[]},e=s([c.Injectable(),a("design:paramtypes",[d.NgZone])],e)}();t.Testability=g;var v=function(){function e(){this._applications=new l.Map,y.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.getAllTestabilities=function(){return l.MapWrapper.values(this._applications)},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),null==e?null:this._applications.has(e)?this._applications.get(e):t?u.DOM.isShadowRoot(e)?this.findTestabilityInTree(u.DOM.getHost(e)):this.findTestabilityInTree(u.DOM.parentElement(e)):null},e=s([c.Injectable(),a("design:paramtypes",[])],e)}();t.TestabilityRegistry=v;var m=function(){function e(){}return e.prototype.addToWindow=function(e){},e=s([p.CONST(),a("design:paramtypes",[])],e)}();t.setTestabilityGetter=n;var y=p.CONST_EXPR(new m);return i.define=o,r.exports}),System.register("angular2/src/core/render/dom/events/key_events",["angular2/src/core/dom/dom_adapter","angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/core/render/dom/events/event_manager","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/dom/dom_adapter"),u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/collection"),p=e("angular2/src/core/render/dom/events/event_manager"),f=e("angular2/src/core/di"),d=["alt","control","meta","shift"],h={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},g=function(e){function t(){e.call(this)}return o(t,e),t.prototype.supports=function(e){return u.isPresent(t.parseEventName(e))},t.prototype.addEventListener=function(e,r,n){var i=t.parseEventName(r),o=t.eventCallback(e,l.StringMapWrapper.get(i,"fullKey"),n,this.manager.getZone());this.manager.getZone().runOutsideAngular(function(){c.DOM.on(e,l.StringMapWrapper.get(i,"domEventName"),o)})},t.parseEventName=function(e){var r=e.toLowerCase().split("."),n=r.shift();if(0===r.length||!u.StringWrapper.equals(n,"keydown")&&!u.StringWrapper.equals(n,"keyup"))return null;var i=t._normalizeKey(r.pop()),o="";if(d.forEach(function(e){l.ListWrapper.contains(r,e)&&(l.ListWrapper.remove(r,e),o+=e+".")}),o+=i,0!=r.length||0===i.length)return null;var s=l.StringMapWrapper.create();return l.StringMapWrapper.set(s,"domEventName",n),l.StringMapWrapper.set(s,"fullKey",o),s},t.getEventFullKey=function(e){var t="",r=c.DOM.getEventKey(e);return r=r.toLowerCase(),u.StringWrapper.equals(r," ")?r="space":u.StringWrapper.equals(r,".")&&(r="dot"),d.forEach(function(n){if(n!=r){var i=l.StringMapWrapper.get(h,n);i(e)&&(t+=n+".")}}),t+=r},t.eventCallback=function(e,r,n,i){return function(e){u.StringWrapper.equals(t.getEventFullKey(e),r)&&i.run(function(){return n(e)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t=s([f.Injectable(),a("design:paramtypes",[])],t)}(p.EventManagerPlugin);return t.KeyEventsPlugin=g,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/hammer_common",["angular2/src/core/render/dom/events/event_manager","angular2/src/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/render/dom/events/event_manager"),a=e("angular2/src/facade/collection"),c={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},u=function(e){function t(){e.call(this)}return o(t,e),t.prototype.supports=function(e){return e=e.toLowerCase(),a.StringMapWrapper.contains(c,e)},t}(s.EventManagerPlugin);return t.HammerGesturesPluginCommon=u,n.define=i,r.exports}),System.register("angular2/src/core/platform_bindings",["angular2/src/core/di","angular2/src/facade/exceptions","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),s=e("angular2/src/facade/exceptions"),a=e("angular2/src/core/dom/dom_adapter");return t.EXCEPTION_PROVIDER=o.provide(s.ExceptionHandler,{useFactory:function(){return new s.ExceptionHandler(a.DOM,!1)},deps:[]}),t.EXCEPTION_BINDING=t.EXCEPTION_PROVIDER,n.define=i,r.exports}),System.register("angular2/src/core/profile/wtf_init",[],!0,function(e,t,r){function n(){}var i=System.global,o=i.define;return i.define=void 0,t.wtfInit=n,i.define=o,r.exports}),System.register("angular2/src/core/application_ref",["angular2/src/core/zone/ng_zone","angular2/src/facade/lang","angular2/src/core/di","angular2/src/core/application_tokens","angular2/src/facade/async","angular2/src/facade/collection","angular2/src/core/reflection/reflection","angular2/src/core/testability/testability","angular2/src/core/linker/dynamic_component_loader","angular2/src/facade/exceptions","angular2/src/core/dom/dom_adapter","angular2/src/core/linker/view_ref","angular2/src/core/change_detection/change_detection","angular2/src/core/linker/view_pool","angular2/src/core/linker/view_manager","angular2/src/core/linker/view_manager_utils","angular2/src/core/linker/view_listener","angular2/src/core/linker/proto_view_factory","angular2/src/core/linker/view_resolver","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/pipe_resolver","angular2/src/core/linker/compiler","angular2/src/core/linker/dynamic_component_loader","angular2/src/core/linker/view_manager","angular2/src/core/linker/compiler","angular2/src/core/profile/profile","angular2/src/core/platform_directives_and_pipes","angular2/src/facade/lang","angular2/common"],!0,function(e,t,r){function n(){return[d.provide(m.Reflector,{useValue:m.reflector}),y.TestabilityRegistry]}function i(e){return[d.provide(h.APP_COMPONENT,{useValue:e}),d.provide(h.APP_COMPONENT_REF_PROMISE,{useFactory:function(t,r,n){var i;return t.loadAsRoot(e,null,n,function(){r._unloadComponent(i)}).then(function(e){return i=e,f.isPresent(e.location.nativeElement)&&n.get(y.TestabilityRegistry).registerApplication(e.location.nativeElement,n.get(y.Testability)),e})},deps:[_.DynamicComponentLoader,H,d.Injector]}),d.provide(e,{useFactory:function(e){return e.then(function(e){return e.instance})},deps:[h.APP_COMPONENT_REF_PROMISE]})]}function o(){return[d.provide(D.Compiler,{useClass:N.Compiler_}),h.APP_ID_RANDOM_PROVIDER,C.AppViewPool,d.provide(C.APP_VIEW_POOL_CAPACITY,{useValue:1e4}),d.provide(S.AppViewManager,{useClass:A.AppViewManager_}),E.AppViewManagerUtils,O.AppViewListener,P.ProtoViewFactory,R.ViewResolver,d.provide(j.IterableDiffers,{useValue:j.defaultIterableDiffers}),d.provide(j.KeyValueDiffers,{useValue:j.defaultKeyValueDiffers}),I.DirectiveResolver,T.PipeResolver,d.provide(V.PLATFORM_PIPES,{useValue:L.COMMON_PIPES,multi:!0}),d.provide(V.PLATFORM_DIRECTIVES,{useValue:L.COMMON_DIRECTIVES,multi:!0}),d.provide(_.DynamicComponentLoader,{useClass:k.DynamicComponentLoader_})]}function s(){return new p.NgZone({enableLongStackTrace:f.assertionsEnabled()})}function a(e,t){if(B.lockDevMode(),f.isPresent(F)){if(f.isBlank(e))return F;throw"platform() can only be called once per page"}return f.isPresent(t)&&t(),f.isBlank(e)&&(e=n()),F=new U(d.Injector.resolveAndCreate(e),function(){F=null})}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},p=e("angular2/src/core/zone/ng_zone"),f=e("angular2/src/facade/lang"),d=e("angular2/src/core/di"),h=e("angular2/src/core/application_tokens"),g=e("angular2/src/facade/async"),v=e("angular2/src/facade/collection"),m=e("angular2/src/core/reflection/reflection"),y=e("angular2/src/core/testability/testability"),_=e("angular2/src/core/linker/dynamic_component_loader"),b=e("angular2/src/facade/exceptions"),x=e("angular2/src/core/dom/dom_adapter"),w=e("angular2/src/core/linker/view_ref"),j=e("angular2/src/core/change_detection/change_detection"),C=e("angular2/src/core/linker/view_pool"),S=e("angular2/src/core/linker/view_manager"),E=e("angular2/src/core/linker/view_manager_utils"),O=e("angular2/src/core/linker/view_listener"),P=e("angular2/src/core/linker/proto_view_factory"),R=e("angular2/src/core/linker/view_resolver"),I=e("angular2/src/core/linker/directive_resolver"),T=e("angular2/src/core/linker/pipe_resolver"),D=e("angular2/src/core/linker/compiler"),k=e("angular2/src/core/linker/dynamic_component_loader"),A=e("angular2/src/core/linker/view_manager"),N=e("angular2/src/core/linker/compiler"),M=e("angular2/src/core/profile/profile"),V=e("angular2/src/core/platform_directives_and_pipes"),B=e("angular2/src/facade/lang"),L=e("angular2/common");t.platformProviders=n,t.applicationCommonProviders=o,t.createNgZone=s;var F;t.platformCommon=a;var W=function(){function e(){}return Object.defineProperty(e.prototype,"injector",{get:function(){return b.unimplemented()},enumerable:!0,configurable:!0}),e}();t.PlatformRef=W;var U=function(e){function t(t,r){e.call(this),this._injector=t,this._dispose=r,this._applications=[],this._disposeListeners=[]}return l(t,e),t.prototype.registerDisposeListener=function(e){this._disposeListeners.push(e)},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),t.prototype.application=function(e){var t=this._initApp(s(),e);return t},t.prototype.asyncApplication=function(e){var t=this,r=s(),n=g.PromiseWrapper.completer();return r.run(function(){g.PromiseWrapper.then(e(r),function(e){n.resolve(t._initApp(r,e))})}),n.promise},t.prototype._initApp=function(e,t){var r,n,i=this;return e.run(function(){t.push(d.provide(p.NgZone,{useValue:e})),t.push(d.provide(H,{useFactory:function(){return n},deps:[]}));var o;try{r=i.injector.resolveAndCreateChild(t),o=r.get(b.ExceptionHandler),e.overrideOnErrorHandler(function(e,t){return o.call(e,t)})}catch(s){f.isPresent(o)?o.call(s,s.stack):x.DOM.logError(s)}}),n=new z(this,e,r),this._applications.push(n),n},t.prototype.dispose=function(){this._applications.forEach(function(e){return e.dispose()}),this._disposeListeners.forEach(function(e){return e()}),this._dispose()},t.prototype._applicationDisposed=function(e){v.ListWrapper.remove(this._applications,e)},t}(W);t.PlatformRef_=U;var H=function(){function e(){}return Object.defineProperty(e.prototype,"injector",{get:function(){return b.unimplemented()},enumerable:!0,configurable:!0 +}),Object.defineProperty(e.prototype,"zone",{get:function(){return b.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentTypes",{get:function(){return b.unimplemented()},enumerable:!0,configurable:!0}),e}();t.ApplicationRef=H;var z=function(e){function t(t,r,n){var i=this;e.call(this),this._platform=t,this._zone=r,this._injector=n,this._bootstrapListeners=[],this._disposeListeners=[],this._rootComponents=[],this._rootComponentTypes=[],this._changeDetectorRefs=[],this._runningTick=!1,this._enforceNoNewChanges=!1,f.isPresent(this._zone)&&g.ObservableWrapper.subscribe(this._zone.onTurnDone,function(e){i._zone.run(function(){i.tick()})}),this._enforceNoNewChanges=f.assertionsEnabled()}return l(t,e),t.prototype.registerBootstrapListener=function(e){this._bootstrapListeners.push(e)},t.prototype.registerDisposeListener=function(e){this._disposeListeners.push(e)},t.prototype.registerChangeDetector=function(e){this._changeDetectorRefs.push(e)},t.prototype.unregisterChangeDetector=function(e){v.ListWrapper.remove(this._changeDetectorRefs,e)},t.prototype.bootstrap=function(e,t){var r=this,n=g.PromiseWrapper.completer();return this._zone.run(function(){var o=i(e);f.isPresent(t)&&o.push(t);var s=r._injector.get(b.ExceptionHandler);r._rootComponentTypes.push(e);try{var a=r._injector.resolveAndCreateChild(o),c=a.get(h.APP_COMPONENT_REF_PROMISE),u=function(e){r._loadComponent(e),n.resolve(e)},l=g.PromiseWrapper.then(c,u);g.PromiseWrapper.then(l,function(e){}),g.PromiseWrapper.then(l,null,function(e,t){return n.reject(e,t)})}catch(p){s.call(p,p.stack),n.reject(p,p.stack)}}),n.promise},t.prototype._loadComponent=function(e){var t=w.internalView(e.hostView).changeDetector;this._changeDetectorRefs.push(t.ref),this.tick(),this._rootComponents.push(e),this._bootstrapListeners.forEach(function(t){return t(e)})},t.prototype._unloadComponent=function(e){v.ListWrapper.contains(this._rootComponents,e)&&(this.unregisterChangeDetector(w.internalView(e.hostView).changeDetector.ref),v.ListWrapper.remove(this._rootComponents,e))},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),t.prototype.tick=function(){if(this._runningTick)throw new b.BaseException("ApplicationRef.tick is called recursively");var e=t._tickScope();try{this._runningTick=!0,this._changeDetectorRefs.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._changeDetectorRefs.forEach(function(e){return e.checkNoChanges()})}finally{this._runningTick=!1,M.wtfLeave(e)}},t.prototype.dispose=function(){this._rootComponents.forEach(function(e){return e.dispose()}),this._disposeListeners.forEach(function(e){return e()}),this._platform._applicationDisposed(this)},Object.defineProperty(t.prototype,"componentTypes",{get:function(){return this._rootComponentTypes},enumerable:!0,configurable:!0}),t._tickScope=M.wtfCreateScope("ApplicationRef#tick()"),t}(H);return t.ApplicationRef_=z,c.define=u,r.exports}),System.register("angular2/src/core/bootstrap",["angular2/src/core/application"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/application");return t.bootstrap=o.bootstrap,n.define=i,r.exports}),System.register("angular2/src/core/services/title",["angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/dom/dom_adapter"),s=function(){function e(){}return e.prototype.getTitle=function(){return o.DOM.getTitle()},e.prototype.setTitle=function(e){o.DOM.setTitle(e)},e}();return t.Title=s,n.define=i,r.exports}),System.register("angular2/src/core/zone",["angular2/src/core/zone/ng_zone"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/zone/ng_zone");return t.NgZone=o.NgZone,t.NgZoneError=o.NgZoneError,n.define=i,r.exports}),System.register("angular2/src/core/debug/debug_element",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/dom/dom_adapter","angular2/src/core/linker/view","angular2/src/core/linker/view_ref"],!0,function(e,t,r){function n(e){return new h(f.internalView(e.parentView),e.boundElementIndex)}function i(e){return e.map(function(e){return e.nativeElement})}var o=System.global,s=o.define;o.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/facade/lang"),u=e("angular2/src/facade/exceptions"),l=e("angular2/src/core/dom/dom_adapter"),p=e("angular2/src/core/linker/view"),f=e("angular2/src/core/linker/view_ref"),d=function(){function e(){}return Object.defineProperty(e.prototype,"componentInstance",{get:function(){return u.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeElement",{get:function(){return u.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elementRef",{get:function(){return u.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return u.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentViewChildren",{get:function(){return u.unimplemented()},enumerable:!0,configurable:!0}),e.prototype.query=function(e,t){void 0===t&&(t=g.all);var r=this.queryAll(e,t);return r.length>0?r[0]:null},e.prototype.queryAll=function(e,t){void 0===t&&(t=g.all);var r=t(this);return r.filter(e)},e}();t.DebugElement=d;var h=function(e){function t(t,r){e.call(this),this._parentView=t,this._boundElementIndex=r,this._elementInjector=this._parentView.elementInjectors[this._boundElementIndex]}return a(t,e),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return c.isPresent(this._elementInjector)?this._elementInjector.getComponent():null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nativeElement",{get:function(){return this.elementRef.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elementRef",{get:function(){return this._parentView.elementRefs[this._boundElementIndex]},enumerable:!0,configurable:!0}),t.prototype.getDirectiveInstance=function(e){return this._elementInjector.getDirectiveAtIndex(e)},Object.defineProperty(t.prototype,"children",{get:function(){return this._getChildElements(this._parentView,this._boundElementIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentViewChildren",{get:function(){var e=this._parentView.getNestedView(this._boundElementIndex);return c.isPresent(e)&&e.proto.type===p.ViewType.COMPONENT?this._getChildElements(e,null):[]},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this._parentView.triggerEventHandlers(e,t,this._boundElementIndex)},t.prototype.hasDirective=function(e){return c.isPresent(this._elementInjector)?this._elementInjector.hasDirective(e):!1},t.prototype.inject=function(e){return c.isPresent(this._elementInjector)?this._elementInjector.get(e):null},t.prototype.getLocal=function(e){return this._parentView.locals.get(e)},t.prototype._getChildElements=function(e,r){var n=this,i=[],o=null;c.isPresent(r)&&(o=e.proto.elementBinders[r-e.elementOffset]);for(var s=0;sr;r++)t.insertBefore(e[r],this.contentInserctionPoint)},e.prototype.setupOutputs=function(){for(var e=this,t=this.attrs,r=this.info.outputs,n=0;no&&!i.isUnsubscribed;o++)i.next(t[o]);i.isUnsubscribed||i.complete()}else{if("function"==typeof t.then)return t.then(function(e){i.isUnsubscribed||(i.next(e),i.complete())},function(e){return i.error(e)}).then(null,function(e){setTimeout(function(){throw e})}),i;if("function"==typeof t[l["default"]]){for(var a=t,u=Array.isArray(a),p=0,a=u?a:a[Symbol.iterator]();;){var d;if(u){if(p>=a.length)break;d=a[p++]}else{if(p=a.next(),p.done)break;d=p.value}var v=d;if(i.next(v),i.isUnsubscribed)break}i.isUnsubscribed||i.complete()}else if("function"==typeof t[f["default"]]){var m=t[f["default"]]();if("function"==typeof m.subscribe)return m.subscribe(new h["default"](e,r,n));i.error("invalid observable")}else i.error(new TypeError("unknown type returned"))}}}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/Observable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/Symbol_observable"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/InnerSubscriber"),h=n(d),g=Array.isArray;return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction","@reactivex/rxjs/dist/cjs/schedulers/FutureAction"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0;var a=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"),l=n(u),p=function(){function e(){i(this,e),this.actions=[],this.active=!1,this.scheduled=!1}return e.prototype.now=function(){return Date.now()},e.prototype.flush=function(){if(!this.active&&!this.scheduled){this.active=!0;for(var e=this.actions,t=void 0;t=e.shift();)t.execute();this.active=!1}},e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),0>=t?this.scheduleNow(e,r):this.scheduleLater(e,t,r)},e.prototype.scheduleNow=function(e,t){return new c["default"](this,e).schedule(t)},e.prototype.scheduleLater=function(e,t,r){return new l["default"](this,e).schedule(r,t)},e}();return t["default"]=p,r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Notification"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscriber"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Notification"),p=n(l),f=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1];o(this,e),this.delay=r,this.scheduler=t}return e.prototype.call=function(e){return new d(e,this.scheduler,this.delay)},e}();t.ObserveOnOperator=f;var d=function(e){function t(r,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];o(this,t),e.call(this,r),this.delay=i,this.scheduler=n}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r)},t.prototype._next=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createNext(e),this.destination)))},t.prototype._error=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createError(e),this.destination)))},t.prototype._complete=function(){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createComplete(),this.destination)))},t}(u["default"]);t.ObserveOnSubscriber=d;var h=function g(e,t){o(this,g),this.notification=e,this.destination=t};return s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction",["@reactivex/rxjs/dist/cjs/util/Immediate","@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/Immediate"),u=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),l=n(u),p=function(e){function t(){i(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.schedule=function(e){var t=this;if(this.isUnsubscribed)return this;this.state=e;var r=this.scheduler;return r.actions.push(this),r.scheduled||(r.scheduled=!0,this.id=c.Immediate.setImmediate(function(){t.id=null,t.scheduler.scheduled=!1,t.scheduler.flush()})),this},t.prototype.unsubscribe=function(){var t=this.id,r=this.scheduler;e.prototype.unsubscribe.call(this),0===r.actions.length&&(r.active=!1,r.scheduled=!1),t&&(this.id=null,c.Immediate.clearImmediate(t))},t}(l["default"]);return t["default"]=p,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/merge-static",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/mergeAll-support","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=Number.POSITIVE_INFINITY,t=p["default"],r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];var o=n[n.length-1];return"function"==typeof o.schedule?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof o&&(e=n.pop()),1===n.length?n[0]:new c["default"](n,t).lift(new u.MergeAllOperator(e))}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"),l=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),p=n(l);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip-static",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/zip-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),new c["default"](t).lift(new u.ZipOperator(n))}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/operators/zip-support");return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatMap",["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"],!0,function(e,t,r){function n(e,t){return this.lift(new s.MergeMapOperator(e,t,1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeMap-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo",["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"],!0,function(e,t,r){function n(e,t){return this.lift(new s.MergeMapToOperator(e,t,1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/count",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return this.lift(new v(e,t,this))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),g=n(h),v=function(){function e(t,r,n){o(this,e),this.predicate=t,this.thisArg=r,this.source=n}return e.prototype.call=function(e){return new m(e,this.predicate,this.thisArg,this.source)},e}(),m=function(e){function t(r,n,i,s){o(this,t),e.call(this,r),this.thisArg=i,this.source=s,this.count=0,this.index=0,"function"==typeof n&&(this.predicate=g["default"](n,i,3))}return i(t,e),t.prototype._next=function(e){var t=this.predicate,r=!0;return t&&(r=f["default"](t)(e,this.index++,this.source),r===d.errorObject)?void this.destination.error(r.e):void(r&&(this.count+=1))},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/delay",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Notification","@reactivex/rxjs/dist/cjs/schedulers/immediate","@reactivex/rxjs/dist/cjs/util/isDate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=arguments.length<=1||void 0===arguments[1]?h["default"]:arguments[1],r=v["default"](e),n=r?+e-t.now():e;return this.lift(new m(n,t))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s; +var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Notification"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/isDate"),v=n(g),m=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new y(e,this.delay,this.scheduler)},e}(),y=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.delay=n,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(this.errored!==!0){var t=this.scheduler,r=new _(t.now()+this.delay,e);this.queue.push(r),this.active===!1&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(f["default"].createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(f["default"].createComplete())},t}(l["default"]),_=function b(e,t){o(this,b),this.time=e,this.notification=t};return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/expand",["@reactivex/rxjs/dist/cjs/operators/expand-support"],!0,function(e,t,r){function n(e){var t=arguments.length<=1||void 0===arguments[1]?Number.POSITIVE_INFINITY:arguments[1];return this.lift(new s.ExpandOperator(e,t))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var s=e("@reactivex/rxjs/dist/cjs/operators/expand-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/first",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/EmptyError"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t,r){return this.lift(new v(e,t,r,this))}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t["default"]=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/EmptyError"),g=n(h),v=function(){function e(t,r,n,i){o(this,e),this.predicate=t,this.resultSelector=r,this.defaultValue=n,this.source=i}return e.prototype.call=function(e){return new m(e,this.predicate,this.resultSelector,this.defaultValue,this.source)},e}(),m=function(e){function t(r,n,i,s,a){o(this,t),e.call(this,r),this.predicate=n,this.resultSelector=i,this.defaultValue=s,this.source=a,this.index=0,this.hasCompleted=!1}return i(t,e),t.prototype._next=function(e){var t=this.destination,r=this.predicate,n=this.resultSelector,i=this.index++,o=!0;if(r&&(o=f["default"](r)(e,i,this.source),o===d.errorObject))return void t.error(d.errorObject.e);if(o){if(n){var s=f["default"](n)(e,i);if(s===d.errorObject)return void t.error(d.errorObject.e);t.next(s)}else t.next(e);t.complete(),this.hasCompleted=!0}},t.prototype._complete=function(){var e=this.destination;this.hasCompleted||"undefined"==typeof this.defaultValue?this.hasCompleted||e.error(new g["default"]):(e.next(this.defaultValue),e.complete())},t}(l["default"]);return r.exports=t["default"],a.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Subject",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscription"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"),g=n(h),v=d["default"].prototype.add,m=d["default"].prototype.remove,y=d["default"].prototype.unsubscribe,_=p["default"].prototype.next,b=p["default"].prototype.error,x=p["default"].prototype.complete,w=p["default"].prototype._next,j=p["default"].prototype._error,C=p["default"].prototype._complete,S=function(e){function t(){i(this,t);for(var r=arguments.length,n=Array(r),o=0;r>o;o++)n[o]=arguments[o];e.call.apply(e,[this].concat(n)),this.observers=[],this.isUnsubscribed=!1,this.dispatching=!1,this.errorSignal=!1,this.completeSignal=!1}return o(t,e),t.create=function(e,t){return new E(e,t)},t.prototype.lift=function(e){var t=new E(this,this.destination||this);return t.operator=e,t},t.prototype._subscribe=function(e){if(!e.isUnsubscribed){if(this.errorSignal)return void e.error(this.errorInstance);if(this.completeSignal)return void e.complete();if(this.isUnsubscribed)throw new Error("Cannot subscribe to a disposed Subject.");return this.observers.push(e),new g["default"](this,e)}},t.prototype.add=function(e){v.call(this,e)},t.prototype.remove=function(e){m.call(this,e)},t.prototype.unsubscribe=function(){this.observers=void 0,y.call(this)},t.prototype.next=function(e){this.isUnsubscribed||(this.dispatching=!0,this._next(e),this.dispatching=!1,this.errorSignal?this.error(this.errorInstance):this.completeSignal&&this.complete())},t.prototype.error=function(e){this.isUnsubscribed||this.completeSignal||(this.errorSignal=!0,this.errorInstance=e,this.dispatching||(this._error(e),this.unsubscribe()))},t.prototype.complete=function(){this.isUnsubscribed||this.errorSignal||(this.completeSignal=!0,this.dispatching||(this._complete(),this.unsubscribe()))},t.prototype._next=function(e){for(var t=-1,r=this.observers.slice(0),n=r.length;++te},e.operation_greater_then=function(e,t){return e>t},e.operation_less_or_equals_then=function(e,t){return t>=e},e.operation_greater_or_equals_then=function(e,t){return e>=t},e.cond=function(e,t,r){return e?t:r},e.mapFn=function(e){function t(t){for(var r=c.StringMapWrapper.create(),n=0;nt?null:e[t-1]},e.callPipeOnDestroy=function(e){l.implementsOnDestroy(e.pipe)&&e.pipe.onDestroy()},e.bindingTarget=function(e,t,r,n,i){return new p.BindingTarget(e,t,r,n,i)},e.directiveIndex=function(e,t){return new f.DirectiveIndex(e,t)},e.looseNotIdentical=function(e,t){return!s.looseIdentical(e,t)},e.uninitialized=s.CONST_EXPR(new Object),e}();return t.ChangeDetectionUtil=_,i.define=o,r.exports}),System.register("angular2/src/core/profile/profile",["angular2/src/core/profile/wtf_impl"],!0,function(e,t,r){function n(e,t){return null}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/core/profile/wtf_impl");return t.wtfEnabled=s.detectWTF(),t.wtfCreateScope=t.wtfEnabled?s.createScope:function(e,t){return n},t.wtfLeave=t.wtfEnabled?s.leave:function(e,t){return t},t.wtfStartTimeRange=t.wtfEnabled?s.startTimeRange:function(e,t){return null},t.wtfEndTimeRange=t.wtfEnabled?s.endTimeRange:function(e){return null},i.define=o,r.exports}),System.register("angular2/src/core/change_detection/codegen_logic_util",["angular2/src/facade/lang","angular2/src/core/change_detection/codegen_facade","angular2/src/core/change_detection/proto_record","angular2/src/core/change_detection/constants","angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),s=e("angular2/src/core/change_detection/codegen_facade"),a=e("angular2/src/core/change_detection/proto_record"),c=e("angular2/src/core/change_detection/constants"),u=e("angular2/src/facade/exceptions"),l=function(){function e(e,t,r,n){this._names=e,this._utilName=t,this._changeDetectorStateName=r,this._changeDetection=n}return e.prototype.genPropertyBindingEvalValue=function(e){var t=this;return this._genEvalValue(e,function(e){return t._names.getLocalName(e)},this._names.getLocalsAccessorName())},e.prototype.genEventBindingEvalValue=function(e,t){var r=this;return this._genEvalValue(t,function(t){return r._names.getEventLocalName(e,t)},"locals")},e.prototype._genEvalValue=function(e,t,r){var n,i=-1==e.contextIndex?this._names.getDirectiveName(e.directiveIndex):t(e.contextIndex),o=e.args.map(function(e){return t(e)}).join(", ");switch(e.mode){case a.RecordType.Self:n=i;break;case a.RecordType.Const:n=s.codify(e.funcOrValue);break;case a.RecordType.PropertyRead:n=this._observe(i+"."+e.name,e);break;case a.RecordType.SafeProperty:var c=this._observe(i+"."+e.name,e);n=this._utilName+".isValueBlank("+i+") ? null : "+this._observe(c,e);break;case a.RecordType.PropertyWrite:n=i+"."+e.name+" = "+t(e.args[0]);break;case a.RecordType.Local:n=this._observe(r+".get("+s.rawString(e.name)+")",e);break;case a.RecordType.InvokeMethod:n=this._observe(i+"."+e.name+"("+o+")",e);break;case a.RecordType.SafeMethodInvoke:var l=i+"."+e.name+"("+o+")";n=this._utilName+".isValueBlank("+i+") ? null : "+this._observe(l,e);break;case a.RecordType.InvokeClosure:n=i+"("+o+")";break;case a.RecordType.PrimitiveOp:n=this._utilName+"."+e.name+"("+o+")";break;case a.RecordType.CollectionLiteral:n=this._utilName+"."+e.name+"("+o+")";break;case a.RecordType.Interpolate:n=this._genInterpolation(e);break;case a.RecordType.KeyedRead:n=this._observe(i+"["+t(e.args[0])+"]",e);break;case a.RecordType.KeyedWrite:n=i+"["+t(e.args[0])+"] = "+t(e.args[1]);break;case a.RecordType.Chain:n="null";break;default:throw new u.BaseException("Unknown operation "+e.mode)}return t(e.selfIndex)+" = "+n+";"},e.prototype._observe=function(e,t){return this._changeDetection===c.ChangeDetectionStrategy.OnPushObserve?"this.observeValue("+e+", "+t.selfIndex+")":e},e.prototype.genPropertyBindingTargets=function(e,t){var r=this,n=e.map(function(e){if(o.isBlank(e))return"null";var n=t?s.codify(e.debug):"null";return r._utilName+".bindingTarget("+s.codify(e.mode)+", "+e.elementIndex+", "+s.codify(e.name)+", "+s.codify(e.unit)+", "+n+")"});return"["+n.join(", ")+"]"},e.prototype.genDirectiveIndices=function(e){var t=this,r=e.map(function(e){return t._utilName+".directiveIndex("+e.directiveIndex.elementIndex+", "+e.directiveIndex.directiveIndex+")"});return"["+r.join(", ")+"]"},e.prototype._genInterpolation=function(e){for(var t=[],r=0;r=0;--n){var i=e[n];i.callAfterContentInit&&t.push("if("+this._names.getStateName()+" "+r+" "+this._changeDetectorStateName+".NeverChecked) "+this._names.getDirectiveName(i.directiveIndex)+".afterContentInit();"),i.callAfterContentChecked&&t.push(this._names.getDirectiveName(i.directiveIndex)+".afterContentChecked();")}return t},e.prototype.genViewLifecycleCallbacks=function(e){for(var t=[],r=o.IS_DART?"==":"===",n=e.length-1;n>=0;--n){var i=e[n];i.callAfterViewInit&&t.push("if("+this._names.getStateName()+" "+r+" "+this._changeDetectorStateName+".NeverChecked) "+this._names.getDirectiveName(i.directiveIndex)+".afterViewInit();"),i.callAfterViewChecked&&t.push(this._names.getDirectiveName(i.directiveIndex)+".afterViewChecked();")}return t},e}();return t.CodegenLogicUtil=l,n.define=i,r.exports}),System.register("angular2/src/common/pipes/date_pipe",["angular2/src/facade/lang","angular2/src/facade/intl","angular2/src/core/di","angular2/src/core/metadata","angular2/src/facade/collection","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/facade/lang"),c=e("angular2/src/facade/intl"),u=e("angular2/src/core/di"),l=e("angular2/src/core/metadata"),p=e("angular2/src/facade/collection"),f=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),d="en-US",h=function(){function e(){}return e.prototype.transform=function(t,r){if(a.isBlank(t))return null;if(!this.supports(t))throw new f.InvalidPipeArgumentException(e,t);var n=a.isPresent(r)&&r.length>0?r[0]:"mediumDate";return a.isNumber(t)&&(t=a.DateWrapper.fromMillis(t)),p.StringMapWrapper.contains(e._ALIASES,n)&&(n=p.StringMapWrapper.get(e._ALIASES,n)),c.DateFormatter.format(t,d,n)},e.prototype.supports=function(e){return a.isDate(e)||a.isNumber(e)},e._ALIASES={medium:"yMMMdjms","short":"yMdjm",fullDate:"yMMMMEEEEd",longDate:"yMMMMd",mediumDate:"yMMMd",shortDate:"yMd",mediumTime:"jms",shortTime:"jm"},e=o([a.CONST(),l.Pipe({name:"date",pure:!0}),u.Injectable(),s("design:paramtypes",[])],e)}();return t.DatePipe=h,n.define=i,r.exports}),System.register("angular2/src/core/pipes/pipes",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/change_detection/pipes"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),s=e("angular2/src/facade/exceptions"),a=e("angular2/src/facade/collection"),c=e("angular2/src/core/change_detection/pipes"),u=function(){function e(e){this.config=e,this.config=e}return e.fromProviders=function(t){var r={};return t.forEach(function(e){return r[e.name]=e}),new e(r)},e.prototype.get=function(e){var t=this.config[e];if(o.isBlank(t))throw new s.BaseException("Cannot find pipe '"+e+"'.");return t},e}();t.ProtoPipes=u;var l=function(){function e(e,t){this.proto=e,this.injector=t,this._config={}}return e.prototype.get=function(e){var t=a.StringMapWrapper.get(this._config,e);if(o.isPresent(t))return t;var r=this.proto.get(e),n=this.injector.instantiateResolved(r),i=new c.SelectedPipe(n,r.pure);return r.pure&&a.StringMapWrapper.set(this._config,e,i),i},e}();return t.Pipes=l,n.define=i,r.exports}),System.register("angular2/src/core/linker/view",["angular2/src/facade/collection","angular2/src/core/change_detection/change_detection","angular2/src/core/change_detection/interfaces","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/linker/view_ref","angular2/src/core/render/dom/util","angular2/src/core/linker/view_ref","angular2/src/core/change_detection/interfaces"],!0,function(e,t,r){function n(e){for(var t={},r=e;l.isPresent(r);)t=a.StringMapWrapper.merge(t,a.MapWrapper.toStringMap(r.current)),r=r.parent;return t}var i=System.global,o=i.define;i.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/facade/collection"),c=e("angular2/src/core/change_detection/change_detection"),u=e("angular2/src/core/change_detection/interfaces"),l=e("angular2/src/facade/lang"),p=e("angular2/src/facade/exceptions"),f=e("angular2/src/core/linker/view_ref"),d=e("angular2/src/core/render/dom/util"),h=e("angular2/src/core/linker/view_ref"),g=e("angular2/src/core/change_detection/interfaces");t.DebugContext=g.DebugContext;var v="ng-reflect-";!function(e){e[e.HOST=0]="HOST",e[e.COMPONENT=1]="COMPONENT",e[e.EMBEDDED=2]="EMBEDDED"}(t.ViewType||(t.ViewType={}));var m=(t.ViewType,function(){function e(){this.views=[]}return e}());t.AppViewContainer=m;var y=function(){function e(e,t,r,n,i,o,s,u,l){this.renderer=e,this.proto=t,this.viewOffset=r,this.elementOffset=n,this.textOffset=i,this.render=s,this.renderFragment=u,this.containerElementInjector=l,this.views=null,this.elementInjectors=null,this.viewContainers=null,this.preBuiltObjects=null,this.changeDetector=null,this.context=null,this.ref=new h.ViewRef_(this),this.locals=new c.Locals(null,a.MapWrapper.clone(o))}return e.prototype.init=function(e,t,r,n,i,o,s){this.changeDetector=e,this.elementInjectors=t,this.rootElementInjectors=r,this.preBuiltObjects=n,this.views=i,this.elementRefs=o,this.viewContainers=s},e.prototype.setLocal=function(e,t){if(!this.hydrated())throw new p.BaseException("Cannot set locals on dehydrated view.");if(this.proto.templateVariableBindings.has(e)){var r=this.proto.templateVariableBindings.get(e);this.locals.set(r,t)}},e.prototype.hydrated=function(){return l.isPresent(this.context)},e.prototype.triggerEventHandlers=function(e,t,r){var n=new a.Map;n.set("$event",t),this.dispatchEvent(r,e,n)},e.prototype.notifyOnBinding=function(e,t){if(e.isTextNode())this.renderer.setText(this.render,e.elementIndex+this.textOffset,t);else{var r=this.elementRefs[this.elementOffset+e.elementIndex];if(e.isElementProperty())this.renderer.setElementProperty(r,e.name,t);else if(e.isElementAttribute())this.renderer.setElementAttribute(r,e.name,l.isPresent(t)?""+t:null);else if(e.isElementClass())this.renderer.setElementClass(r,e.name,t);else{if(!e.isElementStyle())throw new p.BaseException("Unsupported directive record");var n=l.isPresent(e.unit)?e.unit:"";this.renderer.setElementStyle(r,e.name,l.isPresent(t)?""+t+n:null)}}},e.prototype.logBindingUpdate=function(e,t){if(e.isDirective()||e.isElementProperty()){var r=this.elementRefs[this.elementOffset+e.elementIndex];this.renderer.setElementAttribute(r,""+v+d.camelCaseToDashCase(e.name),""+t)}},e.prototype.notifyAfterContentChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)l.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].afterContentChecked()},e.prototype.notifyAfterViewChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)l.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].afterViewChecked(); +},e.prototype.getDirectiveFor=function(e){var t=this.elementInjectors[this.elementOffset+e.elementIndex];return t.getDirectiveAtIndex(e.directiveIndex)},e.prototype.getNestedView=function(e){var t=this.elementInjectors[e];return l.isPresent(t)?t.getNestedView():null},e.prototype.getContainerElement=function(){return l.isPresent(this.containerElementInjector)?this.containerElementInjector.getElementRef():null},e.prototype.getDebugContext=function(e,t){try{var r=this.elementOffset+e,i=rj;j++){var C=w[j],S=l.isPresent(C)?m[C]:null,E=l.isPresent(S)?v[C].view:null,O=l.isPresent(C)?E.proto.elementBinders[C-E.elementOffset].nestedProtoView:e,P=null;(0===j||O.type===p.ViewType.EMBEDDED)&&(P=i[x++]);var R=new p.AppView(n,O,j,_,b,O.protoLocals,o,P,S);y[j]=R,l.isPresent(C)&&(v[C].nestedView=R);for(var I=[],T=j+1,D=0;D=0;u--)l.isPresent(a.parent)&&o.rootElementInjectors[u].link(a.parent);a.traverseAndSetQueriesAsDirty()},e.prototype.detachViewInContainer=function(e,t,r){var n=e.viewContainers[t],i=n.views[r];e.elementInjectors[t].traverseAndSetQueriesAsDirty(),i.changeDetector.remove(),c.ListWrapper.removeAt(n.views,r);for(var o=0;o=o;){var a=e.views[o],c=a.proto;if(a!==e&&a.proto.type===p.ViewType.EMBEDDED)o+=a.proto.mergeInfo.viewCount;else{a!==e&&(t=null,i=null,r=a.containerElementInjector,n=r.getComponent()),a.context=n,a.locals.parent=i;for(var u=c.elementBinders,f=0;f=r;r++){var n=e.views[r];if(n.hydrated()){l.isPresent(n.locals)&&n.locals.clearValues(),n.context=null,n.changeDetector.dehydrate();for(var i=n.proto.elementBinders,o=0;ot;t++)u.DOM.addClass(this.element,e[t])},e.prototype.removeClasses=function(e){for(var t=0,r=e.length;r>t;t++)u.DOM.removeClass(this.element,e[t])},e.prototype.addEvents=function(){var e=this;this.totalTime>0?this.eventClearFunctions.push(u.DOM.onAndCancel(this.element,u.DOM.getTransitionEnd(),function(t){return e.handleAnimationEvent(t)})):this.handleAnimationCompleted()},e.prototype.handleAnimationEvent=function(e){var t=s.Math.round(1e3*e.elapsedTime);this.browserDetails.elapsedTimeIncludesDelay||(t+=this.computedDelay),e.stopPropagation(),t>=this.totalTime&&this.handleAnimationCompleted()},e.prototype.handleAnimationCompleted=function(){this.removeClasses(this.data.animationClasses),this.callbacks.forEach(function(e){return e()}),this.callbacks=[],this.eventClearFunctions.forEach(function(e){return e()}),this.eventClearFunctions=[],this.completed=!0},e.prototype.onComplete=function(e){return this.completed?e():this.callbacks.push(e),this},e.prototype.parseDurationString=function(e){var t=0;if(null==e||e.length<2)return t;if("ms"==e.substring(e.length-2)){var r=o.NumberWrapper.parseInt(this.stripLetters(e),10);r>t&&(t=r)}else if("s"==e.substring(e.length-1)){var n=1e3*o.NumberWrapper.parseFloat(this.stripLetters(e)),r=s.Math.floor(n);r>t&&(t=r)}return t},e.prototype.stripLetters=function(e){return o.StringWrapper.replaceAll(e,o.RegExpWrapper.create("[^0-9]+$",""),"")},e}();return t.Animation=l,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/event_manager",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/dom/dom_adapter","angular2/src/core/zone/ng_zone","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/exceptions"),p=e("angular2/src/facade/collection"),f=e("angular2/src/core/dom/dom_adapter"),d=e("angular2/src/core/zone/ng_zone"),h=e("angular2/src/core/di");t.EVENT_MANAGER_PLUGINS=u.CONST_EXPR(new h.OpaqueToken("EventManagerPlugins"));var g=function(){function e(e,t){var r=this;this._zone=t,e.forEach(function(e){return e.manager=r}),this._plugins=p.ListWrapper.reversed(e)}return e.prototype.addEventListener=function(e,t,r){var n=this._findPluginFor(t);n.addEventListener(e,t,r)},e.prototype.addGlobalEventListener=function(e,t,r){var n=this._findPluginFor(t);return n.addGlobalEventListener(e,t,r)},e.prototype.getZone=function(){return this._zone},e.prototype._findPluginFor=function(e){for(var t=this._plugins,r=0;ri.length){var l,f=h.ListWrapper.createFixedSize(u);for(l=0;l ");throw new v.BaseException(t+" '"+r+"'")}function a(e,t,r,n){e.setElementProperty(t,r,n)}function c(e){return g.isPresent(e)?m.Validators.compose(e.map(w.normalizeValidator)):null}function u(e){return g.isPresent(e)?m.Validators.composeAsync(e.map(w.normalizeValidator)):null}function l(e,t){if(!h.StringMapWrapper.contains(e,"model"))return!1;var r=e.model;return r.isFirstChange()?!0:!g.looseIdentical(t,r.currentValue)}function p(e,t){if(g.isBlank(t))return null;var r,n,i;return t.forEach(function(t){t instanceof y.DefaultValueAccessor?r=t:t instanceof b.CheckboxControlValueAccessor||t instanceof _.NumberValueAccessor||t instanceof x.SelectControlValueAccessor?(g.isPresent(n)&&s(e,"More than one built-in value accessor matches"),n=t):(g.isPresent(i)&&s(e,"More than one custom value accessor matches"),i=t)}),g.isPresent(i)?i:g.isPresent(n)?n:g.isPresent(r)?r:(s(e,"No valid value accessor for"),null)}var f=System.global,d=f.define;f.define=void 0;var h=e("angular2/src/facade/collection"),g=e("angular2/src/facade/lang"),v=e("angular2/src/facade/exceptions"),m=e("angular2/src/common/forms/validators"),y=e("angular2/src/common/forms/directives/default_value_accessor"),_=e("angular2/src/common/forms/directives/number_value_accessor"),b=e("angular2/src/common/forms/directives/checkbox_value_accessor"),x=e("angular2/src/common/forms/directives/select_control_value_accessor"),w=e("angular2/src/common/forms/directives/normalize_validator");return t.controlPath=n,t.setUpControl=i,t.setUpControlGroup=o,t.setProperty=a,t.composeValidators=c,t.composeAsyncValidators=u,t.isPropertyUpdated=l,t.selectValueAccessor=p,f.define=d,r.exports}),System.register("angular2/src/common/forms/directives",["angular2/src/facade/lang","angular2/src/common/forms/directives/ng_control_name","angular2/src/common/forms/directives/ng_form_control","angular2/src/common/forms/directives/ng_model","angular2/src/common/forms/directives/ng_control_group","angular2/src/common/forms/directives/ng_form_model","angular2/src/common/forms/directives/ng_form","angular2/src/common/forms/directives/default_value_accessor","angular2/src/common/forms/directives/checkbox_value_accessor","angular2/src/common/forms/directives/number_value_accessor","angular2/src/common/forms/directives/ng_control_status","angular2/src/common/forms/directives/select_control_value_accessor","angular2/src/common/forms/directives/validators","angular2/src/common/forms/directives/ng_control_name","angular2/src/common/forms/directives/ng_form_control","angular2/src/common/forms/directives/ng_model","angular2/src/common/forms/directives/ng_control_group","angular2/src/common/forms/directives/ng_form_model","angular2/src/common/forms/directives/ng_form","angular2/src/common/forms/directives/default_value_accessor","angular2/src/common/forms/directives/checkbox_value_accessor","angular2/src/common/forms/directives/number_value_accessor","angular2/src/common/forms/directives/ng_control_status","angular2/src/common/forms/directives/select_control_value_accessor","angular2/src/common/forms/directives/validators","angular2/src/common/forms/directives/ng_control"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),s=e("angular2/src/common/forms/directives/ng_control_name"),a=e("angular2/src/common/forms/directives/ng_form_control"),c=e("angular2/src/common/forms/directives/ng_model"),u=e("angular2/src/common/forms/directives/ng_control_group"),l=e("angular2/src/common/forms/directives/ng_form_model"),p=e("angular2/src/common/forms/directives/ng_form"),f=e("angular2/src/common/forms/directives/default_value_accessor"),d=e("angular2/src/common/forms/directives/checkbox_value_accessor"),h=e("angular2/src/common/forms/directives/number_value_accessor"),g=e("angular2/src/common/forms/directives/ng_control_status"),v=e("angular2/src/common/forms/directives/select_control_value_accessor"),m=e("angular2/src/common/forms/directives/validators"),y=e("angular2/src/common/forms/directives/ng_control_name");t.NgControlName=y.NgControlName;var _=e("angular2/src/common/forms/directives/ng_form_control");t.NgFormControl=_.NgFormControl;var b=e("angular2/src/common/forms/directives/ng_model");t.NgModel=b.NgModel;var x=e("angular2/src/common/forms/directives/ng_control_group");t.NgControlGroup=x.NgControlGroup;var w=e("angular2/src/common/forms/directives/ng_form_model");t.NgFormModel=w.NgFormModel;var j=e("angular2/src/common/forms/directives/ng_form");t.NgForm=j.NgForm;var C=e("angular2/src/common/forms/directives/default_value_accessor");t.DefaultValueAccessor=C.DefaultValueAccessor;var S=e("angular2/src/common/forms/directives/checkbox_value_accessor");t.CheckboxControlValueAccessor=S.CheckboxControlValueAccessor;var E=e("angular2/src/common/forms/directives/number_value_accessor");t.NumberValueAccessor=E.NumberValueAccessor;var O=e("angular2/src/common/forms/directives/ng_control_status");t.NgControlStatus=O.NgControlStatus;var P=e("angular2/src/common/forms/directives/select_control_value_accessor");t.SelectControlValueAccessor=P.SelectControlValueAccessor,t.NgSelectOption=P.NgSelectOption;var R=e("angular2/src/common/forms/directives/validators");t.RequiredValidator=R.RequiredValidator,t.MinLengthValidator=R.MinLengthValidator,t.MaxLengthValidator=R.MaxLengthValidator;var I=e("angular2/src/common/forms/directives/ng_control");return t.NgControl=I.NgControl,t.FORM_DIRECTIVES=o.CONST_EXPR([s.NgControlName,u.NgControlGroup,a.NgFormControl,c.NgModel,l.NgFormModel,p.NgForm,v.NgSelectOption,f.DefaultValueAccessor,h.NumberValueAccessor,d.CheckboxControlValueAccessor,v.SelectControlValueAccessor,g.NgControlStatus,m.RequiredValidator,m.MinLengthValidator,m.MaxLengthValidator]), +n.define=i,r.exports}),System.register("angular2/src/compiler/directive_metadata",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/core/change_detection/change_detection","angular2/src/core/metadata/view","angular2/src/compiler/selector","angular2/src/compiler/util","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e,t){var r=l.CssSelector.parse(t)[0].getMatchingElementTemplate();return v.create({type:new h({runtime:Object,name:"Host"+e.name,moduleUrl:e.moduleUrl,isHost:!0}),template:new g({template:r,templateUrl:"",styles:[],styleUrls:[],ngContentSelectors:[]}),changeDetection:c.ChangeDetectionStrategy.Default,inputs:[],outputs:[],host:{},lifecycleHooks:[],isComponent:!0,dynamicLoadable:!1,selector:"*"})}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/collection"),c=e("angular2/src/core/change_detection/change_detection"),u=e("angular2/src/core/metadata/view"),l=e("angular2/src/compiler/selector"),p=e("angular2/src/compiler/util"),f=e("angular2/src/core/linker/interfaces"),d=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g,h=function(){function e(e){var t=void 0===e?{}:e,r=t.runtime,n=t.name,i=t.moduleUrl,o=t.isHost;this.runtime=r,this.name=n,this.moduleUrl=i,this.isHost=s.normalizeBool(o)}return e.fromJson=function(t){return new e({name:t.name,moduleUrl:t.moduleUrl,isHost:t.isHost})},e.prototype.toJson=function(){return{name:this.name,moduleUrl:this.moduleUrl,isHost:this.isHost}},e}();t.CompileTypeMetadata=h;var g=function(){function e(e){var t=void 0===e?{}:e,r=t.encapsulation,n=t.template,i=t.templateUrl,o=t.styles,a=t.styleUrls,c=t.ngContentSelectors;this.encapsulation=s.isPresent(r)?r:u.ViewEncapsulation.Emulated,this.template=n,this.templateUrl=i,this.styles=s.isPresent(o)?o:[],this.styleUrls=s.isPresent(a)?a:[],this.ngContentSelectors=s.isPresent(c)?c:[]}return e.fromJson=function(t){return new e({encapsulation:s.isPresent(t.encapsulation)?u.VIEW_ENCAPSULATION_VALUES[t.encapsulation]:t.encapsulation,template:t.template,templateUrl:t.templateUrl,styles:t.styles,styleUrls:t.styleUrls,ngContentSelectors:t.ngContentSelectors})},e.prototype.toJson=function(){return{encapsulation:s.isPresent(this.encapsulation)?s.serializeEnum(this.encapsulation):this.encapsulation,template:this.template,templateUrl:this.templateUrl,styles:this.styles,styleUrls:this.styleUrls,ngContentSelectors:this.ngContentSelectors}},e}();t.CompileTemplateMetadata=g;var v=function(){function e(e){var t=void 0===e?{}:e,r=t.type,n=t.isComponent,i=t.dynamicLoadable,o=t.selector,s=t.exportAs,a=t.changeDetection,c=t.inputs,u=t.outputs,l=t.hostListeners,p=t.hostProperties,f=t.hostAttributes,d=t.lifecycleHooks,h=t.template;this.type=r,this.isComponent=n,this.dynamicLoadable=i,this.selector=o,this.exportAs=s,this.changeDetection=a,this.inputs=c,this.outputs=u,this.hostListeners=l,this.hostProperties=p,this.hostAttributes=f,this.lifecycleHooks=d,this.template=h}return e.create=function(t){var r=void 0===t?{}:t,n=r.type,i=r.isComponent,o=r.dynamicLoadable,c=r.selector,u=r.exportAs,l=r.changeDetection,f=r.inputs,h=r.outputs,g=r.host,v=r.lifecycleHooks,m=r.template,y={},_={},b={};s.isPresent(g)&&a.StringMapWrapper.forEach(g,function(e,t){var r=s.RegExpWrapper.firstMatch(d,t);s.isBlank(r)?b[t]=e:s.isPresent(r[1])?_[r[1]]=e:s.isPresent(r[2])&&(y[r[2]]=e)});var x={};s.isPresent(f)&&f.forEach(function(e){var t=p.splitAtColon(e,[e,e]);x[t[0]]=t[1]});var w={};return s.isPresent(h)&&h.forEach(function(e){var t=p.splitAtColon(e,[e,e]);w[t[0]]=t[1]}),new e({type:n,isComponent:s.normalizeBool(i),dynamicLoadable:s.normalizeBool(o),selector:c,exportAs:u,changeDetection:l,inputs:x,outputs:w,hostListeners:y,hostProperties:_,hostAttributes:b,lifecycleHooks:s.isPresent(v)?v:[],template:m})},e.fromJson=function(t){return new e({isComponent:t.isComponent,dynamicLoadable:t.dynamicLoadable,selector:t.selector,exportAs:t.exportAs,type:s.isPresent(t.type)?h.fromJson(t.type):t.type,changeDetection:s.isPresent(t.changeDetection)?c.CHANGE_DETECTION_STRATEGY_VALUES[t.changeDetection]:t.changeDetection,inputs:t.inputs,outputs:t.outputs,hostListeners:t.hostListeners,hostProperties:t.hostProperties,hostAttributes:t.hostAttributes,lifecycleHooks:t.lifecycleHooks.map(function(e){return f.LIFECYCLE_HOOKS_VALUES[e]}),template:s.isPresent(t.template)?g.fromJson(t.template):t.template})},e.prototype.toJson=function(){return{isComponent:this.isComponent,dynamicLoadable:this.dynamicLoadable,selector:this.selector,exportAs:this.exportAs,type:s.isPresent(this.type)?this.type.toJson():this.type,changeDetection:s.isPresent(this.changeDetection)?s.serializeEnum(this.changeDetection):this.changeDetection,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,lifecycleHooks:this.lifecycleHooks.map(function(e){return s.serializeEnum(e)}),template:s.isPresent(this.template)?this.template.toJson():this.template}},e}();return t.CompileDirectiveMetadata=v,t.createHostComponentMeta=n,i.define=o,r.exports}),System.register("angular2/src/compiler/change_definition_factory",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/core/reflection/reflection","angular2/src/core/change_detection/change_detection","angular2/src/compiler/template_ast","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e,t,r,n){var o=[],s=new h(null,o,t);return f.templateVisitAll(s,n),i(o,e,r)}function i(e,t,r){var n=o(e);return e.map(function(e){var i=t.name+"_"+e.viewIndex;return new p.ChangeDetectorDefinition(i,e.strategy,n[e.viewIndex],e.bindingRecords,e.eventRecords,e.directiveRecords,r)})}function o(e){var t=c.ListWrapper.createFixedSize(e.length);return e.forEach(function(e){var r=u.isPresent(e.parent)?t[e.parent.viewIndex]:[];t[e.viewIndex]=r.concat(e.variableNames)}),t}var s=System.global,a=s.define;s.define=void 0;var c=e("angular2/src/facade/collection"),u=e("angular2/src/facade/lang"),l=e("angular2/src/core/reflection/reflection"),p=e("angular2/src/core/change_detection/change_detection"),f=e("angular2/src/compiler/template_ast"),d=e("angular2/src/core/linker/interfaces");t.createChangeDetectorDefinitions=n;var h=function(){function e(e,t,r){this.parent=e,this.allVisitors=t,this.strategy=r,this.boundTextCount=0,this.boundElementCount=0,this.variableNames=[],this.bindingRecords=[],this.eventRecords=[],this.directiveRecords=[],this.viewIndex=t.length,t.push(this)}return e.prototype.visitEmbeddedTemplate=function(t,r){this.boundElementCount++,f.templateVisitAll(this,t.outputs);for(var n=0;n #text("+n+"):nth-child("+t+")")}function i(e,t,r,n){return new h.HtmlAttrAst(r,n,t+"["+r+"="+n+"]")}function o(e,t,r){var n=d.DOM.nodeName(e).toLowerCase(),i=r+" > "+n+":nth-child("+t+")",o=s(e,i),c=a(e,i);return new h.HtmlElementAst(n,o,c,i)}function s(e,t){var r=d.DOM.attributeMap(e),n=[];return r.forEach(function(e,t){return n.push([t,e])}),n.sort(function(e,t){return f.StringWrapper.compare(e[0],t[0])}),n.map(function(r){return i(e,t,r[0],r[1])})}function a(e,t){var r=d.DOM.templateAwareRoot(e),i=d.DOM.childNodesAsList(r),s=[],a=0;return i.forEach(function(e){var r=null;if(d.DOM.isTextNode(e)){var i=e;r=n(i,a,t)}else if(d.DOM.isElementNode(e)){var c=e;r=o(c,a,t)}f.isPresent(r)&&s.push(r),a++}),s}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=e("angular2/src/facade/lang"),d=e("angular2/src/core/dom/dom_adapter"),h=e("angular2/src/compiler/html_ast"),g=e("angular2/src/compiler/util"),v=e("angular2/src/core/di"),m=function(){function e(){}return e.prototype.parse=function(e,t){var r=d.DOM.createTemplate(e);return a(r,t)},e.prototype.unparse=function(e){var t=new y,r=[];return h.htmlVisitAll(t,e,r),r.join("")},e=l([v.Injectable(),p("design:paramtypes",[])],e)}();t.HtmlParser=m;var y=function(){function e(){}return e.prototype.visitElement=function(e,t){t.push("<"+e.name);var r=[];return h.htmlVisitAll(this,e.attrs,r),e.attrs.length>0&&(t.push(" "),t.push(r.join(" "))),t.push(">"),h.htmlVisitAll(this,e.children,t),t.push(""),null},e.prototype.visitAttr=function(e,t){return t.push(e.name+"="+g.escapeDoubleQuoteString(e.value)),null},e.prototype.visitText=function(e,t){return t.push(e.value),null},e}();return c.define=u,r.exports}),System.register("angular2/src/core/dom/generic_browser_adapter",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/core/dom/dom_adapter","angular2/src/compiler/xhr_impl"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/collection"),a=e("angular2/src/facade/lang"),c=e("angular2/src/core/dom/dom_adapter"),u=e("angular2/src/compiler/xhr_impl"),l=function(e){function t(){var t=this;e.call(this),this._animationPrefix=null,this._transitionEnd=null;try{var r=this.createElement("div",this.defaultDoc());if(a.isPresent(this.getStyle(r,"animationName")))this._animationPrefix="";else for(var n=["Webkit","Moz","O","ms"],i=0;i1)throw new Error("Only support single directive definition for: "+this.name);var r=t[0];r.replace&&this.notSupported("replace"),r.terminal&&this.notSupported("terminal");var n=r.link;return"object"==typeof n&&n.post&&this.notSupported("link.post"),r},e.prototype.notSupported=function(e){throw new Error("Upgraded directive '"+this.name+"' does not support '"+e+"'.")},e.prototype.extractBindings=function(){var e=this.directive.scope;if("object"==typeof e)for(var t in e)if(e.hasOwnProperty(t)){var r=e[t],n=r.charAt(0);r=r.substr(1)||t;var i="output_"+t,o=i+": "+t,s=i+": "+t+"Change",a="input_"+t,c=a+": "+t;switch(n){case"=":this.propertyOutputs.push(i),this.checkProperties.push(r),this.outputs.push(i),this.outputsRename.push(s),this.propertyMap[i]=r;case"@":this.inputs.push(a),this.inputsRename.push(c),this.propertyMap[a]=r;break;case"&":this.outputs.push(i),this.outputsRename.push(o),this.propertyMap[i]=r;break;default:var u=JSON.stringify(e);throw new Error("Unexpected mapping '"+n+"' in '"+u+"' in '"+this.name+"' directive.")}}},e.prototype.compileTemplate=function(e,t,r){function n(t){var r=document.createElement("div");return r.innerHTML=t,e(r.childNodes)}var i=this;if(this.directive.template)this.linkFn=n(this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var o=this.directive.templateUrl,s=t.get(o);if(void 0===s)return new Promise(function(e,s){r("GET",o,null,function(r,a){200==r?e(i.linkFn=n(t.put(o,a))):s("GET "+o+" returned "+r+": "+a)})});this.linkFn=n(s)}return null},e.resolve=function(e,t){var r=[],n=t.get(s.NG1_COMPILE),i=t.get(s.NG1_TEMPLATE_CACHE),o=t.get(s.NG1_HTTP_BACKEND),a=t.get(s.NG1_CONTROLLER);for(var c in e)if(e.hasOwnProperty(c)){var u=e[c];u.directive=u.extractDirective(t),u.$controller=a,u.extractBindings();var l=u.compileTemplate(n,i,o);l&&r.push(l)}return Promise.all(r)},e}();t.UpgradeNg1ComponentAdapterBuilder=f;var d=function(){function e(e,t,r,n,i,s,u,f,d,h){this.directive=r,this.inputs=s,this.outputs=u,this.propOuts=f,this.checkProperties=d,this.propertyMap=h,this.destinationObj=null,this.checkLastValues=[];for(var g,v=n.nativeElement,m=[];g=v.firstChild;)v.removeChild(g),m.push(g);var y=t.$new(!!r.scope),_=c.element(v),b=r.controller,x=null;if(b){var w={$scope:y,$element:_};x=i(b,w,null,r.controllerAs),_.data(a.controllerKey(r.name),x)}var j=r.link;if("object"==typeof j&&(j=j.pre),j){var C=p,S=p,E=this.resolveRequired(_,r.require);r.link(y,_,C,E,S)}this.destinationObj=r.bindToController&&x?x:y,e(y,function(e,t){for(var r=0,n=e.length;n>r;r++)v.appendChild(e[r])},{parentBoundTranscludeFn:function(e,t){t(m)}});for(var O=0;O0?new v["default"]:this},y.take=function(e){return e>0?this:new v["default"]},r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support",["@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/OuterSubscriber","@reactivex/rxjs/dist/cjs/util/subscribeToResult"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function"); +}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/errorObject"),p=e("@reactivex/rxjs/dist/cjs/OuterSubscriber"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/subscribeToResult"),h=n(d),g=function(){function e(t){o(this,e),this.project=t}return e.prototype.call=function(e){return new v(e,this.project)},e}();t.CombineLatestOperator=g;var v=function(e){function t(r,n){o(this,t),e.call(this,r),this.project=n,this.active=0,this.values=[],this.observables=[],this.toRespond=[]}return i(t,e),t.prototype._next=function(e){var t=this.toRespond;t.push(t.length),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t;for(var r=0;t>r;r++){var n=e[r];this.add(h["default"](this,n,n,r))}}},t.prototype.notifyComplete=function(e){0===(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n){var i=this.values;i[r]=t;var o=this.toRespond;if(o.length>0){var s=o.indexOf(r);-1!==s&&o.splice(s,1)}if(0===o.length){var a=this.project,c=this.destination;if(a){var p=u["default"](a).apply(this,i);p===l.errorObject?c.error(l.errorObject.e):c.next(p)}else c.next(i)}},t}(f["default"]);return t.CombineLatestSubscriber=v,s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"),a=n(s);return t["default"]=new a["default"],r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable",["@reactivex/rxjs/dist/cjs/observables/PromiseObservable","@reactivex/rxjs/dist/cjs/observables/IteratorObservable","@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/util/Symbol_observable","@reactivex/rxjs/dist/cjs/util/Symbol_iterator","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/operators/observeOn-support","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/Symbol_observable"),g=n(h),v=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),m=n(v),y=e("@reactivex/rxjs/dist/cjs/Observable"),_=n(y),b=e("@reactivex/rxjs/dist/cjs/operators/observeOn-support"),x=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),w=n(x),j=Array.isArray,C=function(e){function t(r,n){i(this,t),e.call(this,null),this.ish=r,this.scheduler=n}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?w["default"]:arguments[1];if(e){if(j(e))return new d["default"](e,r);if("function"==typeof e.then)return new u["default"](e,r);if("function"==typeof e[g["default"]])return e instanceof _["default"]?e:new t(e,r);if("function"==typeof e[m["default"]])return new p["default"](e,null,null,r)}throw new TypeError(typeof e+" is not observable")},t.prototype._subscribe=function(e){var t=this.ish,r=this.scheduler;return r===w["default"]?t[g["default"]]().subscribe(e):t[g["default"]]().subscribe(new b.ObserveOnSubscriber(e,r,0))},t}(_["default"]);return t["default"]=C,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler","@reactivex/rxjs/dist/cjs/schedulers/NextTickAction","@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),d=n(f),h=function(e){function t(){i(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.scheduleNow=function(e,t){return(this.scheduled?new d["default"](this,e):new p["default"](this,e)).schedule(t)},t}(u["default"]);return t["default"]=h,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/groupBy",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/util/Map","@reactivex/rxjs/dist/cjs/util/FastMap","@reactivex/rxjs/dist/cjs/operators/groupBy-support","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,r){return new j(this,e,t,r)}var a=System.global,c=a.define;a.define=void 0,t.__esModule=!0,t.groupBy=s;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Observable"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/Subject"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/Map"),v=n(g),m=e("@reactivex/rxjs/dist/cjs/util/FastMap"),y=n(m),_=e("@reactivex/rxjs/dist/cjs/operators/groupBy-support"),b=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),x=n(b),w=e("@reactivex/rxjs/dist/cjs/util/errorObject"),j=function(e){function t(r,n,o,s){i(this,t),e.call(this),this.source=r,this.keySelector=n,this.elementSelector=o,this.durationSelector=s}return o(t,e),t.prototype._subscribe=function(e){var t=new _.RefCountSubscription,r=new C(e,t,this.keySelector,this.elementSelector,this.durationSelector);return t.setPrimary(this.source.subscribe(r)),t},t}(f["default"]);t.GroupByObservable=j;var C=function(e){function t(r,n,o,s,a){i(this,t),e.call(this),this.refCountSubscription=n,this.keySelector=o,this.elementSelector=s,this.durationSelector=a,this.groups=null,this.destination=r,this.add(r)}return o(t,e),t.prototype._next=function(e){var t=x["default"](this.keySelector)(e);if(t===w.errorObject)this.error(t.e);else{var r=this.groups,n=this.elementSelector,i=this.durationSelector;r||(r=this.groups="string"==typeof t?new y["default"]:new v["default"]);var o=r.get(t);if(!o){r.set(t,o=new h["default"]);var s=new _.GroupedObservable(t,o,this.refCountSubscription);if(i){var a=x["default"](i)(new _.GroupedObservable(t,o));a===w.errorObject?this.error(a.e):this.add(a._subscribe(new S(t,o,this)))}this.destination.next(s)}if(n){var c=x["default"](n)(e);c===w.errorObject?this.error(c.e):o.next(c)}else o.next(e)}},t.prototype._error=function(e){var t=this,r=this.groups;r&&r.forEach(function(r,n){r.error(e),t.removeGroup(n)}),this.destination.error(e)},t.prototype._complete=function(){var e=this,t=this.groups;t&&t.forEach(function(t,r){t.complete(),e.removeGroup(t)}),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups["delete"](e)},t}(l["default"]),S=function(e){function t(r,n,o){i(this,t),e.call(this,null),this.key=r,this.group=n,this.parent=o}return o(t,e),t.prototype._next=function(e){this.group.complete(),this.parent.removeGroup(this.key)},t.prototype._error=function(e){this.group.error(e),this.parent.removeGroup(this.key)},t.prototype._complete=function(){this.group.complete(),this.parent.removeGroup(this.key)},t}(l["default"]);return a.define=c,r.exports}),System.register("angular2/src/core/di/provider",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/reflection/reflection","angular2/src/core/di/key","angular2/src/core/di/metadata","angular2/src/core/di/exceptions","angular2/src/core/di/forward_ref"],!0,function(e,t,r){function n(e){return new A(e)}function i(e,t){var r=t.useClass,n=t.useValue,i=t.useExisting,o=t.useFactory,s=t.deps,a=t.multi;return new I(e,{useClass:r,useValue:n,useExisting:i,useFactory:o,deps:s,multi:a})}function o(e){var t,r;if(b.isPresent(e.useClass)){var n=O.resolveForwardRef(e.useClass);t=j.reflector.factory(n),r=f(n)}else b.isPresent(e.useExisting)?(t=function(e){return e},r=[P.fromKey(C.Key.get(e.useExisting))]):b.isPresent(e.useFactory)?(t=e.useFactory,r=p(e.useFactory,e.dependencies)):(t=function(){return e.useValue},r=R);return new k(t,r)}function s(e){return new D(C.Key.get(e.token),[o(e)],!1)}function a(e){var t=c(u(e,new Map));return t.map(function(e){if(e instanceof N)return new D(e.key,[e.resolvedFactory],!1);var t=e;return new D(t[0].key,t.map(function(e){return e.resolvedFactory}),!0)})}function c(e){return w.MapWrapper.values(e)}function u(e,t){return e.forEach(function(e){if(e instanceof b.Type)l(i(e,{useClass:e}),t);else if(e instanceof I)l(e,t);else{if(!(e instanceof Array))throw e instanceof A?new E.InvalidProviderError(e.token):new E.InvalidProviderError(e);u(e,t)}}),t}function l(e,t){var r=C.Key.get(e.token),n=o(e),i=new N(r,n);if(e.multi){var s=t.get(r.id);if(s instanceof Array)s.push(i);else{if(!b.isBlank(s))throw new E.MixingMultiProvidersWithRegularProvidersError(s,e);t.set(r.id,[i])}}else{var s=t.get(r.id);if(s instanceof Array)throw new E.MixingMultiProvidersWithRegularProvidersError(s,e);t.set(r.id,i)}}function p(e,t){if(b.isBlank(t))return f(e);var r=t.map(function(e){return[e]});return t.map(function(t){return d(e,t,r)})}function f(e){var t=j.reflector.parameters(e);if(b.isBlank(t))return[];if(t.some(b.isBlank))throw new E.NoAnnotationError(e,t);return t.map(function(r){return d(e,r,t)})}function d(e,t,r){var n=[],i=null,o=!1;if(!b.isArray(t))return t instanceof S.InjectMetadata?h(t.token,o,null,null,n):h(t,o,null,null,n);for(var s=null,a=null,c=0;c0){var t=this.eventBindings.map(function(t){return e._genEventBinding(t)}).join("\n");return"\n "+this.typeName+".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var "+this._names.getPreventDefaultAccesor()+" = false;\n "+this._names.genInitEventLocals()+"\n "+t+"\n return "+this._names.getPreventDefaultAccesor()+";\n }\n "}return""},e.prototype._genEventBinding=function(e){var t=this,r=[];return this._endOfBlockIdxs=[],a.ListWrapper.forEachWithIndex(e.records,function(n,i){var o;o=n.isConditionalSkipRecord()?t._genConditionalSkip(n,t._names.getEventLocalName(e,i)):n.isUnconditionalSkipRecord()?t._genUnconditionalSkip(n):t._genEventBindingEval(e,n),o+=t._genEndOfSkipBlock(i),r.push(o)}),'\n if (eventName === "'+e.eventName+'" && elIndex === '+e.elIndex+") {\n "+r.join("\n")+"\n }"},e.prototype._genEventBindingEval=function(e,t){if(t.lastInBinding){var r=this._logic.genEventBindingEvalValue(e,t),n=this._genMarkPathToRootAsCheckOnce(t),i=this._genUpdatePreventDefault(e,t);return r+"\n"+n+"\n"+i}return this._logic.genEventBindingEvalValue(e,t)},e.prototype._genMarkPathToRootAsCheckOnce=function(e){var t=e.bindingRecord;return t.isDefaultChangeDetection()?"":this._names.getDetectorName(t.directiveRecord.directiveIndex)+".markPathToRootAsCheckOnce();"},e.prototype._genUpdatePreventDefault=function(e,t){var r=this._names.getEventLocalName(e,t.selfIndex);return"if ("+r+" === false) { "+this._names.getPreventDefaultAccesor()+" = true};"},e.prototype._maybeGenDehydrateDirectives=function(){var e=this._names.genPipeOnDestroy();e&&(e="if (destroyPipes) { "+e+" }");var t=this._names.genDehydrateFields();return e||t?this.typeName+".prototype.dehydrateDirectives = function(destroyPipes) {\n "+e+"\n "+t+"\n }":""},e.prototype._maybeGenHydrateDirectives=function(){var e=this._logic.genHydrateDirectives(this.directiveRecords),t=this._logic.genHydrateDetectors(this.directiveRecords);return e||t?this.typeName+".prototype.hydrateDirectives = function(directives) {\n "+e+"\n "+t+"\n }":""},e.prototype._maybeGenAfterContentLifecycleCallbacks=function(){var e=this._logic.genContentLifecycleCallbacks(this.directiveRecords);if(e.length>0){var t=e.join("\n");return"\n "+this.typeName+".prototype.afterContentLifecycleCallbacksInternal = function() {\n "+t+"\n }\n "}return""},e.prototype._maybeGenAfterViewLifecycleCallbacks=function(){var e=this._logic.genViewLifecycleCallbacks(this.directiveRecords);if(e.length>0){var t=e.join("\n");return"\n "+this.typeName+".prototype.afterViewLifecycleCallbacksInternal = function() {\n "+t+"\n }\n "}return""},e.prototype._genAllRecords=function(e){var t=[];this._endOfBlockIdxs=[];for(var r=0;r0?this._renderer.detachFragment(i.renderFragment):(this._renderer.dehydrateView(i.render),this._renderer.detachFragment(i.renderFragment),this._destroyPooledView(i))},t.prototype._viewDehydrateRecurse=function(e){e.hydrated()&&this._utils.dehydrateView(e);for(var t=e.viewContainers,r=e.viewOffset,n=e.viewOffset+e.proto.mergeInfo.viewCount-1,i=e.elementOffset,o=r;n>=o;o++)for(var s=e.views[o],a=0;a=0;u--)this._destroyViewInContainer(s,i,u)}},t=s([u.Injectable(),c(4,u.Inject(u.forwardRef(function(){return _.ProtoViewFactory}))),a("design:paramtypes",[v.AppViewPool,m.AppViewListener,g.AppViewManagerUtils,h.Renderer,Object])],t)}(b);return t.AppViewManager_=x,n.define=i,r.exports}),System.register("angular2/src/animate/css_animation_builder",["angular2/src/animate/css_animation_options","angular2/src/animate/animation"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/animate/css_animation_options"),s=e("angular2/src/animate/animation"),a=function(){function e(e){this.browserDetails=e,this.data=new o.CssAnimationOptions}return e.prototype.addAnimationClass=function(e){return this.data.animationClasses.push(e),this},e.prototype.addClass=function(e){return this.data.classesToAdd.push(e),this},e.prototype.removeClass=function(e){return this.data.classesToRemove.push(e),this},e.prototype.setDuration=function(e){return this.data.duration=e,this},e.prototype.setDelay=function(e){return this.data.delay=e,this},e.prototype.setStyles=function(e,t){return this.setFromStyles(e).setToStyles(t)},e.prototype.setFromStyles=function(e){return this.data.fromStyles=e,this},e.prototype.setToStyles=function(e){return this.data.toStyles=e,this},e.prototype.start=function(e){return new s.Animation(e,this.data,this.browserDetails)},e}();return t.CssAnimationBuilder=a,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_control_name",["angular2/src/facade/lang","angular2/src/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/common/forms/directives/control_container","angular2/src/common/forms/directives/ng_control","angular2/src/common/forms/directives/control_value_accessor","angular2/src/common/forms/directives/shared","angular2/src/common/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/facade/lang"),l=e("angular2/src/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/common/forms/directives/control_container"),h=e("angular2/src/common/forms/directives/ng_control"),g=e("angular2/src/common/forms/directives/control_value_accessor"),v=e("angular2/src/common/forms/directives/shared"),m=e("angular2/src/common/forms/validators"),y=u.CONST_EXPR(new f.Provider(h.NgControl,{useExisting:f.forwardRef(function(){return _})})),_=function(e){function t(t,r,n,i){e.call(this),this._parent=t,this._validators=r,this._asyncValidators=n,this.update=new l.EventEmitter,this._added=!1,this.valueAccessor=v.selectValueAccessor(this,i)}return o(t,e),t.prototype.onChanges=function(e){this._added||(this.formDirective.addControl(this),this._added=!0),v.isPropertyUpdated(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},t.prototype.onDestroy=function(){this.formDirective.removeControl(this)},t.prototype.viewToModelUpdate=function(e){this.viewModel=e,l.ObservableWrapper.callNext(this.update,e)},Object.defineProperty(t.prototype,"path",{get:function(){return v.controlPath(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent.formDirective},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return v.composeValidators(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return v.composeAsyncValidators(this._asyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.formDirective.getControl(this)},enumerable:!0,configurable:!0}),t=s([p.Directive({selector:"[ng-control]",bindings:[y],inputs:["name: ngControl","model: ngModel"],outputs:["update: ngModelChange"],exportAs:"form"}),c(0,f.Host()),c(0,f.SkipSelf()),c(1,f.Optional()),c(1,f.Inject(m.NG_VALIDATORS)),c(2,f.Optional()),c(2,f.Inject(m.NG_ASYNC_VALIDATORS)),c(3,f.Optional()),c(3,f.Inject(g.NG_VALUE_ACCESSOR)),a("design:paramtypes",[d.ControlContainer,Array,Array,Array])],t)}(h.NgControl);return t.NgControlName=_,n.define=i,r.exports}),System.register("angular2/src/compiler/change_detector_compiler",["angular2/src/compiler/source_module","angular2/src/core/change_detection/change_detection_jit_generator","angular2/src/compiler/change_definition_factory","angular2/src/facade/lang","angular2/src/core/change_detection/change_detection","angular2/src/transform/template_compiler/change_detector_codegen","angular2/src/compiler/util","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},a=e("angular2/src/compiler/source_module"),c=e("angular2/src/core/change_detection/change_detection_jit_generator"),u=e("angular2/src/compiler/change_definition_factory"),l=e("angular2/src/facade/lang"),p=e("angular2/src/core/change_detection/change_detection"),f=e("angular2/src/transform/template_compiler/change_detector_codegen"),d=e("angular2/src/compiler/util"),h=e("angular2/src/core/di"),g="AbstractChangeDetector",v="ChangeDetectionUtil",m="ChangeDetectorState",y=a.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector"+d.MODULE_SUFFIX),_=a.moduleRef("package:angular2/src/core/change_detection/change_detection_util"+d.MODULE_SUFFIX),b=a.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector"+d.MODULE_SUFFIX),x=a.moduleRef("package:angular2/src/core/change_detection/constants"+d.MODULE_SUFFIX),w=function(){function e(e){this._genConfig=e}return e.prototype.compileComponentRuntime=function(e,t,r){var n=this,i=u.createChangeDetectorDefinitions(e,t,this._genConfig,r);return i.map(function(e){return n._createChangeDetectorFactory(e)})},e.prototype._createChangeDetectorFactory=function(e){if(l.IS_DART||!this._genConfig.useJit){var t=new p.DynamicProtoChangeDetector(e);return function(e){return t.instantiate(e)}}return new c.ChangeDetectorJITGenerator(e,v,g,m).generate()},e.prototype.compileComponentCodeGen=function(e,t,r){var n=u.createChangeDetectorDefinitions(e,t,this._genConfig,r),i=[],o=0,s=n.map(function(t){var r,n;if(l.IS_DART){r=new f.Codegen(b);var s="_"+t.id,u=0===o&&e.isHost?"dynamic":""+a.moduleRef(e.moduleUrl)+e.name;r.generate(u,s,t),i.push(s+".newChangeDetector"),n=r.toString()}else r=new c.ChangeDetectorJITGenerator(t,""+_+v,""+y+g,""+x+m),i.push("function(dispatcher) { return new "+r.typeName+"(dispatcher); }"),n=r.generateSource();return o++,n});return new a.SourceExpressions(s,i)},e=o([h.Injectable(),s("design:paramtypes",[p.ChangeDetectorGenConfig])],e)}();return t.ChangeDetectionCompiler=w,n.define=i,r.exports}),System.register("angular2/src/compiler/template_parser",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/core/di","angular2/src/facade/exceptions","angular2/src/core/change_detection/change_detection","angular2/src/compiler/html_parser","angular2/src/compiler/template_ast","angular2/src/compiler/selector","angular2/src/compiler/schema/element_schema_registry","angular2/src/compiler/template_preparser","angular2/src/compiler/style_url_resolver","angular2/src/compiler/html_ast","angular2/src/compiler/util"],!0,function(e,t,r){function n(e){return l.StringWrapper.split(e.trim(),/\s+/g)}function i(e,t){var r=new v.CssSelector;r.setElement(e);for(var i=0;i0){var o=n.errors.join("\n");throw new f.BaseException("Template parse errors:\n"+o)}return i},e=a([p.Injectable(),c("design:paramtypes",[d.Parser,m.ElementSchemaRegistry,h.HtmlParser])],e)}();t.TemplateParser=D;var k=function(){function e(e,t,r){var n=this;this._exprParser=t,this._schemaRegistry=r,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.selectorMatcher=new v.SelectorMatcher,u.ListWrapper.forEachWithIndex(e,function(e,t){var r=v.CssSelector.parse(e.selector);n.selectorMatcher.addSelectables(r,e),n.directivesIndex.set(e,t)})}return e.prototype._reportError=function(e){this.errors.push(e)},e.prototype._parseInterpolation=function(e,t){try{return this._exprParser.parseInterpolation(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseAction=function(e,t){try{return this._exprParser.parseAction(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseBinding=function(e,t){try{return this._exprParser.parseBinding(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseTemplateBindings=function(e,t){try{return this._exprParser.parseTemplateBindings(e,t)}catch(r){return this._reportError(""+r),[]}},e.prototype.visitText=function(e,t){var r=t.findNgContentIndex(T),n=this._parseInterpolation(e.value,e.sourceInfo);return l.isPresent(n)?new g.BoundTextAst(n,r,e.sourceInfo):new g.TextAst(e.value,r,e.sourceInfo)},e.prototype.visitAttr=function(e,t){return new g.AttrAst(e.name,e.value,e.sourceInfo)},e.prototype.visitElement=function(e,t){var r=this,n=e.name,o=y.preparseElement(e);if(o.type===y.PreparsedElementType.SCRIPT||o.type===y.PreparsedElementType.STYLE)return null;if(o.type===y.PreparsedElementType.STYLESHEET&&_.isStyleUrlResolvable(o.hrefAttr))return null;var s=[],a=[],c=[],u=[],l=[],p=[],f=[],d=!1,h=[];e.attrs.forEach(function(e){s.push([e.name,e.value]);var t=r._parseAttr(e,s,a,u,c),n=r._parseInlineTemplateBinding(e,f,l,p);t||n||h.push(r.visitAttr(e,null)),n&&(d=!0)});var v,m=n==j,x=i(n,s),w=this._createDirectiveAsts(e.name,this._parseDirectives(this.selectorMatcher,x),a,m?[]:c,e.sourceInfo),C=this._createElementPropertyAsts(e.name,a,w),S=b.htmlVisitAll(o.nonBindable?B:this,e.children,M.create(w)),E=d?null:t.findNgContentIndex(x);if(o.type===y.PreparsedElementType.NG_CONTENT)v=new g.NgContentAst(this.ngContentCount++,E,e.sourceInfo);else if(m)this._assertAllEventsPublishedByDirectives(w,u,e.sourceInfo),this._assertNoComponentsNorElementBindingsOnTemplate(w,C,e.sourceInfo),v=new g.EmbeddedTemplateAst(h,u,c,w,S,E,e.sourceInfo);else{this._assertOnlyOneComponent(w,e.sourceInfo);var O=c.filter(function(e){return 0===e.value.length});v=new g.ElementAst(n,h,C,u,O,w,S,E,e.sourceInfo)}if(d){var P=i(j,f),R=this._createDirectiveAsts(e.name,this._parseDirectives(this.selectorMatcher,P),l,[],e.sourceInfo),I=this._createElementPropertyAsts(e.name,l,R);this._assertNoComponentsNorElementBindingsOnTemplate(R,I,e.sourceInfo),v=new g.EmbeddedTemplateAst([],[],p,R,[v],t.findNgContentIndex(P),e.sourceInfo)}return v},e.prototype._parseInlineTemplateBinding=function(e,t,r,n){var i=null;if(e.name==C)i=e.value;else if(e.name.startsWith(S)){var o=e.name.substring(S.length);i=0==e.value.length?o:o+" "+e.value}if(l.isPresent(i)){for(var s=this._parseTemplateBindings(i,e.sourceInfo),a=0;a0&&!u.SetWrapper.has(s,e.name)&&o._reportError('There is no directive with "exportAs" set to "'+e.value+'" at '+e.sourceInfo)}),a},e.prototype._createDirectiveHostPropertyAsts=function(e,t,r,n){var i=this;l.isPresent(t)&&u.StringMapWrapper.forEach(t,function(t,o){var s=i._parseBinding(t,r);n.push(i._createElementPropertyAst(e,o,s,r))})},e.prototype._createDirectiveHostEventAsts=function(e,t,r){var n=this;l.isPresent(e)&&u.StringMapWrapper.forEach(e,function(e,i){n._parseEvent(i,e,t,[],r)})},e.prototype._createDirectivePropertyAsts=function(e,t,r){if(l.isPresent(e)){var n=new Map;t.forEach(function(e){var t=x.dashCaseToCamelCase(e.name),r=n.get(e.name);(l.isBlank(r)||r.isLiteral)&&n.set(t,e)}),u.StringMapWrapper.forEach(e,function(e,t){e=x.dashCaseToCamelCase(e);var i=n.get(e);l.isPresent(i)&&r.push(new g.BoundDirectivePropertyAst(t,i.name,i.expression,i.sourceInfo))})}},e.prototype._createElementPropertyAsts=function(e,t,r){var n=this,i=[],o=new Map;return r.forEach(function(e){e.inputs.forEach(function(e){o.set(e.templateName,e)})}),t.forEach(function(t){!t.isLiteral&&l.isBlank(o.get(t.name))&&i.push(n._createElementPropertyAst(e,t.name,t.expression,t.sourceInfo))}),i},e.prototype._createElementPropertyAst=function(e,t,r,n){var i,o,s=null,a=l.StringWrapper.split(t,O);return 1===a.length?(o=this._schemaRegistry.getMappedPropName(x.dashCaseToCamelCase(a[0])),i=g.PropertyBindingType.Property,this._schemaRegistry.hasProperty(e,o)||this._reportError("Can't bind to '"+o+"' since it isn't a known native property in "+n)):a[0]==P?(o=x.dashCaseToCamelCase(a[1]),i=g.PropertyBindingType.Attribute):a[0]==R?(o=a[1],i=g.PropertyBindingType.Class):a[0]==I?(s=a.length>2?a[2]:null,o=x.dashCaseToCamelCase(a[1]),i=g.PropertyBindingType.Style):(this._reportError("Invalid property name "+t+" in "+n),i=null),new g.BoundElementPropertyAst(o,i,r,s,n)},e.prototype._findComponentDirectiveNames=function(e){var t=[];return e.forEach(function(e){var r=e.directive.type.name;e.directive.isComponent&&t.push(r)}),t},e.prototype._assertOnlyOneComponent=function(e,t){var r=this._findComponentDirectiveNames(e);r.length>1&&this._reportError("More than one component: "+r.join(",")+" in "+t)},e.prototype._assertNoComponentsNorElementBindingsOnTemplate=function(e,t,r){var n=this,i=this._findComponentDirectiveNames(e);i.length>0&&this._reportError("Components on an embedded template: "+i.join(",")+" in "+r),t.forEach(function(e){n._reportError("Property binding "+e.name+" not used by any directive on an embedded template in "+e.sourceInfo)})},e.prototype._assertAllEventsPublishedByDirectives=function(e,t,r){var n=this,i=new Set;e.forEach(function(e){u.StringMapWrapper.forEach(e.directive.outputs,function(e,t){i.add(e)})}),t.forEach(function(e){(l.isPresent(e.target)||!u.SetWrapper.has(i,e.name))&&n._reportError("Event binding "+e.fullName+" not emitted by any directive on an embedded template in "+r)})},e}(),A=function(){function e(){}return e.prototype.visitElement=function(e,t){var r=y.preparseElement(e);if(r.type===y.PreparsedElementType.SCRIPT||r.type===y.PreparsedElementType.STYLE||r.type===y.PreparsedElementType.STYLESHEET)return null;var n=e.attrs.map(function(e){return[e.name,e.value]}),o=i(e.name,n),s=t.findNgContentIndex(o),a=b.htmlVisitAll(this,e.children,V);return new g.ElementAst(e.name,b.htmlVisitAll(this,e.attrs),[],[],[],[],a,s,e.sourceInfo)},e.prototype.visitAttr=function(e,t){return new g.AttrAst(e.name,e.value,e.sourceInfo)},e.prototype.visitText=function(e,t){var r=t.findNgContentIndex(T);return new g.TextAst(e.value,r,e.sourceInfo)},e}(),N=function(){function e(e,t,r,n){this.name=e,this.expression=t,this.isLiteral=r,this.sourceInfo=n}return e}();t.splitClasses=n;var M=function(){function e(e,t){this.ngContentIndexMatcher=e,this.wildcardNgContentIndex=t}return e.create=function(t){if(0===t.length||!t[0].directive.isComponent)return V;for(var r=new v.SelectorMatcher,n=t[0].directive.template.ngContentSelectors,i=null,o=0;o0?t[0]:null; +},e}(),V=new M(new v.SelectorMatcher,null),B=new A;return o.define=s,r.exports}),System.register("angular2/src/core/dom/browser_adapter",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/core/dom/dom_adapter","angular2/src/core/dom/generic_browser_adapter"],!0,function(e,t,r){function n(){return u.isBlank(m)&&(m=document.querySelector("base"),u.isBlank(m))?null:m.getAttribute("href")}function i(e){return u.isBlank(y)&&(y=document.createElement("a")),y.setAttribute("href",e),"/"===y.pathname.charAt(0)?y.pathname:"/"+y.pathname}var o=System.global,s=o.define;o.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/facade/collection"),u=e("angular2/src/facade/lang"),l=e("angular2/src/core/dom/dom_adapter"),p=e("angular2/src/core/dom/generic_browser_adapter"),f={"class":"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},d=3,h={"\b":"Backspace"," ":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},g={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"},v=function(e){function t(){e.apply(this,arguments)}return a(t,e),t.prototype.parse=function(e){throw new Error("parse not implemented")},t.makeCurrent=function(){l.setRootDomAdapter(new t)},t.prototype.hasProperty=function(e,t){return t in e},t.prototype.setProperty=function(e,t,r){e[t]=r},t.prototype.getProperty=function(e,t){return e[t]},t.prototype.invoke=function(e,t,r){e[t].apply(e,r)},t.prototype.logError=function(e){window.console.error?window.console.error(e):window.console.log(e)},t.prototype.log=function(e){window.console.log(e)},t.prototype.logGroup=function(e){window.console.group?(window.console.group(e),this.logError(e)):window.console.log(e)},t.prototype.logGroupEnd=function(){window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return f},enumerable:!0,configurable:!0}),t.prototype.query=function(e){return document.querySelector(e)},t.prototype.querySelector=function(e,t){return e.querySelector(t)},t.prototype.querySelectorAll=function(e,t){return e.querySelectorAll(t)},t.prototype.on=function(e,t,r){e.addEventListener(t,r,!1)},t.prototype.onAndCancel=function(e,t,r){return e.addEventListener(t,r,!1),function(){e.removeEventListener(t,r,!1)}},t.prototype.dispatchEvent=function(e,t){e.dispatchEvent(t)},t.prototype.createMouseEvent=function(e){var t=document.createEvent("MouseEvent");return t.initEvent(e,!0,!0),t},t.prototype.createEvent=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t},t.prototype.preventDefault=function(e){e.preventDefault(),e.returnValue=!1},t.prototype.isPrevented=function(e){return e.defaultPrevented||u.isPresent(e.returnValue)&&!e.returnValue},t.prototype.getInnerHTML=function(e){return e.innerHTML},t.prototype.getOuterHTML=function(e){return e.outerHTML},t.prototype.nodeName=function(e){return e.nodeName},t.prototype.nodeValue=function(e){return e.nodeValue},t.prototype.type=function(e){return e.type},t.prototype.content=function(e){return this.hasProperty(e,"content")?e.content:e},t.prototype.firstChild=function(e){return e.firstChild},t.prototype.nextSibling=function(e){return e.nextSibling},t.prototype.parentElement=function(e){return e.parentNode},t.prototype.childNodes=function(e){return e.childNodes},t.prototype.childNodesAsList=function(e){for(var t=e.childNodes,r=c.ListWrapper.createFixedSize(t.length),n=0;nn;n++)r[n]=arguments[n];var i=r[r.length-1];i&&"function"==typeof i.schedule?r.pop():i=void 0;var o=r.length;return o>1?new t(r,i):1===o?new p["default"](r[0],i):new d["default"](i)},t.dispatch=function(e){var t=e.array,r=e.index,n=e.count,i=e.subscriber;return r>=n?void i.complete():(i.next(t[r]),void(i.isUnsubscribed||(e.index=r+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,n=this.array,i=n.length,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{array:n,index:r,count:i,subscriber:e}));else{for(var s=0;i>s&&!e.isUnsubscribed;s++)e.next(n[s]);e.complete()}},t}(u["default"]);return t["default"]=h,r.exports=t["default"],s.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concat-static",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=l["default"],t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];var i=r;return"function"==typeof i[r.length-1].schedule&&(e=i.pop(),i.push(1,e)),c["default"].fromArray(r).mergeAll(1)}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/Observable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),l=n(u);return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick",["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"),a=n(s);return t["default"]=new a["default"],r.exports=t["default"],i.define=o,r.exports}),System.register("angular2/src/core/di/injector",["angular2/src/facade/collection","angular2/src/core/di/provider","angular2/src/core/di/exceptions","angular2/src/facade/lang","angular2/src/core/di/key","angular2/src/core/di/metadata"],!0,function(e,t,r){function n(e,t){return e===t||t===h.PublicAndPrivate||e===h.PublicAndPrivate}function i(e,t){for(var r=[],n=0;n0&&(this.provider0=t[0].provider,this.keyId0=t[0].getKeyId(),this.visibility0=t[0].visibility),r>1&&(this.provider1=t[1].provider,this.keyId1=t[1].getKeyId(),this.visibility1=t[1].visibility),r>2&&(this.provider2=t[2].provider,this.keyId2=t[2].getKeyId(),this.visibility2=t[2].visibility),r>3&&(this.provider3=t[3].provider,this.keyId3=t[3].getKeyId(),this.visibility3=t[3].visibility),r>4&&(this.provider4=t[4].provider,this.keyId4=t[4].getKeyId(),this.visibility4=t[4].visibility),r>5&&(this.provider5=t[5].provider,this.keyId5=t[5].getKeyId(),this.visibility5=t[5].visibility),r>6&&(this.provider6=t[6].provider,this.keyId6=t[6].getKeyId(),this.visibility6=t[6].visibility),r>7&&(this.provider7=t[7].provider,this.keyId7=t[7].getKeyId(),this.visibility7=t[7].visibility),r>8&&(this.provider8=t[8].provider,this.keyId8=t[8].getKeyId(),this.visibility8=t[8].visibility),r>9&&(this.provider9=t[9].provider,this.keyId9=t[9].getKeyId(),this.visibility9=t[9].visibility)}return e.prototype.getProviderAtIndex=function(e){if(0==e)return this.provider0;if(1==e)return this.provider1;if(2==e)return this.provider2;if(3==e)return this.provider3;if(4==e)return this.provider4;if(5==e)return this.provider5;if(6==e)return this.provider6;if(7==e)return this.provider7;if(8==e)return this.provider8;if(9==e)return this.provider9;throw new u.OutOfBoundsError(e)},e.prototype.createInjectorStrategy=function(e){return new y(e,this)},e}();t.ProtoInjectorInlineStrategy=g;var v=function(){function e(e,t){var r=t.length;this.providers=a.ListWrapper.createFixedSize(r),this.keyIds=a.ListWrapper.createFixedSize(r),this.visibilities=a.ListWrapper.createFixedSize(r);for(var n=0;r>n;n++)this.providers[n]=t[n].provider,this.keyIds[n]=t[n].getKeyId(),this.visibilities[n]=t[n].visibility}return e.prototype.getProviderAtIndex=function(e){if(0>e||e>=this.providers.length)throw new u.OutOfBoundsError(e);return this.providers[e]},e.prototype.createInjectorStrategy=function(e){return new _(this,e)},e}();t.ProtoInjectorDynamicStrategy=v;var m=function(){function e(e){this.numberOfProviders=e.length,this._strategy=e.length>d?new v(this,e):new g(this,e)}return e.prototype.getProviderAtIndex=function(e){return this._strategy.getProviderAtIndex(e)},e}();t.ProtoInjector=m;var y=function(){function e(e,r){this.injector=e,this.protoStrategy=r,this.obj0=t.UNDEFINED,this.obj1=t.UNDEFINED,this.obj2=t.UNDEFINED,this.obj3=t.UNDEFINED,this.obj4=t.UNDEFINED,this.obj5=t.UNDEFINED,this.obj6=t.UNDEFINED,this.obj7=t.UNDEFINED,this.obj8=t.UNDEFINED,this.obj9=t.UNDEFINED}return e.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},e.prototype.instantiateProvider=function(e,t){return this.injector._new(e,t)},e.prototype.attach=function(e,t){var r=this.injector;r._parent=e,r._isHost=t},e.prototype.getObjByKeyId=function(e,r){var i=this.protoStrategy,o=this.injector;return i.keyId0===e&&n(i.visibility0,r)?(this.obj0===t.UNDEFINED&&(this.obj0=o._new(i.provider0,i.visibility0)),this.obj0):i.keyId1===e&&n(i.visibility1,r)?(this.obj1===t.UNDEFINED&&(this.obj1=o._new(i.provider1,i.visibility1)),this.obj1):i.keyId2===e&&n(i.visibility2,r)?(this.obj2===t.UNDEFINED&&(this.obj2=o._new(i.provider2,i.visibility2)),this.obj2):i.keyId3===e&&n(i.visibility3,r)?(this.obj3===t.UNDEFINED&&(this.obj3=o._new(i.provider3,i.visibility3)),this.obj3):i.keyId4===e&&n(i.visibility4,r)?(this.obj4===t.UNDEFINED&&(this.obj4=o._new(i.provider4,i.visibility4)),this.obj4):i.keyId5===e&&n(i.visibility5,r)?(this.obj5===t.UNDEFINED&&(this.obj5=o._new(i.provider5,i.visibility5)),this.obj5):i.keyId6===e&&n(i.visibility6,r)?(this.obj6===t.UNDEFINED&&(this.obj6=o._new(i.provider6,i.visibility6)),this.obj6):i.keyId7===e&&n(i.visibility7,r)?(this.obj7===t.UNDEFINED&&(this.obj7=o._new(i.provider7,i.visibility7)),this.obj7):i.keyId8===e&&n(i.visibility8,r)?(this.obj8===t.UNDEFINED&&(this.obj8=o._new(i.provider8,i.visibility8)),this.obj8):i.keyId9===e&&n(i.visibility9,r)?(this.obj9===t.UNDEFINED&&(this.obj9=o._new(i.provider9,i.visibility9)),this.obj9):t.UNDEFINED},e.prototype.getObjAtIndex=function(e){if(0==e)return this.obj0;if(1==e)return this.obj1;if(2==e)return this.obj2;if(3==e)return this.obj3;if(4==e)return this.obj4;if(5==e)return this.obj5;if(6==e)return this.obj6;if(7==e)return this.obj7;if(8==e)return this.obj8;if(9==e)return this.obj9;throw new u.OutOfBoundsError(e)},e.prototype.getMaxNumberOfObjects=function(){return d},e}();t.InjectorInlineStrategy=y;var _=function(){function e(e,r){this.protoStrategy=e,this.injector=r,this.objs=a.ListWrapper.createFixedSize(e.providers.length),a.ListWrapper.fill(this.objs,t.UNDEFINED)}return e.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},e.prototype.instantiateProvider=function(e,t){return this.injector._new(e,t)},e.prototype.attach=function(e,t){var r=this.injector;r._parent=e,r._isHost=t},e.prototype.getObjByKeyId=function(e,r){for(var i=this.protoStrategy,o=0;oe||e>=this.objs.length)throw new u.OutOfBoundsError(e);return this.objs[e]},e.prototype.getMaxNumberOfObjects=function(){return this.objs.length},e}();t.InjectorDynamicStrategy=_;var b=function(){function e(e,t){this.provider=e,this.visibility=t}return e.prototype.getKeyId=function(){return this.provider.key.id},e}();t.ProviderWithVisibility=b;var x=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._depProvider=r,this._debugContext=n,this._isHost=!1,this._constructionCounter=0,this._proto=e,this._parent=t,this._strategy=e._strategy.createInjectorStrategy(this)}return e.resolve=function(e){return c.resolveProviders(e)},e.resolveAndCreate=function(t){var r=e.resolve(t);return e.fromResolvedProviders(r)},e.fromResolvedProviders=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new m(r);return new e(n,null,null)},e.fromResolvedBindings=function(t){return e.fromResolvedProviders(t)},e.prototype.debugContext=function(){return this._debugContext()},e.prototype.get=function(e){return this._getByKey(p.Key.get(e),null,null,!1,h.PublicAndPrivate)},e.prototype.getOptional=function(e){return this._getByKey(p.Key.get(e),null,null,!0,h.PublicAndPrivate)},e.prototype.getAt=function(e){return this._strategy.getObjAtIndex(e)},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"internalStrategy",{get:function(){return this._strategy},enumerable:!0,configurable:!0}),e.prototype.resolveAndCreateChild=function(t){var r=e.resolve(t);return this.createChildFromResolved(r)},e.prototype.createChildFromResolved=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new m(r),i=new e(n,null,null);return i._parent=this,i},e.prototype.resolveAndInstantiate=function(t){return this.instantiateResolved(e.resolve([t])[0])},e.prototype.instantiateResolved=function(e){return this._instantiateProvider(e,h.PublicAndPrivate)},e.prototype._new=function(e,t){if(this._constructionCounter++>this._strategy.getMaxNumberOfObjects())throw new u.CyclicDependencyError(this,e.key);return this._instantiateProvider(e,t)},e.prototype._instantiateProvider=function(e,t){if(e.multiProvider){for(var r=a.ListWrapper.createFixedSize(e.resolvedFactories.length),n=0;n0?this._getByDependency(e,S[0],r):null,i=E>1?this._getByDependency(e,S[1],r):null,o=E>2?this._getByDependency(e,S[2],r):null,s=E>3?this._getByDependency(e,S[3],r):null,a=E>4?this._getByDependency(e,S[4],r):null,c=E>5?this._getByDependency(e,S[5],r):null,l=E>6?this._getByDependency(e,S[6],r):null,p=E>7?this._getByDependency(e,S[7],r):null,f=E>8?this._getByDependency(e,S[8],r):null,d=E>9?this._getByDependency(e,S[9],r):null,h=E>10?this._getByDependency(e,S[10],r):null,g=E>11?this._getByDependency(e,S[11],r):null,v=E>12?this._getByDependency(e,S[12],r):null,m=E>13?this._getByDependency(e,S[13],r):null,y=E>14?this._getByDependency(e,S[14],r):null,_=E>15?this._getByDependency(e,S[15],r):null,b=E>16?this._getByDependency(e,S[16],r):null,x=E>17?this._getByDependency(e,S[17],r):null,w=E>18?this._getByDependency(e,S[18],r):null,j=E>19?this._getByDependency(e,S[19],r):null}catch(O){throw(O instanceof u.AbstractProviderError||O instanceof u.InstantiationError)&&O.addKey(this,e.key),O}var P;try{switch(E){case 0:P=C();break;case 1:P=C(n);break;case 2:P=C(n,i);break;case 3:P=C(n,i,o);break;case 4:P=C(n,i,o,s);break;case 5:P=C(n,i,o,s,a);break;case 6:P=C(n,i,o,s,a,c);break;case 7:P=C(n,i,o,s,a,c,l);break;case 8:P=C(n,i,o,s,a,c,l,p);break;case 9:P=C(n,i,o,s,a,c,l,p,f);break;case 10:P=C(n,i,o,s,a,c,l,p,f,d);break;case 11:P=C(n,i,o,s,a,c,l,p,f,d,h);break;case 12:P=C(n,i,o,s,a,c,l,p,f,d,h,g);break;case 13:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v);break;case 14:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m);break;case 15:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y);break;case 16:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y,_);break;case 17:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y,_,b);break;case 18:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y,_,b,x);break;case 19:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y,_,b,x,w);break;case 20:P=C(n,i,o,s,a,c,l,p,f,d,h,g,v,m,y,_,b,x,w,j)}}catch(O){throw new u.InstantiationError(this,O,O.stack,e.key)}return P},e.prototype._getByDependency=function(e,r,n){var i=l.isPresent(this._depProvider)?this._depProvider.getDependency(this,e,r):t.UNDEFINED;return i!==t.UNDEFINED?i:this._getByKey(r.key,r.lowerBoundVisibility,r.upperBoundVisibility,r.optional,n)},e.prototype._getByKey=function(e,t,r,n,i){return e===w?this:r instanceof f.SelfMetadata?this._getByKeySelf(e,n,i):r instanceof f.HostMetadata?this._getByKeyHost(e,n,i,t):this._getByKeyDefault(e,n,i,t)},e.prototype._throwOrNull=function(e,t){if(t)return null;throw new u.NoProviderError(this,e)},e.prototype._getByKeySelf=function(e,r,n){var i=this._strategy.getObjByKeyId(e.id,n);return i!==t.UNDEFINED?i:this._throwOrNull(e,r)},e.prototype._getByKeyHost=function(e,r,n,i){var o=this;if(i instanceof f.SkipSelfMetadata){if(o._isHost)return this._getPrivateDependency(e,r,o);o=o._parent}for(;null!=o;){var s=o._strategy.getObjByKeyId(e.id,n);if(s!==t.UNDEFINED)return s;if(l.isPresent(o._parent)&&o._isHost)return this._getPrivateDependency(e,r,o);o=o._parent}return this._throwOrNull(e,r)},e.prototype._getPrivateDependency=function(e,r,n){var i=n._parent._strategy.getObjByKeyId(e.id,h.Private);return i!==t.UNDEFINED?i:this._throwOrNull(e,r)},e.prototype._getByKeyDefault=function(e,r,n,i){var o=this;for(i instanceof f.SkipSelfMetadata&&(n=o._isHost?h.PublicAndPrivate:h.Public,o=o._parent);null!=o;){var s=o._strategy.getObjByKeyId(e.id,n);if(s!==t.UNDEFINED)return s;n=o._isHost?h.PublicAndPrivate:h.Public,o=o._parent}return this._throwOrNull(e,r)},Object.defineProperty(e.prototype,"displayName",{get:function(){return"Injector(providers: ["+i(this,function(e){return' "'+e.key.displayName+'" '}).join(", ")+"])"},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.displayName},e}();t.Injector=x;var w=p.Key.get(x);return o.define=s,r.exports}),System.register("angular2/src/core/change_detection/dynamic_change_detector",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/change_detection/abstract_change_detector","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/constants","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/lang"),a=e("angular2/src/facade/exceptions"),c=e("angular2/src/facade/collection"),u=e("angular2/src/core/change_detection/abstract_change_detector"),l=e("angular2/src/core/change_detection/change_detection_util"),p=e("angular2/src/core/change_detection/constants"),f=e("angular2/src/core/change_detection/proto_record"),d=function(e){function t(t,r,n,i,o,s,a,u,l,p){e.call(this,t,r,n,i,o,s),this._records=a,this._eventBindings=u,this._directiveRecords=l,this._genConfig=p,this.directives=null;var f=a.length+1;this.values=c.ListWrapper.createFixedSize(f),this.localPipes=c.ListWrapper.createFixedSize(f),this.prevContexts=c.ListWrapper.createFixedSize(f),this.changes=c.ListWrapper.createFixedSize(f),this.dehydrateDirectives(!1)}return o(t,e),t.prototype.handleEventInternal=function(e,t,r){var n=this,i=!1;return this._matchingEventBindings(e,t).forEach(function(e){var t=n._processEventBinding(e,r);t===!1&&(i=!0)}),i},t.prototype._processEventBinding=function(e,t){var r=c.ListWrapper.createFixedSize(e.records.length);r[0]=this.values[0];for(var n=0;n=0;--t){var r=e[t];r.callAfterContentInit&&this.state==p.ChangeDetectorState.NeverChecked&&this._getDirectiveFor(r.directiveIndex).afterContentInit(),r.callAfterContentChecked&&this._getDirectiveFor(r.directiveIndex).afterContentChecked()}},t.prototype.afterViewLifecycleCallbacksInternal=function(){for(var e=this._directiveRecords,t=e.length-1;t>=0;--t){var r=e[t];r.callAfterViewInit&&this.state==p.ChangeDetectorState.NeverChecked&&this._getDirectiveFor(r.directiveIndex).afterViewInit(),r.callAfterViewChecked&&this._getDirectiveFor(r.directiveIndex).afterViewChecked()}},t.prototype._updateDirectiveOrElement=function(t,r){if(s.isBlank(r.directiveRecord))e.prototype.notifyDispatcher.call(this,t.currentValue);else{var n=r.directiveRecord.directiveIndex;r.setter(this._getDirectiveFor(n),t.currentValue)}this._genConfig.logBindingUpdate&&e.prototype.logBindingUpdate.call(this,t.currentValue)},t.prototype._addChange=function(t,r,n){return t.callOnChanges()?e.prototype.addChange.call(this,n,r.previousValue,r.currentValue):n},t.prototype._getDirectiveFor=function(e){return this.directives.getDirectiveFor(e)},t.prototype._getDetectorFor=function(e){return this.directives.getDetectorFor(e)},t.prototype._check=function(e,t,r,n){return e.isPipeRecord()?this._pipeCheck(e,t,r):this._referenceCheck(e,t,r,n)},t.prototype._referenceCheck=function(t,r,n,i){if(this._pureFuncAndArgsDidNotChange(t))return this._setChanged(t,!1),null;var o=this._calculateCurrValue(t,n,i);if(this.strategy===p.ChangeDetectionStrategy.OnPushObserve&&e.prototype.observeValue.call(this,o,t.selfIndex),t.shouldBeChecked()){var s=this._readSelf(t,n);if(l.ChangeDetectionUtil.looseNotIdentical(s,o)){if(t.lastInBinding){var a=l.ChangeDetectionUtil.simpleChange(s,o);return r&&this.throwOnChangeError(s,o),this._writeSelf(t,o,n),this._setChanged(t,!0),a}return this._writeSelf(t,o,n),this._setChanged(t,!0),null}return this._setChanged(t,!1),null}return this._writeSelf(t,o,n),this._setChanged(t,!0),null},t.prototype._calculateCurrValue=function(e,t,r){switch(e.mode){case f.RecordType.Self:return this._readContext(e,t);case f.RecordType.Const:return e.funcOrValue;case f.RecordType.PropertyRead:var n=this._readContext(e,t);return e.funcOrValue(n);case f.RecordType.SafeProperty:var n=this._readContext(e,t);return s.isBlank(n)?null:e.funcOrValue(n);case f.RecordType.PropertyWrite:var n=this._readContext(e,t),i=this._readArgs(e,t)[0];return e.funcOrValue(n,i),i;case f.RecordType.KeyedWrite:var n=this._readContext(e,t),o=this._readArgs(e,t)[0],i=this._readArgs(e,t)[1];return n[o]=i,i;case f.RecordType.Local:return r.get(e.name);case f.RecordType.InvokeMethod:var n=this._readContext(e,t),c=this._readArgs(e,t);return e.funcOrValue(n,c);case f.RecordType.SafeMethodInvoke:var n=this._readContext(e,t);if(s.isBlank(n))return null;var c=this._readArgs(e,t);return e.funcOrValue(n,c);case f.RecordType.KeyedRead:var u=this._readArgs(e,t)[0];return this._readContext(e,t)[u];case f.RecordType.Chain:var c=this._readArgs(e,t);return c[c.length-1];case f.RecordType.InvokeClosure:return s.FunctionWrapper.apply(this._readContext(e,t),this._readArgs(e,t));case f.RecordType.Interpolate:case f.RecordType.PrimitiveOp:case f.RecordType.CollectionLiteral:return s.FunctionWrapper.apply(e.funcOrValue,this._readArgs(e,t));default:throw new a.BaseException("Unknown operation "+e.mode)}},t.prototype._pipeCheck=function(e,t,r){var n=this._readContext(e,r),i=this._pipeFor(e,n);if(!i.pure||this._argsOrContextChanged(e)){var o=this._readArgs(e,r),s=i.pipe.transform(n,o);if(e.shouldBeChecked()){var a=this._readSelf(e,r);if(l.ChangeDetectionUtil.looseNotIdentical(a,s)){if(s=l.ChangeDetectionUtil.unwrapValue(s),e.lastInBinding){var c=l.ChangeDetectionUtil.simpleChange(a,s);return t&&this.throwOnChangeError(a,s),this._writeSelf(e,s,r),this._setChanged(e,!0),c}return this._writeSelf(e,s,r),this._setChanged(e,!0),null}return this._setChanged(e,!1),null}return this._writeSelf(e,s,r),this._setChanged(e,!0),null}},t.prototype._pipeFor=function(e,t){var r=this._readPipe(e);if(s.isPresent(r))return r;var n=this.pipes.get(e.name);return this._writePipe(e,n),n},t.prototype._readContext=function(e,t){return-1==e.contextIndex?this._getDirectiveFor(e.directiveIndex):t[e.contextIndex]},t.prototype._readSelf=function(e,t){return t[e.selfIndex]},t.prototype._writeSelf=function(e,t,r){r[e.selfIndex]=t},t.prototype._readPipe=function(e){return this.localPipes[e.selfIndex]},t.prototype._writePipe=function(e,t){this.localPipes[e.selfIndex]=t},t.prototype._setChanged=function(e,t){e.argumentToPureFunction&&(this.changes[e.selfIndex]=t)},t.prototype._pureFuncAndArgsDidNotChange=function(e){return e.isPureFunction()&&!this._argsChanged(e)},t.prototype._argsChanged=function(e){for(var t=e.args,r=0;r1)throw new l.BaseException("A directive injectable can contain only one of the following @Attribute or @Query.")},t.createFrom=function(e){return new t(e.key,e.optional,e.lowerBoundVisibility,e.upperBoundVisibility,e.properties,t._attributeName(e.properties),t._query(e.properties))},t._attributeName=function(e){var t=e.find(function(e){return e instanceof v.AttributeMetadata});return u.isPresent(t)?t.attributeName:null},t._query=function(e){return e.find(function(e){return e instanceof v.QueryMetadata})},t}(d.Dependency);t.DirectiveDependency=D;var k=function(e){function t(t,r,n,i,o,s){e.call(this,t,[new g.ResolvedFactory(r,n)],!1),this.metadata=i,this.providers=o,this.viewProviders=s,this.callOnDestroy=w.hasLifecycleHook(P.LifecycleHooks.OnDestroy,t.token)}return c(t,e),Object.defineProperty(t.prototype,"displayName",{get:function(){return this.key.displayName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queries",{get:function(){if(u.isBlank(this.metadata.queries))return[];var e=[];return f.StringMapWrapper.forEach(this.metadata.queries,function(t,r){var n=S.reflector.setter(r);e.push(new N(n,t))}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventEmitters",{get:function(){return u.isPresent(this.metadata)&&u.isPresent(this.metadata.outputs)?this.metadata.outputs:[]},enumerable:!0,configurable:!0}),t.createFromProvider=function(e,r){u.isBlank(r)&&(r=new x.DirectiveMetadata);var n=g.resolveProvider(e),i=n.resolvedFactories[0],o=i.dependencies.map(D.createFrom),s=u.isPresent(r.providers)?r.providers:[],a=r instanceof x.ComponentMetadata&&u.isPresent(r.viewProviders)?r.viewProviders:[];return new t(n.key,i.factory,o,r,s,a)},t.createFromType=function(e,r){var n=new d.Provider(e,{useClass:e});return t.createFromProvider(n,r)},t}(g.ResolvedProvider_);t.DirectiveProvider=k;var A=function(){function e(e,t,r,n){this.viewManager=e,this.view=t,this.elementRef=r,this.templateRef=n,this.nestedView=null}return e}();t.PreBuiltObjects=A;var N=function(){function e(e,t){this.setter=e,this.metadata=t}return e}();t.QueryMetadataWithSetter=N;var M=function(){function e(e,t){this.eventName=e,this.getter=t}return e.prototype.subscribe=function(e,t,r){var n=this,i=this.getter(r);return p.ObservableWrapper.subscribe(i,function(r){return e.triggerEventHandlers(n.eventName,r,t)})},e}();t.EventEmitterAccessor=M;var V=function(){function e(e,t,r,o,s,a){this.parent=e,this.index=t,this.distanceToParent=o,this.directiveVariableBindings=a,this._firstProviderIsComponent=s;var c=r.length;this.protoInjector=new h.ProtoInjector(r),this.eventEmitterAccessors=f.ListWrapper.createFixedSize(c);for(var u=0;c>u;++u)this.eventEmitterAccessors[u]=n(r[u]);this.protoQueryRefs=i(r)}return e.create=function(t,r,n,i,o,s){var a=[];return e._createDirectiveProviderWithVisibility(n,a,i),i&&e._createViewProvidersWithVisibility(n,a),e._createProvidersWithVisibility(n,a),new e(t,r,a,o,i,s)},e._createDirectiveProviderWithVisibility=function(t,r,n){t.forEach(function(i){r.push(e._createProviderWithVisibility(n,i,t,i))})},e._createProvidersWithVisibility=function(e,t){var r=[];e.forEach(function(e){r=f.ListWrapper.concat(r,e.providers)});var n=d.Injector.resolve(r);n.forEach(function(e){return t.push(new h.ProviderWithVisibility(e,h.Visibility.Public))})},e._createProviderWithVisibility=function(e,t,r,n){var i=e&&r[0]===t;return new h.ProviderWithVisibility(n,i?h.Visibility.PublicAndPrivate:h.Visibility.Public)},e._createViewProvidersWithVisibility=function(e,t){var r=d.Injector.resolve(e[0].viewProviders);r.forEach(function(e){return t.push(new h.ProviderWithVisibility(e,h.Visibility.Private))})},e.prototype.instantiate=function(e){return new L(this,e)},e.prototype.directParent=function(){return this.distanceToParent<2?this.parent:null},Object.defineProperty(e.prototype,"hasBindings",{get:function(){return this.eventEmitterAccessors.length>0},enumerable:!0,configurable:!0}),e.prototype.getProviderAtIndex=function(e){return this.protoInjector.getProviderAtIndex(e)},e}();t.ProtoElementInjector=V;var B=function(){function e(e,t,r){this.element=e,this.componentElement=t,this.injector=r}return e}(),L=function(e){function t(t,r){var n=this;e.call(this,r),this._preBuiltObjects=null,this._proto=t,this._injector=new d.Injector(this._proto.protoInjector,null,this,function(){return n._debugContext()});var i=this._injector.internalStrategy;this._strategy=i instanceof h.InjectorInlineStrategy?new z(i,this):new G(i,this),this.hydrated=!1,this._queryStrategy=this._buildQueryStrategy()}return c(t,e),t.prototype.dehydrate=function(){this.hydrated=!1,this._host=null,this._preBuiltObjects=null,this._strategy.callOnDestroy(),this._strategy.dehydrate(),this._queryStrategy.dehydrate()},t.prototype.hydrate=function(e,t,r){this._host=t,this._preBuiltObjects=r,this._reattachInjectors(e),this._queryStrategy.hydrate(),this._strategy.hydrate(),this.hydrated=!0},t.prototype._debugContext=function(){var e=this._preBuiltObjects,t=e.elementRef.boundElementIndex-e.view.elementOffset,r=this._preBuiltObjects.view.getDebugContext(t,null);return u.isPresent(r)?new B(r.element,r.componentElement,r.injector):null},t.prototype._reattachInjectors=function(e){u.isPresent(this._parent)?u.isPresent(e)?(this._reattachInjector(this._injector,e,!1),this._reattachInjector(e,this._parent._injector,!1)):this._reattachInjector(this._injector,this._parent._injector,!1):u.isPresent(this._host)?u.isPresent(e)?(this._reattachInjector(this._injector,e,!1),this._reattachInjector(e,this._host._injector,!0)):this._reattachInjector(this._injector,this._host._injector,!0):u.isPresent(e)&&this._reattachInjector(this._injector,e,!0)},t.prototype._reattachInjector=function(e,t,r){e.internalStrategy.attach(t,r)},t.prototype.hasVariableBinding=function(e){var t=this._proto.directiveVariableBindings;return u.isPresent(t)&&t.has(e)},t.prototype.getVariableBinding=function(e){var t=this._proto.directiveVariableBindings.get(e);return u.isPresent(t)?this.getDirectiveAtIndex(t):this.getElementRef()},t.prototype.get=function(e){return this._injector.get(e)},t.prototype.hasDirective=function(e){return u.isPresent(this._injector.getOptional(e))},t.prototype.getEventEmitterAccessors=function(){return this._proto.eventEmitterAccessors},t.prototype.getDirectiveVariableBindings=function(){return this._proto.directiveVariableBindings},t.prototype.getComponent=function(){return this._strategy.getComponent()},t.prototype.getInjector=function(){return this._injector},t.prototype.getElementRef=function(){return this._preBuiltObjects.elementRef},t.prototype.getViewContainerRef=function(){return new R.ViewContainerRef_(this._preBuiltObjects.viewManager,this.getElementRef())},t.prototype.getNestedView=function(){return this._preBuiltObjects.nestedView},t.prototype.getView=function(){return this._preBuiltObjects.view},t.prototype.directParent=function(){return this._proto.distanceToParent<2?this.parent:null},t.prototype.isComponentKey=function(e){return this._strategy.isComponentKey(e)},t.prototype.getDependency=function(e,t,r){var n=r.key;if(t instanceof k){var i=r,o=t,s=I.instance();if(n.id===s.viewManagerId)return this._preBuiltObjects.viewManager;if(u.isPresent(i.attributeName))return this._buildAttribute(i);if(u.isPresent(i.queryDecorator))return this._queryStrategy.findQuery(i.queryDecorator).list;if(i.key.id===I.instance().changeDetectorRefId){if(o.metadata instanceof x.ComponentMetadata){var a=this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex);return a.changeDetector.ref}return this._preBuiltObjects.view.changeDetector.ref}if(i.key.id===I.instance().elementRefId)return this.getElementRef();if(i.key.id===I.instance().viewContainerId)return this.getViewContainerRef();if(i.key.id===I.instance().templateRefId){if(u.isBlank(this._preBuiltObjects.templateRef)){if(i.optional)return null;throw new d.NoProviderError(null,i.key)}return this._preBuiltObjects.templateRef}}else if(t instanceof O.PipeProvider&&r.key.id===I.instance().changeDetectorRefId){var a=this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex);return a.changeDetector.ref}return h.UNDEFINED},t.prototype._buildAttribute=function(e){var t=this._proto.attributes;return u.isPresent(t)&&t.has(e.attributeName)?t.get(e.attributeName):null},t.prototype.addDirectivesMatchingQuery=function(e,t){var r=u.isBlank(this._preBuiltObjects)?null:this._preBuiltObjects.templateRef;e.selector===b.TemplateRef&&u.isPresent(r)&&t.push(r),this._strategy.addDirectivesMatchingQuery(e,t)},t.prototype._buildQueryStrategy=function(){return 0===this._proto.protoQueryRefs.length?W:this._proto.protoQueryRefs.length<=U.NUMBER_OF_SUPPORTED_QUERIES?new U(this):new H(this)},t.prototype.link=function(e){e.addChild(this)},t.prototype.unlink=function(){this.remove()},t.prototype.getDirectiveAtIndex=function(e){return this._injector.getAt(e)},t.prototype.hasInstances=function(){return this._proto.hasBindings&&this.hydrated},t.prototype.getHost=function(){return this._host},t.prototype.getBoundElementIndex=function(){return this._proto.index},t.prototype.getRootViewInjectors=function(){if(!this.hydrated)return[];var e=this._preBuiltObjects.view,t=e.getNestedView(e.elementOffset+this.getBoundElementIndex());return u.isPresent(t)?t.rootElementInjectors:[]},t.prototype.afterViewChecked=function(){this._queryStrategy.updateViewQueries()},t.prototype.afterContentChecked=function(){this._queryStrategy.updateContentQueries()},t.prototype.traverseAndSetQueriesAsDirty=function(){for(var e=this;u.isPresent(e);)e._setQueriesAsDirty(),e=e.parent},t.prototype._setQueriesAsDirty=function(){this._queryStrategy.setContentQueriesAsDirty(),u.isPresent(this._host)&&this._host._queryStrategy.setViewQueriesAsDirty()},t}(T);t.ElementInjector=L;var F=function(){function e(){}return e.prototype.setContentQueriesAsDirty=function(){},e.prototype.setViewQueriesAsDirty=function(){},e.prototype.hydrate=function(){},e.prototype.dehydrate=function(){},e.prototype.updateContentQueries=function(){},e.prototype.updateViewQueries=function(){},e.prototype.findQuery=function(e){throw new l.BaseException("Cannot find query for directive "+e+".")},e}(),W=new F,U=function(){function e(e){var t=e._proto.protoQueryRefs;t.length>0&&(this.query0=new K(t[0],e)),t.length>1&&(this.query1=new K(t[1],e)),t.length>2&&(this.query2=new K(t[2],e))}return e.prototype.setContentQueriesAsDirty=function(){u.isPresent(this.query0)&&!this.query0.isViewQuery&&(this.query0.dirty=!0),u.isPresent(this.query1)&&!this.query1.isViewQuery&&(this.query1.dirty=!0),u.isPresent(this.query2)&&!this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.setViewQueriesAsDirty=function(){u.isPresent(this.query0)&&this.query0.isViewQuery&&(this.query0.dirty=!0),u.isPresent(this.query1)&&this.query1.isViewQuery&&(this.query1.dirty=!0),u.isPresent(this.query2)&&this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.hydrate=function(){u.isPresent(this.query0)&&this.query0.hydrate(),u.isPresent(this.query1)&&this.query1.hydrate(),u.isPresent(this.query2)&&this.query2.hydrate()},e.prototype.dehydrate=function(){u.isPresent(this.query0)&&this.query0.dehydrate(),u.isPresent(this.query1)&&this.query1.dehydrate(),u.isPresent(this.query2)&&this.query2.dehydrate()},e.prototype.updateContentQueries=function(){u.isPresent(this.query0)&&!this.query0.isViewQuery&&this.query0.update(),u.isPresent(this.query1)&&!this.query1.isViewQuery&&this.query1.update(),u.isPresent(this.query2)&&!this.query2.isViewQuery&&this.query2.update()},e.prototype.updateViewQueries=function(){u.isPresent(this.query0)&&this.query0.isViewQuery&&this.query0.update(),u.isPresent(this.query1)&&this.query1.isViewQuery&&this.query1.update(),u.isPresent(this.query2)&&this.query2.isViewQuery&&this.query2.update()},e.prototype.findQuery=function(e){if(u.isPresent(this.query0)&&this.query0.protoQueryRef.query===e)return this.query0;if(u.isPresent(this.query1)&&this.query1.protoQueryRef.query===e)return this.query1;if(u.isPresent(this.query2)&&this.query2.protoQueryRef.query===e)return this.query2;throw new l.BaseException("Cannot find query for directive "+e+".")},e.NUMBER_OF_SUPPORTED_QUERIES=3,e}(),H=function(){function e(e){this.queries=e._proto.protoQueryRefs.map(function(t){return new K(t,e)})}return e.prototype.setContentQueriesAsDirty=function(){for(var e=0;e0?this.list.first:null):this.protoQueryRef.setter(e,this.list)}this.list.notifyOnChanges()}},e.prototype._update=function(){var e=[]; +if(this.protoQueryRef.query.isViewQuery){var t=this.originator.getView(),r=t.getNestedView(t.elementOffset+this.originator.getBoundElementIndex());u.isPresent(r)&&this._visitView(r,e)}else this._visit(this.originator,e);this.list.reset(e)},e.prototype._visit=function(e,t){for(var r=e.getView(),n=r.elementOffset+e._proto.index,i=n;in&&(u.isBlank(o)||u.isBlank(o.parent)||r.elementOffset+o.parent._proto.indexi;i++)n[i]=arguments[i];return"function"==typeof n[n.length-1].schedule&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),new c["default"](n,t).lift(new u.CombineLatestOperator(e))}var o=System.global,s=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var a=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(a),u=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],o.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable",["@reactivex/rxjs/dist/cjs/util/isNumeric","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=System.global,a=s.define;s.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/isNumeric"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(e){function t(){var r=arguments.length<=0||void 0===arguments[0]?0:arguments[0],n=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];i(this,t),e.call(this),this.period=r,this.scheduler=n,(!u["default"](r)||0>r)&&(this.period=0),n&&"function"==typeof n.schedule||(this.scheduler=d["default"])}return o(t,e),t.create=function(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0],r=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return new t(e,r)},t.dispatch=function(e){var t=e.index,r=e.subscriber,n=e.period;r.next(t),r.isUnsubscribed||(e.index+=1,this.schedule(e,n))},t.prototype._subscribe=function(e){var r=0,n=this.period,i=this.scheduler;e.add(i.schedule(t.dispatch,n,{index:r,subscriber:e,period:n}))},t}(p["default"]);return t["default"]=h,r.exports=t["default"],s.define=a,r.exports}),System.register("angular2/src/core/di",["angular2/src/core/di/metadata","angular2/src/core/di/decorators","angular2/src/core/di/forward_ref","angular2/src/core/di/injector","angular2/src/core/di/provider","angular2/src/core/di/key","angular2/src/core/di/exceptions","angular2/src/core/di/opaque_token"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/core/di/metadata");t.InjectMetadata=s.InjectMetadata,t.OptionalMetadata=s.OptionalMetadata,t.InjectableMetadata=s.InjectableMetadata,t.SelfMetadata=s.SelfMetadata,t.HostMetadata=s.HostMetadata,t.SkipSelfMetadata=s.SkipSelfMetadata,t.DependencyMetadata=s.DependencyMetadata,n(e("angular2/src/core/di/decorators"));var a=e("angular2/src/core/di/forward_ref");t.forwardRef=a.forwardRef,t.resolveForwardRef=a.resolveForwardRef;var c=e("angular2/src/core/di/injector");t.Injector=c.Injector;var u=e("angular2/src/core/di/provider");t.Binding=u.Binding,t.ProviderBuilder=u.ProviderBuilder,t.ResolvedFactory=u.ResolvedFactory,t.Dependency=u.Dependency,t.bind=u.bind,t.Provider=u.Provider,t.provide=u.provide;var l=e("angular2/src/core/di/key");t.Key=l.Key,t.TypeLiteral=l.TypeLiteral;var p=e("angular2/src/core/di/exceptions");t.NoProviderError=p.NoProviderError,t.AbstractProviderError=p.AbstractProviderError,t.CyclicDependencyError=p.CyclicDependencyError,t.InstantiationError=p.InstantiationError,t.InvalidProviderError=p.InvalidProviderError,t.NoAnnotationError=p.NoAnnotationError,t.OutOfBoundsError=p.OutOfBoundsError;var f=e("angular2/src/core/di/opaque_token");return t.OpaqueToken=f.OpaqueToken,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/proto_change_detector",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/change_detection/parser/ast","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/dynamic_change_detector","angular2/src/core/change_detection/directive_record","angular2/src/core/change_detection/event_binding","angular2/src/core/change_detection/coalesce","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){function n(e){var t=new C;return g.ListWrapper.forEachWithIndex(e.bindingRecords,function(r,n){return t.add(r,e.variableNames,n)}),x.coalesce(t.records)}function i(e){var t=g.ListWrapper.concat(["$event"],e.variableNames);return e.eventRecords.map(function(e){var r=S.create(e,t),n=e.implicitReceiver instanceof _.DirectiveIndex?e.implicitReceiver:null;return new b.EventBinding(e.target.name,e.target.elementIndex,n,r)})}function o(e){switch(e){case 0:return m.ChangeDetectionUtil.arrayFn0;case 1:return m.ChangeDetectionUtil.arrayFn1;case 2:return m.ChangeDetectionUtil.arrayFn2;case 3:return m.ChangeDetectionUtil.arrayFn3;case 4:return m.ChangeDetectionUtil.arrayFn4;case 5:return m.ChangeDetectionUtil.arrayFn5;case 6:return m.ChangeDetectionUtil.arrayFn6;case 7:return m.ChangeDetectionUtil.arrayFn7;case 8:return m.ChangeDetectionUtil.arrayFn8;case 9:return m.ChangeDetectionUtil.arrayFn9;default:throw new h.BaseException("Does not support literal maps with more than 9 elements")}}function s(e){var t=e.map(function(e){return d.isString(e)?'"'+e+'"':""+e}).join(", ");return"mapFn(["+t+"])"}function a(e){switch(e){case"+":return"operation_add";case"-":return"operation_subtract";case"*":return"operation_multiply";case"/":return"operation_divide";case"%":return"operation_remainder";case"==":return"operation_equals";case"!=":return"operation_not_equals";case"===":return"operation_identical";case"!==":return"operation_not_identical";case"<":return"operation_less_then";case">":return"operation_greater_then";case"<=":return"operation_less_or_equals_then";case">=":return"operation_greater_or_equals_then";default:throw new h.BaseException("Unsupported operation "+e)}}function c(e){switch(e){case"+":return m.ChangeDetectionUtil.operation_add;case"-":return m.ChangeDetectionUtil.operation_subtract;case"*":return m.ChangeDetectionUtil.operation_multiply;case"/":return m.ChangeDetectionUtil.operation_divide;case"%":return m.ChangeDetectionUtil.operation_remainder;case"==":return m.ChangeDetectionUtil.operation_equals;case"!=":return m.ChangeDetectionUtil.operation_not_equals;case"===":return m.ChangeDetectionUtil.operation_identical;case"!==":return m.ChangeDetectionUtil.operation_not_identical;case"<":return m.ChangeDetectionUtil.operation_less_then;case">":return m.ChangeDetectionUtil.operation_greater_then;case"<=":return m.ChangeDetectionUtil.operation_less_or_equals_then;case">=":return m.ChangeDetectionUtil.operation_greater_or_equals_then;default:throw new h.BaseException("Unsupported operation "+e)}}function u(e){return d.isPresent(e)?""+e:""}function l(e){var t=e.length,r=t>0?e[0]:null,n=t>1?e[1]:null,i=t>2?e[2]:null,o=t>3?e[3]:null,s=t>4?e[4]:null,a=t>5?e[5]:null,c=t>6?e[6]:null,l=t>7?e[7]:null,p=t>8?e[8]:null,f=t>9?e[9]:null;switch(t-1){case 1:return function(e){return r+u(e)+n};case 2:return function(e,t){return r+u(e)+n+u(t)+i};case 3:return function(e,t,s){return r+u(e)+n+u(t)+i+u(s)+o};case 4:return function(e,t,a,c){return r+u(e)+n+u(t)+i+u(a)+o+u(c)+s};case 5:return function(e,t,c,l,p){return r+u(e)+n+u(t)+i+u(c)+o+u(l)+s+u(p)+a};case 6:return function(e,t,l,p,f,d){return r+u(e)+n+u(t)+i+u(l)+o+u(p)+s+u(f)+a+u(d)+c};case 7:return function(e,t,p,f,d,h,g){return r+u(e)+n+u(t)+i+u(p)+o+u(f)+s+u(d)+a+u(h)+c+u(g)+l};case 8:return function(e,t,f,d,h,g,v,m){return r+u(e)+n+u(t)+i+u(f)+o+u(d)+s+u(h)+a+u(g)+c+u(v)+l+u(m)+p};case 9:return function(e,t,d,h,g,v,m,y,_){return r+u(e)+n+u(t)+i+u(d)+o+u(h)+s+u(g)+a+u(v)+c+u(m)+l+u(y)+p+u(_)+f};default:throw new h.BaseException("Does not support more than 9 expressions")}}var p=System.global,f=p.define;p.define=void 0;var d=e("angular2/src/facade/lang"),h=e("angular2/src/facade/exceptions"),g=e("angular2/src/facade/collection"),v=e("angular2/src/core/change_detection/parser/ast"),m=e("angular2/src/core/change_detection/change_detection_util"),y=e("angular2/src/core/change_detection/dynamic_change_detector"),_=e("angular2/src/core/change_detection/directive_record"),b=e("angular2/src/core/change_detection/event_binding"),x=e("angular2/src/core/change_detection/coalesce"),w=e("angular2/src/core/change_detection/proto_record"),j=function(){function e(e){this._definition=e,this._propertyBindingRecords=n(e),this._eventBindingRecords=i(e),this._propertyBindingTargets=this._definition.bindingRecords.map(function(e){return e.target}),this._directiveIndices=this._definition.directiveRecords.map(function(e){return e.directiveIndex})}return e.prototype.instantiate=function(e){return new y.DynamicChangeDetector(this._definition.id,e,this._propertyBindingRecords.length,this._propertyBindingTargets,this._directiveIndices,this._definition.strategy,this._propertyBindingRecords,this._eventBindingRecords,this._definition.directiveRecords,this._definition.genConfig)},e}();t.DynamicProtoChangeDetector=j,t.createPropertyRecords=n,t.createEventRecords=i;var C=function(){function e(){this.records=[]}return e.prototype.add=function(e,t,r){var n=g.ListWrapper.last(this.records);d.isPresent(n)&&n.bindingRecord.directiveRecord==e.directiveRecord&&(n.lastInDirective=!1);var i=this.records.length;this._appendRecords(e,t,r);var o=g.ListWrapper.last(this.records);d.isPresent(o)&&o!==n&&(o.lastInBinding=!0,o.lastInDirective=!0,this._setArgumentToPureFunction(i))},e.prototype._setArgumentToPureFunction=function(e){for(var t=this,r=e;r0&&g.isPresent(m.DOM.parentElement(e))){for(var r=0;r0){var n=r[r.length-1],s=i(t);o(n,s),this.animateNodesEnter(s)}},t.prototype.animateNodesEnter=function(e){for(var t=0;t0},e.dispose=function(e){e.unsubscribe()},e.callNext=function(e,t){e.next(t)},e.callError=function(e,t){e.error(t)},e.callComplete=function(e){e.complete()},e.fromPromise=function(e){return c.Observable.fromPromise(e)},e.toPromise=function(e){return e.toPromise()},e}();t.ObservableWrapper=p;var f=function(e){function t(t){void 0===t&&(t=!0),e.call(this),this._isAsync=t}return o(t,e),t.prototype.subscribe=function(t,r,n){if(t&&"object"==typeof t){var i=this._isAsync?function(e){setTimeout(function(){return t.next(e)})}:function(e){t.next(e)};return e.prototype.subscribe.call(this,i,function(e){return t.error?t.error(e):null},function(){return t.complete?t.complete():null})}var i=this._isAsync?function(e){setTimeout(function(){return t(e)})}:function(e){t(e)};return e.prototype.subscribe.call(this,i,function(e){return r?r(e):null},function(){return n?n():null})},t}(c.Subject);t.EventEmitter=f;var d=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t}(c.Observable);return t.Observable=d,n.define=i,r.exports}),System.register("angular2/src/core/change_detection",["angular2/src/core/change_detection/change_detection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/change_detection/change_detection");return t.ChangeDetectionStrategy=o.ChangeDetectionStrategy,t.ExpressionChangedAfterItHasBeenCheckedException=o.ExpressionChangedAfterItHasBeenCheckedException,t.ChangeDetectionError=o.ChangeDetectionError,t.ChangeDetectorRef=o.ChangeDetectorRef,t.WrappedValue=o.WrappedValue,t.SimpleChange=o.SimpleChange,t.IterableDiffers=o.IterableDiffers,t.KeyValueDiffers=o.KeyValueDiffers,n.define=i,r.exports}),System.register("angular2/src/core/linker/template_commands",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/render/render","angular2/src/core/metadata","angular2/src/core/metadata"],!0,function(e,t,r){function n(e,t,r){void 0===r&&(r=null);for(var n=0;n0?this._properties:this._inputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){return c.isPresent(this._events)&&this._events.length>0?this._events:this._outputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){return this.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providers",{get:function(){return c.isPresent(this._bindings)&&this._bindings.length>0?this._bindings:this._providers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return this.providers},enumerable:!0,configurable:!0}),t=s([c.CONST(),a("design:paramtypes",[Object])],t)}(u.InjectableMetadata);t.DirectiveMetadata=p;var f=function(e){function t(t){var r=void 0===t?{}:t,n=r.selector,i=r.inputs,o=r.outputs,s=r.properties,a=r.events,c=r.host,u=r.exportAs,p=r.moduleId,f=r.bindings,d=r.providers,h=r.viewBindings,g=r.viewProviders,v=r.changeDetection,m=void 0===v?l.ChangeDetectionStrategy.Default:v,y=r.queries,_=r.templateUrl,b=r.template,x=r.styleUrls,w=r.styles,j=r.directives,C=r.pipes,S=r.encapsulation;e.call(this,{selector:n,inputs:i,outputs:o,properties:s,events:a,host:c,exportAs:u,moduleId:p,bindings:f,providers:d,queries:y}),this.changeDetection=m,this._viewProviders=g,this._viewBindings=h,this.templateUrl=_,this.template=b,this.styleUrls=x,this.styles=w,this.directives=j,this.pipes=C,this.encapsulation=S}return o(t,e),Object.defineProperty(t.prototype,"viewProviders",{get:function(){return c.isPresent(this._viewBindings)&&this._viewBindings.length>0?this._viewBindings:this._viewProviders},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewBindings",{get:function(){return this.viewProviders},enumerable:!0,configurable:!0}),t=s([c.CONST(),a("design:paramtypes",[Object])],t)}(p);t.ComponentMetadata=f;var d=function(e){function t(t){var r=t.name,n=t.pure;e.call(this),this.name=r,this._pure=n}return o(t,e),Object.defineProperty(t.prototype,"pure",{get:function(){return c.isPresent(this._pure)?this._pure:!0},enumerable:!0,configurable:!0}),t=s([c.CONST(),a("design:paramtypes",[Object])],t)}(u.InjectableMetadata);t.PipeMetadata=d;var h=function(){function e(e){this.bindingPropertyName=e}return e=s([c.CONST(),a("design:paramtypes",[String])],e)}();t.InputMetadata=h;var g=function(){function e(e){this.bindingPropertyName=e}return e=s([c.CONST(),a("design:paramtypes",[String])],e)}();t.OutputMetadata=g;var v=function(){function e(e){this.hostPropertyName=e}return e=s([c.CONST(),a("design:paramtypes",[String])],e)}();t.HostBindingMetadata=v;var m=function(){function e(e,t){this.eventName=e,this.args=t}return e=s([c.CONST(),a("design:paramtypes",[String,Array])],e)}();return t.HostListenerMetadata=m,n.define=i,r.exports}),System.register("angular2/src/core/linker/proto_view_factory",["angular2/src/facade/lang","angular2/src/core/render/api","angular2/src/core/di","angular2/src/core/pipes/pipe_provider","angular2/src/core/pipes/pipes","angular2/src/core/linker/view","angular2/src/core/linker/element_binder","angular2/src/core/linker/element_injector","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/view_resolver","angular2/src/core/linker/pipe_resolver","angular2/src/core/metadata/view","angular2/src/core/platform_directives_and_pipes","angular2/src/core/linker/template_commands","angular2/render","angular2/src/core/application_tokens"],!0,function(e,t,r){function n(e,t){return e._createComponent(t)}function i(e,t,r){return e._createEmbeddedTemplate(t,r)}function o(e,t,r,n,i,o,u){var l=null,p=null;if(i>0&&(l=r[r.length-i]),v.isBlank(l)&&(i=-1),o>0){var f=r[r.length-o];v.isPresent(f)&&(p=f.protoElementInjector)}v.isBlank(p)&&(o=-1);var d=null,h=!1,g=u.directives.map(function(t){return s(e,t)});u instanceof R.BeginComponentCmd?d=g[0]:u instanceof R.EmbeddedTemplateCmd&&(h=!0);var m=null,y=u.variableNameAndValues.length>0;if(g.length>0||y||h){var _=new Map;h||(_=a(u.variableNameAndValues,g)),m=j.ProtoElementInjector.create(p,n,g,v.isPresent(d),o,_),m.attributes=c(u.attrNameAndValues,!1)}return new w.ElementBinder(n,l,i,m,d,t)}function s(e,t){var r=e.resolve(t);return j.DirectiveProvider.createFromType(t,r)}function a(e,t){for(var r=new Map,n=0;n0&&this._renderer.setElementClass(this._ngEl,e,t)},e=o([c.Directive({selector:"[ng-class]",inputs:["rawClass: ng-class","initialClasses: class"]}),s("design:paramtypes",[l.IterableDiffers,l.KeyValueDiffers,u.ElementRef,p.Renderer])],e)}();return t.NgClass=d,n.define=i,r.exports}),System.register("angular2/src/common/directives",["angular2/src/common/directives/ng_class","angular2/src/common/directives/ng_for","angular2/src/common/directives/ng_if","angular2/src/common/directives/ng_style","angular2/src/common/directives/ng_switch","angular2/src/common/directives/observable_list_diff","angular2/src/common/directives/core_directives"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0;var s=e("angular2/src/common/directives/ng_class");t.NgClass=s.NgClass;var a=e("angular2/src/common/directives/ng_for");t.NgFor=a.NgFor;var c=e("angular2/src/common/directives/ng_if");t.NgIf=c.NgIf;var u=e("angular2/src/common/directives/ng_style");t.NgStyle=u.NgStyle;var l=e("angular2/src/common/directives/ng_switch");t.NgSwitch=l.NgSwitch,t.NgSwitchWhen=l.NgSwitchWhen,t.NgSwitchDefault=l.NgSwitchDefault,n(e("angular2/src/common/directives/observable_list_diff"));var p=e("angular2/src/common/directives/core_directives");return t.CORE_DIRECTIVES=p.CORE_DIRECTIVES,i.define=o,r.exports}),System.register("angular2/common",["angular2/src/common/pipes","angular2/src/common/directives","angular2/src/common/forms","angular2/src/common/common_directives"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;return i.define=void 0,n(e("angular2/src/common/pipes")),n(e("angular2/src/common/directives")),n(e("angular2/src/common/forms")),n(e("angular2/src/common/common_directives")),i.define=o,r.exports}),System.register("angular2/angular2",["angular2/common","angular2/core","angular2/profile","angular2/lifecycle_hooks","angular2/bootstrap","angular2/upgrade"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;return i.define=void 0,n(e("angular2/common")),n(e("angular2/core")),n(e("angular2/profile")),n(e("angular2/lifecycle_hooks")),n(e("angular2/bootstrap")),n(e("angular2/upgrade")),i.define=o,r.exports}); \ No newline at end of file diff --git a/2.0.0-alpha.46/angular2.sfx.dev.js b/2.0.0-alpha.46/angular2.sfx.dev.js new file mode 100644 index 0000000000..8065660054 --- /dev/null +++ b/2.0.0-alpha.46/angular2.sfx.dev.js @@ -0,0 +1,42639 @@ +/** + @license +Copyright 2014-2015 Google, Inc. http://angularjs.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + */ + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + +// TODO(vicb): remove '!isFirefox' when the bug gets fixed: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1162013 +if (hasNativePromise && !isFirefox) { + // When available use a native Promise to schedule microtasks. + // When not available, es6-promise fallback will be used + var resolvedPromise = Promise.resolve(); + es6Promise._setScheduler(function(fn) { + resolvedPromise.then(fn); + }); +} + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"es6-promise":17}],5:[function(require,module,exports){ +(function (global){ +'use strict'; + +var fnPatch = require('./functions'); +var promisePatch = require('./promise'); +var mutationObserverPatch = require('./mutation-observer'); +var definePropertyPatch = require('./define-property'); +var registerElementPatch = require('./register-element'); +var webSocketPatch = require('./websocket'); +var eventTargetPatch = require('./event-target'); +var propertyDescriptorPatch = require('./property-descriptor'); +var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); + +function apply() { + fnPatch.patchSetClearFunction(global, [ + 'timeout', + 'interval', + 'immediate' + ]); + + fnPatch.patchRequestAnimationFrame(global, [ + 'requestAnimationFrame', + 'mozRequestAnimationFrame', + 'webkitRequestAnimationFrame' + ]); + + fnPatch.patchFunction(global, [ + 'alert', + 'prompt' + ]); + + eventTargetPatch.apply(); + + propertyDescriptorPatch.apply(); + + promisePatch.apply(); + + mutationObserverPatch.patchClass('MutationObserver'); + mutationObserverPatch.patchClass('WebKitMutationObserver'); + + definePropertyPatch.apply(); + + registerElementPatch.apply(); + + geolocationPatch.apply(); + + fileReaderPatch.apply(); +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(require,module,exports){ +'use strict'; + +var keys = require('../keys'); + +// might need similar for object.freeze +// i regret nothing + +var _defineProperty = Object.defineProperty; +var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); + +function apply() { + Object.defineProperty = function (obj, prop, desc) { + if (isUnconfigurable(obj, prop)) { + throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); + } + if (prop !== 'prototype') { + desc = rewriteDescriptor(obj, prop, desc); + } + return _defineProperty(obj, prop, desc); + }; + + Object.defineProperties = function (obj, props) { + Object.keys(props).forEach(function (prop) { + Object.defineProperty(obj, prop, props[prop]); + }); + return obj; + }; + + Object.create = function (obj, proto) { + if (typeof proto === 'object') { + Object.keys(proto).forEach(function (prop) { + proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); + }); + } + return _create(obj, proto); + }; + + Object.getOwnPropertyDescriptor = function (obj, prop) { + var desc = _getOwnPropertyDescriptor(obj, prop); + if (isUnconfigurable(obj, prop)) { + desc.configurable = false; + } + return desc; + }; +}; + +function _redefineProperty(obj, prop, desc) { + desc = rewriteDescriptor(obj, prop, desc); + return _defineProperty(obj, prop, desc); +}; + +function isUnconfigurable (obj, prop) { + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; +} + +function rewriteDescriptor (obj, prop, desc) { + desc.configurable = true; + if (!desc.configurable) { + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); + } + obj[unconfigurablesKey][prop] = true; + } + return desc; +} + +module.exports = { + apply: apply, + _redefineProperty: _redefineProperty +}; + + + +},{"../keys":3}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + // patched properties depend on addEventListener, so this needs to come first + if (global.EventTarget) { + utils.patchEventTargetMethods(global.EventTarget.prototype); + + // Note: EventTarget is not available in all browsers, + // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget + } else { + var apis = [ + 'ApplicationCache', + 'EventSource', + 'FileReader', + 'InputMethodContext', + 'MediaController', + 'MessagePort', + 'Node', + 'Performance', + 'SVGElementInstance', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebKitNamedFlow', + 'Worker', + 'WorkerGlobalScope', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload' + ]; + + apis.forEach(function(api) { + var proto = global[api] && global[api].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (proto && proto.addEventListener) { + utils.patchEventTargetMethods(proto); + } + }); + + // Patch the methods on `window` instead of `Window.prototype` + // `Window` is not accessible on Android 4.3 + if (typeof(window) !== 'undefined') { + utils.patchEventTargetMethods(window); + } + } +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":16}],9:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function patchSetClearFunction(obj, fnNames) { + fnNames.map(function (name) { + return name[0].toUpperCase() + name.substr(1); + }).forEach(function (name) { + var setName = 'set' + name; + var delegate = obj[setName]; + + if (delegate) { + var clearName = 'clear' + name; + var ids = {}; + + var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce; + + global.zone[setName] = function (fn) { + var id, fnRef = fn; + arguments[0] = function () { + delete ids[id]; + return fnRef.apply(this, arguments); + }; + var args = bindArgs(arguments); + id = delegate.apply(obj, args); + ids[id] = true; + return id; + }; + + obj[setName] = function () { + return global.zone[setName].apply(this, arguments); + }; + + var clearDelegate = obj[clearName]; + + global.zone[clearName] = function (id) { + if (ids[id]) { + delete ids[id]; + global.zone.dequeueTask(); + } + return clearDelegate.apply(this, arguments); + }; + + obj[clearName] = function () { + return global.zone[clearName].apply(this, arguments); + }; + } + }); +}; + + +/** + * requestAnimationFrame is typically recursively called from within the callback function + * that it executes. To handle this case, only fork a zone if this is executed + * within the root zone. + */ +function patchRequestAnimationFrame(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + global.zone[name] = function (fn) { + var callZone = global.zone.isRootZone() ? global.zone.fork() : global.zone; + if (fn) { + arguments[0] = function () { + return callZone.run(fn, this, arguments); + }; + } + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchSetFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + + if (delegate) { + global.zone[name] = function (fn) { + arguments[0] = function () { + return fn.apply(this, arguments); + }; + var args = utils.bindArgumentsOnce(arguments); + return delegate.apply(obj, args); + }; + + obj[name] = function () { + return zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + global.zone[name] = function () { + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + }); +}; + + +module.exports = { + patchSetClearFunction: patchSetClearFunction, + patchSetFunction: patchSetFunction, + patchRequestAnimationFrame: patchRequestAnimationFrame, + patchFunction: patchFunction +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + if (global.navigator && global.navigator.geolocation) { + utils.patchPrototype(global.navigator.geolocation, [ + 'getCurrentPosition', + 'watchPosition' + ]); + } +} + +module.exports = { + apply: apply +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],11:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function (fn) { + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); + // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks + this[creationZoneKey] = global.zone; + }; + + var instance = new OriginalClass(function () {}); + + global[className].prototype.disconnect = function () { + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; + } + return result; + }; + + global[className].prototype.observe = function () { + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; + } + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); + }; + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof global[className].prototype !== undefined) { + return; + } + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } +}; + +module.exports = { + patchClass: patchClass +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3}],12:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +/* + * Patches a function that returns a Promise-like instance. + * + * This function must be used when either: + * - Native Promises are not available, + * - The function returns a Promise-like object. + * + * This is required because zones rely on a Promise monkey patch that could not be applied when + * Promise is not natively available or when the returned object is not an instance of Promise. + * + * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work + * with minimal overhead. + * + * ``` + * var boundFunction = bindPromiseFn(FunctionReturningAPromise); + * + * boundFunction.then(successHandler, errorHandler); + * ``` + */ +var bindPromiseFn; + +if (global.Promise) { + bindPromiseFn = function (delegate) { + return function() { + var delegatePromise = delegate.apply(this, arguments); + + // if the delegate returned an instance of Promise, forward it. + if (delegatePromise instanceof Promise) { + return delegatePromise; + } + + // Otherwise wrap the Promise-like in a global Promise + return new Promise(function(resolve, reject) { + delegatePromise.then(resolve, reject); + }); + }; + }; +} else { + bindPromiseFn = function (delegate) { + return function () { + return _patchThenable(delegate.apply(this, arguments)); + }; + }; +} + + +function _patchPromiseFnsOnObject(objectPath, fnNames) { + var obj = global; + + var exists = objectPath.every(function (segment) { + obj = obj[segment]; + return obj; + }); + + if (!exists) { + return; + } + + fnNames.forEach(function (name) { + var fn = obj[name]; + if (fn) { + obj[name] = bindPromiseFn(fn); + } + }); +} + +function _patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = utils.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + var ocatch = thenable.catch; + thenable.catch = function () { + var args = utils.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + return thenable; +} + + +function apply() { + // Patch .then() and .catch() on native Promises to execute callbacks in the zone where + // those functions are called. + if (global.Promise) { + utils.patchPrototype(Promise.prototype, [ + 'then', + 'catch' + ]); + + // Patch browser APIs that return a Promise + var patchFns = [ + // fetch + [[], ['fetch']], + [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']] + ]; + + patchFns.forEach(function(objPathAndFns) { + _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]); + }); + } +} + +module.exports = { + apply: apply, + bindPromiseFn: bindPromiseFn +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],13:[function(require,module,exports){ +(function (global){ +'use strict'; + +var webSocketPatch = require('./websocket'); +var utils = require('../utils'); +var keys = require('../keys'); + +var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); + +function apply() { + if (utils.isWebWorker()){ + // on WebWorker so don't apply patch + return; + } + + var supportsWebSocket = typeof WebSocket !== 'undefined'; + if (canPatchViaPropertyDescriptor()) { + // for browsers that we can patch the descriptor: Chrome & Firefox + var onEventNames = eventNames.map(function (property) { + return 'on' + property; + }); + utils.patchProperties(HTMLElement.prototype, onEventNames); + utils.patchProperties(XMLHttpRequest.prototype); + if (supportsWebSocket) { + utils.patchProperties(WebSocket.prototype); + } + } else { + // Safari, Android browsers (Jelly Bean) + patchViaCapturingAllTheEvents(); + utils.patchClass('XMLHttpRequest'); + if (supportsWebSocket) { + webSocketPatch.apply(); + } + } +} + +function canPatchViaPropertyDescriptor() { + if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { + // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 + // IDL interface attributes are not configurable + var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); + if (desc && !desc.configurable) return false; + } + + Object.defineProperty(HTMLElement.prototype, 'onclick', { + get: function () { + return true; + } + }); + var elt = document.createElement('div'); + var result = !!elt.onclick; + Object.defineProperty(HTMLElement.prototype, 'onclick', {}); + return result; +}; + +var unboundKey = keys.create('unbound'); + +// Whenever any event fires, we check the event target and all parents +// for `onwhatever` properties and replace them with zone-bound functions +// - Chrome (for now) +function patchViaCapturingAllTheEvents() { + eventNames.forEach(function (property) { + var onproperty = 'on' + property; + document.addEventListener(property, function (event) { + var elt = event.target, bound; + while (elt) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { + bound = global.zone.bind(elt[onproperty]); + bound[unboundKey] = elt[onproperty]; + elt[onproperty] = bound; + } + elt = elt.parentElement; + } + }, true); + }); +}; + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(require,module,exports){ +(function (global){ +'use strict'; + +var _redefineProperty = require('./define-property')._redefineProperty; +var utils = require("../utils"); + +function apply() { + if (utils.isWebWorker() || !('registerElement' in global.document)) { + return; + } + + var _registerElement = document.registerElement; + var callbacks = [ + 'createdCallback', + 'attachedCallback', + 'detachedCallback', + 'attributeChangedCallback' + ]; + + document.registerElement = function (name, opts) { + if (opts && opts.prototype) { + callbacks.forEach(function (callback) { + if (opts.prototype.hasOwnProperty(callback)) { + var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = global.zone.bind(descriptor.value); + _redefineProperty(opts.prototype, callback, descriptor); + } else { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + } else if (opts.prototype[callback]) { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + }); + } + + return _registerElement.apply(document, [name, opts]); + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16,"./define-property":6}],15:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +// we have to patch the instance since the proto is non-configurable +function apply() { + var WS = global.WebSocket; + utils.patchEventTargetMethods(WS.prototype); + global.WebSocket = function(a, b) { + var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); + var proxySocket; + + // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance + var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); + if (onmessageDesc && onmessageDesc.configurable === false) { + proxySocket = Object.create(socket); + ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) { + proxySocket[propName] = function() { + return socket[propName].apply(socket, arguments); + }; + }); + } else { + // we can patch the real socket + proxySocket = socket; + } + + utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']); + + return proxySocket; + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],16:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('./keys'); + +function bindArguments(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bind(args[i]); + } + } + return args; +}; + +function bindArgumentsOnce(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bindOnce(args[i]); + } + } + return args; +}; + +function patchPrototype(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + obj[name] = function () { + return delegate.apply(this, bindArguments(arguments)); + }; + } + }); +}; + +function isWebWorker() { + return (typeof document === "undefined"); +} + +function patchProperty(obj, prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop) || { + enumerable: true, + configurable: true + }; + + // A property descriptor cannot have getter/setter and be writable + // deleting the writable and value properties avoids this error: + // + // TypeError: property descriptors must not specify a value or be writable when a + // getter or setter has been specified + delete desc.writable; + delete desc.value; + + // substr(2) cuz 'onclick' -> 'click', etc + var eventName = prop.substr(2); + var _prop = '_' + prop; + + desc.set = function (fn) { + if (this[_prop]) { + this.removeEventListener(eventName, this[_prop]); + } + + if (typeof fn === 'function') { + this[_prop] = fn; + this.addEventListener(eventName, fn, false); + } else { + this[_prop] = null; + } + }; + + desc.get = function () { + return this[_prop]; + }; + + Object.defineProperty(obj, prop, desc); +}; + +function patchProperties(obj, properties) { + (properties || (function () { + var props = []; + for (var prop in obj) { + props.push(prop); + } + return props; + }()). + filter(function (propertyName) { + return propertyName.substr(0,2) === 'on'; + })). + forEach(function (eventName) { + patchProperty(obj, eventName); + }); +}; + +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + +function patchEventTargetMethods(obj) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + var fn; + //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 + if (handler.toString() !== "[object FunctionWrapper]") { + if (handler.handleEvent) { + // Have to pass in 'handler' reference as an argument here, otherwise it gets clobbered in + // IE9 by the arguments[1] assignment at end of this function. + fn = (function(handler) { + return function() { + handler.handleEvent.apply(handler, arguments); + }; + })(handler); + } else { + fn = handler; + } + + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` (= `self`) + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + return global.zone.addEventListener.apply(target, arguments); + }; + + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + var result = global.zone.removeEventListener.apply(target, arguments); + global.zone.dequeueTask(handler[originalFnKey]); + return result; + }; +}; + +var originalInstanceKey = keys.create('originalInstance'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function () { + var a = bindArguments(arguments); + switch (a.length) { + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; + default: throw new Error('what are you even doing?'); + } + }; + + var instance = new OriginalClass(); + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } + + for (prop in OriginalClass) { + if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { + global[className][prop] = OriginalClass[prop]; + } + } +}; + +module.exports = { + bindArguments: bindArguments, + bindArgumentsOnce: bindArgumentsOnce, + patchPrototype: patchPrototype, + patchProperty: patchProperty, + patchProperties: patchProperties, + patchEventTargetMethods: patchEventTargetMethods, + patchClass: patchClass, + isWebWorker: isWebWorker +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./keys":3}],17:[function(require,module,exports){ +(function (process,global){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 3.0.2 + */ + +(function() { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x === 'function' || (typeof x === 'object' && x !== null); + } + + function lib$es6$promise$utils$$isFunction(x) { + return typeof x === 'function'; + } + + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } + + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + lib$es6$promise$utils$$_isArray = Array.isArray; + } + + var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len = 0; + var lib$es6$promise$asap$$toString = {}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + + var lib$es6$promise$asap$$asap = function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg; + lib$es6$promise$asap$$len += 2; + if (lib$es6$promise$asap$$len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + } + + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn = scheduleFn; + } + + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap = asapFn; + } + + var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + // test for web worker but not in IE10 + var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && + typeof importScripts !== 'undefined' && + typeof MessageChannel !== 'undefined'; + + // node + function lib$es6$promise$asap$$useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function() { + process.nextTick(lib$es6$promise$asap$$flush); + }; + } + + // vertx + function lib$es6$promise$asap$$useVertxTimer() { + return function() { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + + function lib$es6$promise$asap$$useMutationObserver() { + var iterations = 0; + var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function() { + node.data = (iterations = ++iterations % 2); + }; + } + + // web worker + function lib$es6$promise$asap$$useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + + function lib$es6$promise$asap$$useSetTimeout() { + return function() { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + + var lib$es6$promise$asap$$queue = new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) { + var callback = lib$es6$promise$asap$$queue[i]; + var arg = lib$es6$promise$asap$$queue[i+1]; + + callback(arg); + + lib$es6$promise$asap$$queue[i] = undefined; + lib$es6$promise$asap$$queue[i+1] = undefined; + } + + lib$es6$promise$asap$$len = 0; + } + + function lib$es6$promise$asap$$attemptVertx() { + try { + var r = require; + var vertx = r('vertx'); + lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } catch(e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + + var lib$es6$promise$asap$$scheduleFlush; + // Decide what async method to use to triggering processing of queued callbacks: + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick(); + } else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver(); + } else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); + } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); + } else { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); + } + + function lib$es6$promise$$internal$$noop() {} + + var lib$es6$promise$$internal$$PENDING = void 0; + var lib$es6$promise$$internal$$FULFILLED = 1; + var lib$es6$promise$$internal$$REJECTED = 2; + + var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } catch(error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error = error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } + } + + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function(promise) { + var sealed = false; + var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + lib$es6$promise$$internal$$resolve(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function(reason) { + if (sealed) { return; } + sealed = true; + + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor === promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } else { + var then = lib$es6$promise$$internal$$getThen(maybeThenable); + + if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } else if (then === undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); + } else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + lib$es6$promise$$internal$$publish(promise); + } + + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + + promise._result = value; + promise._state = lib$es6$promise$$internal$$FULFILLED; + + if (promise._subscribers.length !== 0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + promise._state = lib$es6$promise$$internal$$REJECTED; + promise._result = reason; + + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onerror = null; + + subscribers[length] = child; + subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment; + subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection; + + if (length === 0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + + function lib$es6$promise$$internal$$publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { return; } + + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; + } + + function lib$es6$promise$$internal$$ErrorObject() { + this.error = null; + } + + var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback = lib$es6$promise$utils$$isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = lib$es6$promise$$internal$$tryCatch(callback, detail); + + if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } + + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + + } else { + value = detail; + succeeded = true; + } + + if (promise._state !== lib$es6$promise$$internal$$PENDING) { + // noop + } else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } else if (settled === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value){ + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } catch(e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator = this; + + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; + + enumerator._init(); + + if (enumerator.length === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } else { + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) { + return lib$es6$promise$utils$$isArray(input); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._init = function() { + this._result = new Array(this.length); + }; + + var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator; + + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() { + var enumerator = this; + + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { + var enumerator = this; + var c = enumerator._instanceConstructor; + + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) { + entry._onerror = null; + enumerator._settledAt(entry._state, i, entry._result); + } else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } else { + enumerator._remaining--; + enumerator._result[i] = entry; + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { + var enumerator = this; + var promise = enumerator.promise; + + if (promise._state === lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + + if (state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } else { + enumerator._result[i] = value; + } + } + + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; + + lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; + } + var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject; + + var lib$es6$promise$promise$$counter = 0; + + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + var lib$es6$promise$promise$$default = lib$es6$promise$promise$$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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {function} resolver + Useful for tooling. + @constructor + */ + function lib$es6$promise$promise$$Promise(resolver) { + this._id = lib$es6$promise$promise$$counter++; + this._state = undefined; + this._result = undefined; + this._subscribers = []; + + if (lib$es6$promise$$internal$$noop !== resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + + lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap; + + lib$es6$promise$promise$$Promise.prototype = { + constructor: lib$es6$promise$promise$$Promise, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + then: function(onFulfillment, onRejection) { + var parent = this; + var state = parent._state; + + if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + + var child = new this.constructor(lib$es6$promise$$internal$$noop); + var result = parent._result; + + if (state) { + var callback = arguments[state - 1]; + lib$es6$promise$asap$$asap(function(){ + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + + return child; + }, + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + 'catch': function(onRejection) { + return this.then(null, onRejection); + } + }; + function lib$es6$promise$polyfill$$polyfill() { + var local; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) { + return; + } + + local.Promise = lib$es6$promise$promise$$default; + } + var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill; + + var lib$es6$promise$umd$$ES6Promise = { + 'Promise': lib$es6$promise$promise$$default, + 'polyfill': lib$es6$promise$polyfill$$default + }; + + /* global define:true module:true window: true */ + if (typeof define === 'function' && define['amd']) { + define(function() { return lib$es6$promise$umd$$ES6Promise; }); + } else if (typeof module !== 'undefined' && module['exports']) { + module['exports'] = lib$es6$promise$umd$$ES6Promise; + } else if (typeof this !== 'undefined') { + this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise; + } + + lib$es6$promise$polyfill$$default(); +}).call(this); + + +}).call(this,{},typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + if (IsUndefined(metadataMap)) { + return false; + } + if (!metadataMap.delete(metadataKey)) { + return false; + } + if (metadataMap.size > 0) { + return true; + } + var targetMetadata = __Metadata__.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) { + return true; + } + __Metadata__.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) { + throw new TypeError(); + } + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) { + throw new TypeError(); + } + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = __Metadata__.get(target); + if (!targetMetadata) { + if (!create) { + return undefined; + } + targetMetadata = new _Map(); + __Metadata__.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) { + return undefined; + } + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return true; + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryHasMetadata(MetadataKey, parent, P); + } + return false; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return false; + } + return Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryGetMetadata(MetadataKey, parent, P); + } + return undefined; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return undefined; + } + return metadataMap.get(MetadataKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) { + return ownKeys; + } + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) { + return ownKeys; + } + if (ownKeys.length <= 0) { + return parentKeys; + } + var set = new _Set(); + var keys = []; + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) { + metadataMap.forEach(function (_, key) { return keys.push(key); }); + } + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray(x); + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + if (IsSymbol(value)) { + return value; + } + return String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) { + return proto; + } + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) { + return proto; + } + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) { + return proto; + } + // if the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") { + return proto; + } + // if we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) { + return proto; + } + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + function Map() { + this._keys = []; + this._values = []; + this._cache = cacheSentinel; + } + Map.prototype = { + get size() { + return this._keys.length; + }, + has: function (key) { + if (key === this._cache) { + return true; + } + if (this._find(key) >= 0) { + this._cache = key; + return true; + } + return false; + }, + get: function (key) { + var index = this._find(key); + if (index >= 0) { + this._cache = key; + return this._values[index]; + } + return undefined; + }, + set: function (key, value) { + this.delete(key); + this._keys.push(key); + this._values.push(value); + this._cache = key; + return this; + }, + delete: function (key) { + var index = this._find(key); + if (index >= 0) { + this._keys.splice(index, 1); + this._values.splice(index, 1); + this._cache = cacheSentinel; + return true; + } + return false; + }, + clear: function () { + this._keys.length = 0; + this._values.length = 0; + this._cache = cacheSentinel; + }, + forEach: function (callback, thisArg) { + var size = this.size; + for (var i = 0; i < size; ++i) { + var key = this._keys[i]; + var value = this._values[i]; + this._cache = key; + callback.call(this, value, key, this); + } + }, + _find: function (key) { + var keys = this._keys; + var size = keys.length; + for (var i = 0; i < size; ++i) { + if (keys[i] === key) { + return i; + } + } + return -1; + } + }; + return Map; + } + // naive Set shim + function CreateSetPolyfill() { + var cacheSentinel = {}; + function Set() { + this._map = new _Map(); + } + Set.prototype = { + get size() { + return this._map.length; + }, + has: function (value) { + return this._map.has(value); + }, + add: function (value) { + this._map.set(value, value); + return this; + }, + delete: function (value) { + return this._map.delete(value); + }, + clear: function () { + this._map.clear(); + }, + forEach: function (callback, thisArg) { + this._map.forEach(callback, thisArg); + } + }; + return Set; + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; + var nodeCrypto = isNode && require("crypto"); + var hasOwn = Object.prototype.hasOwnProperty; + var keys = {}; + var rootKey = CreateUniqueKey(); + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype = { + has: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return this._key in table; + } + return false; + }, + get: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return table[this._key]; + } + return undefined; + }, + set: function (target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }, + delete: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table && this._key in table) { + return delete table[this._key]; + } + return false; + }, + clear: function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + } + }; + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) { + buffer[i] = Math.random() * 255 | 0; + } + } + function GenRandomBytes(size) { + if (nodeCrypto) { + var data = nodeCrypto.randomBytes(size); + return data; + } + else if (typeof Uint8Array === "function") { + var data = new Uint8Array(size); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(data); + } + else if (typeof msCrypto !== "undefined") { + msCrypto.getRandomValues(data); + } + else { + FillRandomBytes(data, size); + } + return data; + } + else { + var data = new Array(size); + FillRandomBytes(data, size); + return data; + } + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) { + result += "-"; + } + if (byte < 16) { + result += "0"; + } + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do { + key = "@@WeakMap@@" + CreateUUID(); + } while (hasOwn.call(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) { + return undefined; + } + Object.defineProperty(target, rootKey, { value: Object.create(null) }); + } + return target[rootKey]; + } + return WeakMap; + } + // hook global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + __global.Reflect[p] = Reflect[p]; + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURLDisabled=Reflect.js.map +(function(global) { + + var defined = {}; + + // indexOf polyfill for IE8 + var indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) + if (this[i] === item) + return i; + return -1; + } + + function dedupe(deps) { + var newDeps = []; + for (var i = 0, l = deps.length; i < l; i++) + if (indexOf.call(newDeps, deps[i]) == -1) + newDeps.push(deps[i]) + return newDeps; + } + + function register(name, deps, declare, execute) { + if (typeof name != 'string') + throw "System.register provided no module name"; + + var entry; + + // dynamic + if (typeof declare == 'boolean') { + entry = { + declarative: false, + deps: deps, + execute: execute, + executingRequire: declare + }; + } + else { + // ES6 declarative + entry = { + declarative: true, + deps: deps, + declare: declare + }; + } + + entry.name = name; + + // we never overwrite an existing define + if (!(name in defined)) + defined[name] = entry; + + entry.deps = dedupe(entry.deps); + + // we have to normalize dependencies + // (assume dependencies are normalized for now) + // entry.normalizedDeps = entry.deps.map(normalize); + entry.normalizedDeps = entry.deps; + } + + function buildGroups(entry, groups) { + groups[entry.groupIndex] = groups[entry.groupIndex] || []; + + if (indexOf.call(groups[entry.groupIndex], entry) != -1) + return; + + groups[entry.groupIndex].push(entry); + + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + + // not in the registry means already linked / ES6 + if (!depEntry || depEntry.evaluated) + continue; + + // now we know the entry is in our unlinked linkage group + var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); + + // the group index of an entry is always the maximum + if (depEntry.groupIndex === undefined || depEntry.groupIndex < depGroupIndex) { + + // if already in a group, remove from the old group + if (depEntry.groupIndex !== undefined) { + groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); + + // if the old group is empty, then we have a mixed depndency cycle + if (groups[depEntry.groupIndex].length == 0) + throw new TypeError("Mixed dependency cycle detected"); + } + + depEntry.groupIndex = depGroupIndex; + } + + buildGroups(depEntry, groups); + } + } + + function link(name) { + var startEntry = defined[name]; + + startEntry.groupIndex = 0; + + var groups = []; + + buildGroups(startEntry, groups); + + var curGroupDeclarative = !!startEntry.declarative == groups.length % 2; + for (var i = groups.length - 1; i >= 0; i--) { + var group = groups[i]; + for (var j = 0; j < group.length; j++) { + var entry = group[j]; + + // link each group + if (curGroupDeclarative) + linkDeclarativeModule(entry); + else + linkDynamicModule(entry); + } + curGroupDeclarative = !curGroupDeclarative; + } + } + + // module binding records + var moduleRecords = {}; + function getOrCreateModuleRecord(name) { + return moduleRecords[name] || (moduleRecords[name] = { + name: name, + dependencies: [], + exports: {}, // start from an empty module and extend + importers: [] + }) + } + + function linkDeclarativeModule(entry) { + // only link if already not already started linking (stops at circular) + if (entry.module) + return; + + var module = entry.module = getOrCreateModuleRecord(entry.name); + var exports = entry.module.exports; + + var declaration = entry.declare.call(global, function(name, value) { + module.locked = true; + exports[name] = value; + + for (var i = 0, l = module.importers.length; i < l; i++) { + var importerModule = module.importers[i]; + if (!importerModule.locked) { + var importerIndex = indexOf.call(importerModule.dependencies, module); + importerModule.setters[importerIndex](exports); + } + } + + module.locked = false; + return value; + }); + + module.setters = declaration.setters; + module.execute = declaration.execute; + + if (!module.setters || !module.execute) + throw new TypeError("Invalid System.register form for " + entry.name); + + // now link all the module dependencies + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + var depModule = moduleRecords[depName]; + + // work out how to set depExports based on scenarios... + var depExports; + + if (depModule) { + depExports = depModule.exports; + } + else if (depEntry && !depEntry.declarative) { + if (depEntry.module.exports && depEntry.module.exports.__esModule) + depExports = depEntry.module.exports; + else + depExports = { 'default': depEntry.module.exports, __useDefault: true }; + } + // in the module registry + else if (!depEntry) { + depExports = load(depName); + } + // we have an entry -> link + else { + linkDeclarativeModule(depEntry); + depModule = depEntry.module; + depExports = depModule.exports; + } + + // only declarative modules have dynamic bindings + if (depModule && depModule.importers) { + depModule.importers.push(module); + module.dependencies.push(depModule); + } + else + module.dependencies.push(null); + + // run the setter for this dependency + if (module.setters[i]) + module.setters[i](depExports); + } + } + + // An analog to loader.get covering execution of all three layers (real declarative, simulated declarative, simulated dynamic) + function getModule(name) { + var exports; + var entry = defined[name]; + + if (!entry) { + exports = load(name); + if (!exports) + throw new Error("Unable to load dependency " + name + "."); + } + + else { + if (entry.declarative) + ensureEvaluated(name, []); + + else if (!entry.evaluated) + linkDynamicModule(entry); + + exports = entry.module.exports; + } + + if ((!entry || entry.declarative) && exports && exports.__useDefault) + return exports['default']; + + return exports; + } + + function linkDynamicModule(entry) { + if (entry.module) + return; + + var exports = {}; + + var module = entry.module = { exports: exports, id: entry.name }; + + // AMD requires execute the tree first + if (!entry.executingRequire) { + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + if (depEntry) + linkDynamicModule(depEntry); + } + } + + // now execute + entry.evaluated = true; + var output = entry.execute.call(global, function(name) { + for (var i = 0, l = entry.deps.length; i < l; i++) { + if (entry.deps[i] != name) + continue; + return getModule(entry.normalizedDeps[i]); + } + throw new TypeError('Module ' + name + ' not declared as a dependency.'); + }, exports, module); + + if (output) + module.exports = output; + } + + /* + * Given a module, and the list of modules for this current branch, + * ensure that each of the dependencies of this module is evaluated + * (unless one is a circular dependency already in the list of seen + * modules, in which case we execute it) + * + * Then we evaluate the module itself depth-first left to right + * execution to match ES6 modules + */ + function ensureEvaluated(moduleName, seen) { + var entry = defined[moduleName]; + + // if already seen, that means it's an already-evaluated non circular dependency + if (!entry || entry.evaluated || !entry.declarative) + return; + + // this only applies to declarative modules which late-execute + + seen.push(moduleName); + + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + if (indexOf.call(seen, depName) == -1) { + if (!defined[depName]) + load(depName); + else + ensureEvaluated(depName, seen); + } + } + + if (entry.evaluated) + return; + + entry.evaluated = true; + entry.module.execute.call(global); + } + + // magical execution function + var modules = {}; + function load(name) { + if (modules[name]) + return modules[name]; + + var entry = defined[name]; + + // first we check if this module has already been defined in the registry + if (!entry) + throw "Module " + name + " not present."; + + // recursively ensure that the module and all its + // dependencies are linked (with dependency group handling) + link(name); + + // now handle dependency execution in correct order + ensureEvaluated(name, []); + + // remove from the registry + defined[name] = undefined; + + var module = entry.module.exports; + + if (!module || !entry.declarative && module.__esModule !== true) + module = { 'default': module, __useDefault: true }; + + // return the defined module object + return modules[name] = module; + }; + + return function(mains, declare) { + + var System; + var System = { + register: register, + get: load, + set: function(name, module) { + modules[name] = module; + }, + newModule: function(module) { + return module; + }, + global: global + }; + System.set('@empty', {}); + + declare(System); + + for (var i = 0; i < mains.length; i++) + load(mains[i]); + } + +})(typeof window != 'undefined' ? window : global) +/* (['mainModule'], function(System) { + System.register(...); +}); */ + +(['angular2/angular2_sfx'], function(System) { + +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Class = decorators_1.Class; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var _EMPTY_ATTR_VALUE = ''; + var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); + var CssSelector = (function() { + function CssSelector() { + this.element = null; + this.classNames = []; + this.attrs = []; + this.notSelectors = []; + } + CssSelector.parse = function(selector) { + var results = []; + var _addResult = function(res, cssSel) { + if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { + cssSel.element = "*"; + } + res.push(cssSel); + }; + var cssSelector = new CssSelector(); + var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); + var match; + var current = cssSelector; + var inNot = false; + while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { + if (lang_1.isPresent(match[1])) { + if (inNot) { + throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); + } + inNot = true; + current = new CssSelector(); + cssSelector.notSelectors.push(current); + } + if (lang_1.isPresent(match[2])) { + current.setElement(match[2]); + } + if (lang_1.isPresent(match[3])) { + current.addClassName(match[3]); + } + if (lang_1.isPresent(match[4])) { + current.addAttribute(match[4], match[5]); + } + if (lang_1.isPresent(match[6])) { + inNot = false; + current = cssSelector; + } + if (lang_1.isPresent(match[7])) { + if (inNot) { + throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); + } + _addResult(results, cssSelector); + cssSelector = current = new CssSelector(); + } + } + _addResult(results, cssSelector); + return results; + }; + CssSelector.prototype.isElementSelector = function() { + return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; + }; + CssSelector.prototype.setElement = function(element) { + if (element === void 0) { + element = null; + } + if (lang_1.isPresent(element)) { + element = element.toLowerCase(); + } + this.element = element; + }; + CssSelector.prototype.getMatchingElementTemplate = function() { + var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; + var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; + var attrs = ''; + for (var i = 0; i < this.attrs.length; i += 2) { + var attrName = this.attrs[i]; + var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; + attrs += " " + attrName + attrValue; + } + return "<" + tagName + classAttr + attrs + ">"; + }; + CssSelector.prototype.addAttribute = function(name, value) { + if (value === void 0) { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(name.toLowerCase()); + if (lang_1.isPresent(value)) { + value = value.toLowerCase(); + } else { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(value); + }; + CssSelector.prototype.addClassName = function(name) { + this.classNames.push(name.toLowerCase()); + }; + CssSelector.prototype.toString = function() { + var res = ''; + if (lang_1.isPresent(this.element)) { + res += this.element; + } + if (lang_1.isPresent(this.classNames)) { + for (var i = 0; i < this.classNames.length; i++) { + res += '.' + this.classNames[i]; + } + } + if (lang_1.isPresent(this.attrs)) { + for (var i = 0; i < this.attrs.length; ) { + var attrName = this.attrs[i++]; + var attrValue = this.attrs[i++]; + res += '[' + attrName; + if (attrValue.length > 0) { + res += '=' + attrValue; + } + res += ']'; + } + } + this.notSelectors.forEach(function(notSelector) { + return res += ":not(" + notSelector + ")"; + }); + return res; + }; + return CssSelector; + })(); + exports.CssSelector = CssSelector; + var SelectorMatcher = (function() { + function SelectorMatcher() { + this._elementMap = new collection_1.Map(); + this._elementPartialMap = new collection_1.Map(); + this._classMap = new collection_1.Map(); + this._classPartialMap = new collection_1.Map(); + this._attrValueMap = new collection_1.Map(); + this._attrValuePartialMap = new collection_1.Map(); + this._listContexts = []; + } + SelectorMatcher.createNotMatcher = function(notSelectors) { + var notMatcher = new SelectorMatcher(); + notMatcher.addSelectables(notSelectors, null); + return notMatcher; + }; + SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { + var listContext = null; + if (cssSelectors.length > 1) { + listContext = new SelectorListContext(cssSelectors); + this._listContexts.push(listContext); + } + for (var i = 0; i < cssSelectors.length; i++) { + this._addSelectable(cssSelectors[i], callbackCtxt, listContext); + } + }; + SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { + var matcher = this; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); + if (lang_1.isPresent(element)) { + var isTerminal = attrs.length === 0 && classNames.length === 0; + if (isTerminal) { + this._addTerminal(matcher._elementMap, element, selectable); + } else { + matcher = this._addPartial(matcher._elementPartialMap, element); + } + } + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var isTerminal = attrs.length === 0 && index === classNames.length - 1; + var className = classNames[index]; + if (isTerminal) { + this._addTerminal(matcher._classMap, className, selectable); + } else { + matcher = this._addPartial(matcher._classPartialMap, className); + } + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var isTerminal = index === attrs.length - 2; + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + if (isTerminal) { + var terminalMap = matcher._attrValueMap; + var terminalValuesMap = terminalMap.get(attrName); + if (lang_1.isBlank(terminalValuesMap)) { + terminalValuesMap = new collection_1.Map(); + terminalMap.set(attrName, terminalValuesMap); + } + this._addTerminal(terminalValuesMap, attrValue, selectable); + } else { + var parttialMap = matcher._attrValuePartialMap; + var partialValuesMap = parttialMap.get(attrName); + if (lang_1.isBlank(partialValuesMap)) { + partialValuesMap = new collection_1.Map(); + parttialMap.set(attrName, partialValuesMap); + } + matcher = this._addPartial(partialValuesMap, attrValue); + } + } + } + }; + SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { + var terminalList = map.get(name); + if (lang_1.isBlank(terminalList)) { + terminalList = []; + map.set(name, terminalList); + } + terminalList.push(selectable); + }; + SelectorMatcher.prototype._addPartial = function(map, name) { + var matcher = map.get(name); + if (lang_1.isBlank(matcher)) { + matcher = new SelectorMatcher(); + map.set(name, matcher); + } + return matcher; + }; + SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { + var result = false; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + for (var i = 0; i < this._listContexts.length; i++) { + this._listContexts[i].alreadyMatched = false; + } + result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var className = classNames[index]; + result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + var terminalValuesMap = this._attrValueMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; + var partialValuesMap = this._attrValuePartialMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; + } + } + return result; + }; + SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var selectables = map.get(name); + var starSelectables = map.get("*"); + if (lang_1.isPresent(starSelectables)) { + selectables = selectables.concat(starSelectables); + } + if (lang_1.isBlank(selectables)) { + return false; + } + var selectable; + var result = false; + for (var index = 0; index < selectables.length; index++) { + selectable = selectables[index]; + result = selectable.finalize(cssSelector, matchedCallback) || result; + } + return result; + }; + SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var nestedSelector = map.get(name); + if (lang_1.isBlank(nestedSelector)) { + return false; + } + return nestedSelector.match(cssSelector, matchedCallback); + }; + return SelectorMatcher; + })(); + exports.SelectorMatcher = SelectorMatcher; + var SelectorListContext = (function() { + function SelectorListContext(selectors) { + this.selectors = selectors; + this.alreadyMatched = false; + } + return SelectorListContext; + })(); + exports.SelectorListContext = SelectorListContext; + var SelectorContext = (function() { + function SelectorContext(selector, cbContext, listContext) { + this.selector = selector; + this.cbContext = cbContext; + this.listContext = listContext; + this.notSelectors = selector.notSelectors; + } + SelectorContext.prototype.finalize = function(cssSelector, callback) { + var result = true; + if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); + result = !notMatcher.match(cssSelector, null); + } + if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + if (lang_1.isPresent(this.listContext)) { + this.listContext.alreadyMatched = true; + } + callback(this.selector, this.cbContext); + } + return result; + }; + return SelectorContext; + })(); + exports.SelectorContext = SelectorContext; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\$/g; + var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\$/g; + exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + function escapeSingleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; + } + exports.escapeSingleQuoteString = escapeSingleQuoteString; + function escapeDoubleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; + } + exports.escapeDoubleQuoteString = escapeDoubleQuoteString; + function escapeString(input, re) { + return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { + if (match[0] == '$') { + return lang_1.IS_DART ? '\\$' : '$'; + } else if (match[0] == '\n') { + return '\\n'; + } else { + return "\\" + match[0]; + } + }); + } + function codeGenExportVariable(name) { + if (lang_1.IS_DART) { + return "const " + name + " = "; + } else { + return "var " + name + " = exports['" + name + "'] = "; + } + } + exports.codeGenExportVariable = codeGenExportVariable; + function codeGenConstConstructorCall(name) { + if (lang_1.IS_DART) { + return "const " + name; + } else { + return "new " + name; + } + } + exports.codeGenConstConstructorCall = codeGenConstConstructorCall; + function codeGenValueFn(params, value, fnName) { + if (fnName === void 0) { + fnName = ''; + } + if (lang_1.IS_DART) { + return fnName + "(" + params.join(',') + ") => " + value; + } else { + return "function " + fnName + "(" + params.join(',') + ") { return " + value + "; }"; + } + } + exports.codeGenValueFn = codeGenValueFn; + function codeGenToString(expr) { + if (lang_1.IS_DART) { + return "'${" + expr + "}'"; + } else { + return expr; + } + } + exports.codeGenToString = codeGenToString; + function splitAtColon(input, defaultValues) { + var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); + if (parts.length > 1) { + return parts; + } else { + return defaultValues; + } + } + exports.splitAtColon = splitAtColon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; + function moduleRef(moduleUrl) { + return "#MODULE[" + moduleUrl + "]"; + } + exports.moduleRef = moduleRef; + var SourceModule = (function() { + function SourceModule(moduleUrl, sourceWithModuleRefs) { + this.moduleUrl = moduleUrl; + this.sourceWithModuleRefs = sourceWithModuleRefs; + } + SourceModule.prototype.getSourceWithImports = function() { + var _this = this; + var moduleAliases = {}; + var imports = []; + var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { + var moduleUrl = match[1]; + var alias = moduleAliases[moduleUrl]; + if (lang_1.isBlank(alias)) { + if (moduleUrl == _this.moduleUrl) { + alias = ''; + } else { + alias = "import" + imports.length; + imports.push([moduleUrl, alias]); + } + moduleAliases[moduleUrl] = alias; + } + return alias.length > 0 ? alias + "." : ''; + }); + return new SourceWithImports(newSource, imports); + }; + return SourceModule; + })(); + exports.SourceModule = SourceModule; + var SourceExpression = (function() { + function SourceExpression(declarations, expression) { + this.declarations = declarations; + this.expression = expression; + } + return SourceExpression; + })(); + exports.SourceExpression = SourceExpression; + var SourceExpressions = (function() { + function SourceExpressions(declarations, expressions) { + this.declarations = declarations; + this.expressions = expressions; + } + return SourceExpressions; + })(); + exports.SourceExpressions = SourceExpressions; + var SourceWithImports = (function() { + function SourceWithImports(source, imports) { + this.source = source; + this.imports = imports; + } + return SourceWithImports; + })(); + exports.SourceWithImports = SourceWithImports; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var TextAst = (function() { + function TextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + TextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return TextAst; + })(); + exports.TextAst = TextAst; + var BoundTextAst = (function() { + function BoundTextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + BoundTextAst.prototype.visit = function(visitor, context) { + return visitor.visitBoundText(this, context); + }; + return BoundTextAst; + })(); + exports.BoundTextAst = BoundTextAst; + var AttrAst = (function() { + function AttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + AttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return AttrAst; + })(); + exports.AttrAst = AttrAst; + var BoundElementPropertyAst = (function() { + function BoundElementPropertyAst(name, type, value, unit, sourceInfo) { + this.name = name; + this.type = type; + this.value = value; + this.unit = unit; + this.sourceInfo = sourceInfo; + } + BoundElementPropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitElementProperty(this, context); + }; + return BoundElementPropertyAst; + })(); + exports.BoundElementPropertyAst = BoundElementPropertyAst; + var BoundEventAst = (function() { + function BoundEventAst(name, target, handler, sourceInfo) { + this.name = name; + this.target = target; + this.handler = handler; + this.sourceInfo = sourceInfo; + } + BoundEventAst.prototype.visit = function(visitor, context) { + return visitor.visitEvent(this, context); + }; + Object.defineProperty(BoundEventAst.prototype, "fullName", { + get: function() { + if (lang_1.isPresent(this.target)) { + return this.target + ":" + this.name; + } else { + return this.name; + } + }, + enumerable: true, + configurable: true + }); + return BoundEventAst; + })(); + exports.BoundEventAst = BoundEventAst; + var VariableAst = (function() { + function VariableAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + VariableAst.prototype.visit = function(visitor, context) { + return visitor.visitVariable(this, context); + }; + return VariableAst; + })(); + exports.VariableAst = VariableAst; + var ElementAst = (function() { + function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.inputs = inputs; + this.outputs = outputs; + this.exportAsVars = exportAsVars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + ElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + ElementAst.prototype.isBound = function() { + return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); + }; + ElementAst.prototype.getComponent = function() { + return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; + }; + return ElementAst; + })(); + exports.ElementAst = ElementAst; + var EmbeddedTemplateAst = (function() { + function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceInfo) { + this.attrs = attrs; + this.outputs = outputs; + this.vars = vars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + EmbeddedTemplateAst.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return EmbeddedTemplateAst; + })(); + exports.EmbeddedTemplateAst = EmbeddedTemplateAst; + var BoundDirectivePropertyAst = (function() { + function BoundDirectivePropertyAst(directiveName, templateName, value, sourceInfo) { + this.directiveName = directiveName; + this.templateName = templateName; + this.value = value; + this.sourceInfo = sourceInfo; + } + BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitDirectiveProperty(this, context); + }; + return BoundDirectivePropertyAst; + })(); + exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; + var DirectiveAst = (function() { + function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceInfo) { + this.directive = directive; + this.inputs = inputs; + this.hostProperties = hostProperties; + this.hostEvents = hostEvents; + this.exportAsVars = exportAsVars; + this.sourceInfo = sourceInfo; + } + DirectiveAst.prototype.visit = function(visitor, context) { + return visitor.visitDirective(this, context); + }; + return DirectiveAst; + })(); + exports.DirectiveAst = DirectiveAst; + var NgContentAst = (function() { + function NgContentAst(index, ngContentIndex, sourceInfo) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + NgContentAst.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return NgContentAst; + })(); + exports.NgContentAst = NgContentAst; + (function(PropertyBindingType) { + PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; + PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; + PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; + PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; + })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); + var PropertyBindingType = exports.PropertyBindingType; + function templateVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.templateVisitAll = templateVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Codegen = (function() { + function Codegen(moduleAlias) {} + Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { + throw "Not implemented in JS"; + }; + Codegen.prototype.toString = function() { + throw "Not implemented in JS"; + }; + return Codegen; + })(); + exports.Codegen = Codegen; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var ShadowCss = (function() { + function ShadowCss() { + this.strictStyling = true; + } + ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { + if (hostSelector === void 0) { + hostSelector = ''; + } + cssText = stripComments(cssText); + cssText = this._insertDirectives(cssText); + return this._scopeCssText(cssText, selector, hostSelector); + }; + ShadowCss.prototype._insertDirectives = function(cssText) { + cssText = this._insertPolyfillDirectivesInCssText(cssText); + return this._insertPolyfillRulesInCssText(cssText); + }; + ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { + return m[1] + '{'; + }); + }; + ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[1], ''); + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + return m[3] + rule; + }); + }; + ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { + var unscoped = this._extractUnscopedRulesFromCssText(cssText); + cssText = this._insertPolyfillHostInCssText(cssText); + cssText = this._convertColonHost(cssText); + cssText = this._convertColonHostContext(cssText); + cssText = this._convertShadowDOMSelectors(cssText); + if (lang_1.isPresent(scopeSelector)) { + cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); + } + cssText = cssText + '\n' + unscoped; + return cssText.trim(); + }; + ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { + var r = '', + m; + var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); + while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); + r += rule + '\n\n'; + } + return r; + }; + ShadowCss.prototype._convertColonHost = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); + }; + ShadowCss.prototype._convertColonHostContext = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); + }; + ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { + return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { + if (lang_1.isPresent(m[2])) { + var parts = m[2].split(','), + r = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + if (lang_1.isBlank(p)) + break; + p = p.trim(); + r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); + } + return r.join(','); + } else { + return _polyfillHostNoCombinator + m[3]; + } + }); + }; + ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { + if (lang_1.StringWrapper.contains(part, _polyfillHost)) { + return this._colonHostPartReplacer(host, part, suffix); + } else { + return host + part + suffix + ', ' + part + ' ' + host + suffix; + } + }; + ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { + return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; + }; + ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { + for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { + cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); + } + return cssText; + }; + ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { + var _this = this; + return processRules(cssText, function(rule) { + var selector = rule.selector; + var content = rule.content; + if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { + selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); + } else if (rule.selector.startsWith('@media')) { + content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); + } + return new CssRule(selector, content); + }); + }; + ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { + var r = [], + parts = selector.split(','); + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + p = p.trim(); + if (this._selectorNeedsScoping(p, scopeSelector)) { + p = strict && !lang_1.StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector); + } + r.push(p); + } + return r.join(', '); + }; + ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { + var re = this._makeScopeMatcher(scopeSelector); + return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); + }; + ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { + var lre = /\[/g; + var rre = /\]/g; + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); + return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); + }; + ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { + return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); + }; + ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { + if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { + var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; + selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); + return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); + } else { + return scopeSelector + ' ' + selector; + } + }; + ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { + var isRe = /\[is=([^\]]*)\]/g; + scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { + return m[1]; + }); + var splits = [' ', '>', '+', '~'], + scoped = selector, + attrName = '[' + scopeSelector + ']'; + for (var i = 0; i < splits.length; i++) { + var sep = splits[i]; + var parts = scoped.split(sep); + scoped = parts.map(function(p) { + var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); + if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { + var re = /([^:]*)(:*)(.*)/g; + var m = lang_1.RegExpWrapper.firstMatch(re, t); + if (lang_1.isPresent(m)) { + p = m[1] + attrName + m[2] + m[3]; + } + } + return p; + }).join(sep); + } + return scoped; + }; + ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); + return selector; + }; + return ShadowCss; + })(); + exports.ShadowCss = ShadowCss; + var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; + var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _polyfillHost = '-shadowcsshost'; + var _polyfillHostContext = '-shadowcsscontext'; + var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; + var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); + var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); + var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; + var _shadowDOMSelectorsRe = [/>>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow-deep\//g, /\/shadow\//g]; + var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; + var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); + var _colonHostRe = /:host/gim; + var _colonHostContextRe = /:host-context/gim; + var _commentRe = /\/\*[\s\S]*?\*\//g; + function stripComments(input) { + return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { + return ''; + }); + } + var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; + var _curlyRe = /([{}])/g; + var OPEN_CURLY = '{'; + var CLOSE_CURLY = '}'; + var BLOCK_PLACEHOLDER = '%BLOCK%'; + var CssRule = (function() { + function CssRule(selector, content) { + this.selector = selector; + this.content = content; + } + return CssRule; + })(); + exports.CssRule = CssRule; + function processRules(input, ruleCallback) { + var inputWithEscapedBlocks = escapeBlocks(input); + var nextBlockIndex = 0; + return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { + var selector = m[2]; + var content = ''; + var suffix = m[4]; + var contentPrefix = ''; + if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { + content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; + suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); + contentPrefix = '{'; + } + var rule = ruleCallback(new CssRule(selector, content)); + return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; + }); + } + exports.processRules = processRules; + var StringWithEscapedBlocks = (function() { + function StringWithEscapedBlocks(escapedString, blocks) { + this.escapedString = escapedString; + this.blocks = blocks; + } + return StringWithEscapedBlocks; + })(); + function escapeBlocks(input) { + var inputParts = lang_1.StringWrapper.split(input, _curlyRe); + var resultParts = []; + var escapedBlocks = []; + var bracketCount = 0; + var currentBlockParts = []; + for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { + var part = inputParts[partIndex]; + if (part == CLOSE_CURLY) { + bracketCount--; + } + if (bracketCount > 0) { + currentBlockParts.push(part); + } else { + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + currentBlockParts = []; + } + resultParts.push(part); + } + if (part == OPEN_CURLY) { + bracketCount++; + } + } + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + } + return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var StyleWithImports = (function() { + function StyleWithImports(style, styleUrls) { + this.style = style; + this.styleUrls = styleUrls; + } + return StyleWithImports; + })(); + exports.StyleWithImports = StyleWithImports; + function isStyleUrlResolvable(url) { + if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') + return false; + var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); + return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; + } + exports.isStyleUrlResolvable = isStyleUrlResolvable; + function extractStyleUrls(resolver, baseUrl, cssText) { + var foundUrls = []; + var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { + var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; + if (!isStyleUrlResolvable(url)) { + return m[0]; + } + foundUrls.push(resolver.resolve(baseUrl, url)); + return ''; + }); + return new StyleWithImports(modifiedCssText, foundUrls); + } + exports.extractStyleUrls = extractStyleUrls; + var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; + var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/command_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/template_commands", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + exports.TEMPLATE_COMMANDS_MODULE_REF = source_module_1.moduleRef("package:angular2/src/core/linker/template_commands" + util_1.MODULE_SUFFIX); + var IMPLICIT_TEMPLATE_VAR = '\$implicit'; + var CLASS_ATTR = 'class'; + var STYLE_ATTR = 'style'; + var CommandCompiler = (function() { + function CommandCompiler() {} + CommandCompiler.prototype.compileComponentRuntime = function(component, template, changeDetectorFactories, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories), 0); + template_ast_1.templateVisitAll(visitor, template); + return visitor.result; + }; + CommandCompiler.prototype.compileComponentCodeGen = function(component, template, changeDetectorFactoryExpressions, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions), 0); + template_ast_1.templateVisitAll(visitor, template); + return new source_module_1.SourceExpression([], codeGenArray(visitor.result)); + }; + CommandCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], CommandCompiler); + return CommandCompiler; + })(); + exports.CommandCompiler = CommandCompiler; + var RuntimeCommandFactory = (function() { + function RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactories = changeDetectorFactories; + } + RuntimeCommandFactory.prototype._mapDirectives = function(directives) { + return directives.map(function(directive) { + return directive.type.runtime; + }); + }; + RuntimeCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new template_commands_1.TextCmd(value, isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new template_commands_1.NgContentCmd(index, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + return new template_commands_1.BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createEndElement = function() { + return new template_commands_1.EndElementCmd(); + }; + RuntimeCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var nestedTemplateAccessor = this.componentTemplateFactory(directives[0]); + return new template_commands_1.BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), encapsulation, ngContentIndex, nestedTemplateAccessor); + }; + RuntimeCommandFactory.prototype.createEndComponent = function() { + return new template_commands_1.EndComponentCmd(); + }; + RuntimeCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new template_commands_1.EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, this._mapDirectives(directives), isMerged, ngContentIndex, this.changeDetectorFactories[embeddedTemplateIndex], children); + }; + return RuntimeCommandFactory; + })(); + var CodegenCommandFactory = (function() { + function CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactoryExpressions = changeDetectorFactoryExpressions; + } + CodegenCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'TextCmd') + "(" + util_1.escapeSingleQuoteString(value) + ", " + isBound + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'NgContentCmd') + "(" + index + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginElementCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + isBound + ", " + ngContentIndex + ")")); + }; + CodegenCommandFactory.prototype.createEndElement = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndElementCmd') + "()"); + }; + CodegenCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginComponentCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + codeGenViewEncapsulation(encapsulation) + ", " + ngContentIndex + ", " + this.componentTemplateFactory(directives[0]) + ")")); + }; + CodegenCommandFactory.prototype.createEndComponent = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndComponentCmd') + "()"); + }; + CodegenCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EmbeddedTemplateCmd') + "(" + codeGenArray(attrNameAndValues) + ", " + codeGenArray(variableNameAndValues) + ", ") + (codeGenDirectivesArray(directives) + ", " + isMerged + ", " + ngContentIndex + ", " + this.changeDetectorFactoryExpressions[embeddedTemplateIndex] + ", " + codeGenArray(children) + ")")); + }; + return CodegenCommandFactory; + })(); + function visitAndReturnContext(visitor, asts, context) { + template_ast_1.templateVisitAll(visitor, asts, context); + return context; + } + var CommandBuilderVisitor = (function() { + function CommandBuilderVisitor(commandFactory, embeddedTemplateIndex) { + this.commandFactory = commandFactory; + this.embeddedTemplateIndex = embeddedTemplateIndex; + this.result = []; + this.transitiveNgContentCount = 0; + } + CommandBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { + var attrs = keyValueArrayToMap(visitAndReturnContext(this, attrAsts, [])); + directives.forEach(function(directiveMeta) { + collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { + var prevValue = attrs[name]; + attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; + }); + }); + return mapToKeyValueArray(attrs); + }; + CommandBuilderVisitor.prototype.visitNgContent = function(ast, context) { + this.transitiveNgContentCount++; + this.result.push(this.commandFactory.createNgContent(ast.index, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + var _this = this; + this.embeddedTemplateIndex++; + var childVisitor = new CommandBuilderVisitor(this.commandFactory, this.embeddedTemplateIndex); + template_ast_1.templateVisitAll(childVisitor, ast.children); + var isMerged = childVisitor.transitiveNgContentCount > 0; + var variableNameAndValues = []; + ast.vars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR); + }); + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, [], [], directives)); + }); + this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex, this._readAttrNameAndValues(directives, ast.attrs), variableNameAndValues, directives, isMerged, ast.ngContentIndex, childVisitor.result)); + this.transitiveNgContentCount += childVisitor.transitiveNgContentCount; + this.embeddedTemplateIndex = childVisitor.embeddedTemplateIndex; + return null; + }; + CommandBuilderVisitor.prototype.visitElement = function(ast, context) { + var _this = this; + var component = ast.getComponent(); + var eventTargetAndNames = visitAndReturnContext(this, ast.outputs, []); + var variableNameAndValues = []; + if (lang_1.isBlank(component)) { + ast.exportAsVars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(null); + }); + } + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, eventTargetAndNames, variableNameAndValues, directives)); + }); + eventTargetAndNames = removeKeyValueArrayDuplicates(eventTargetAndNames); + var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); + if (lang_1.isPresent(component)) { + this.result.push(this.commandFactory.createBeginComponent(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, component.template.encapsulation, ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndComponent()); + } else { + this.result.push(this.commandFactory.createBeginElement(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, ast.isBound(), ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndElement()); + } + return null; + }; + CommandBuilderVisitor.prototype.visitVariable = function(ast, ctx) { + return null; + }; + CommandBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { + attrNameAndValues.push(ast.name); + attrNameAndValues.push(ast.value); + return null; + }; + CommandBuilderVisitor.prototype.visitBoundText = function(ast, context) { + this.result.push(this.commandFactory.createText(null, true, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitText = function(ast, context) { + this.result.push(this.commandFactory.createText(ast.value, false, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitDirective = function(ast, ctx) { + ctx.targetDirectives.push(ast.directive); + template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.eventTargetAndNames); + ast.exportAsVars.forEach(function(varAst) { + ctx.targetVariableNameAndValues.push(varAst.name); + ctx.targetVariableNameAndValues.push(ctx.index); + }); + return null; + }; + CommandBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { + eventTargetAndNames.push(ast.target); + eventTargetAndNames.push(ast.name); + return null; + }; + CommandBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { + return null; + }; + CommandBuilderVisitor.prototype.visitElementProperty = function(ast, context) { + return null; + }; + return CommandBuilderVisitor; + })(); + function removeKeyValueArrayDuplicates(keyValueArray) { + var knownPairs = new Set(); + var resultKeyValueArray = []; + for (var i = 0; i < keyValueArray.length; i += 2) { + var key = keyValueArray[i]; + var value = keyValueArray[i + 1]; + var pairId = key + ":" + value; + if (!collection_1.SetWrapper.has(knownPairs, pairId)) { + resultKeyValueArray.push(key); + resultKeyValueArray.push(value); + knownPairs.add(pairId); + } + } + return resultKeyValueArray; + } + function keyValueArrayToMap(keyValueArr) { + var data = {}; + for (var i = 0; i < keyValueArr.length; i += 2) { + data[keyValueArr[i]] = keyValueArr[i + 1]; + } + return data; + } + function mapToKeyValueArray(data) { + var entryArray = []; + collection_1.StringMapWrapper.forEach(data, function(value, name) { + entryArray.push([name, value]); + }); + collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + var keyValueArray = []; + entryArray.forEach(function(entry) { + keyValueArray.push(entry[0]); + keyValueArray.push(entry[1]); + }); + return keyValueArray; + } + function mergeAttributeValue(attrName, attrValue1, attrValue2) { + if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { + return attrValue1 + " " + attrValue2; + } else { + return attrValue2; + } + } + var DirectiveContext = (function() { + function DirectiveContext(index, eventTargetAndNames, targetVariableNameAndValues, targetDirectives) { + this.index = index; + this.eventTargetAndNames = eventTargetAndNames; + this.targetVariableNameAndValues = targetVariableNameAndValues; + this.targetDirectives = targetDirectives; + } + return DirectiveContext; + })(); + var Expression = (function() { + function Expression(value) { + this.value = value; + } + return Expression; + })(); + function escapeValue(value) { + if (value instanceof Expression) { + return value.value; + } else if (lang_1.isString(value)) { + return util_1.escapeSingleQuoteString(value); + } else if (lang_1.isBlank(value)) { + return 'null'; + } else { + return "" + value; + } + } + function codeGenArray(data) { + var base = "[" + data.map(escapeValue).join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenDirectivesArray(directives) { + var expressions = directives.map(function(directiveType) { + return ("" + source_module_1.moduleRef(directiveType.type.moduleUrl) + directiveType.type.name); + }); + var base = "[" + expressions.join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenViewEncapsulation(value) { + if (lang_1.IS_DART) { + return "" + exports.TEMPLATE_COMMANDS_MODULE_REF + value; + } else { + return "" + value; + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var HtmlTextAst = (function() { + function HtmlTextAst(value, sourceInfo) { + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlTextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return HtmlTextAst; + })(); + exports.HtmlTextAst = HtmlTextAst; + var HtmlAttrAst = (function() { + function HtmlAttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlAttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return HtmlAttrAst; + })(); + exports.HtmlAttrAst = HtmlAttrAst; + var HtmlElementAst = (function() { + function HtmlElementAst(name, attrs, children, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.children = children; + this.sourceInfo = sourceInfo; + } + HtmlElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + return HtmlElementAst; + })(); + exports.HtmlElementAst = HtmlElementAst; + function htmlVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.htmlVisitAll = htmlVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var NG_CONTENT_SELECT_ATTR = 'select'; + var NG_CONTENT_ELEMENT = 'ng-content'; + var LINK_ELEMENT = 'link'; + var LINK_STYLE_REL_ATTR = 'rel'; + var LINK_STYLE_HREF_ATTR = 'href'; + var LINK_STYLE_REL_VALUE = 'stylesheet'; + var STYLE_ELEMENT = 'style'; + var SCRIPT_ELEMENT = 'script'; + var NG_NON_BINDABLE_ATTR = 'ng-non-bindable'; + function preparseElement(ast) { + var selectAttr = null; + var hrefAttr = null; + var relAttr = null; + var nonBindable = false; + ast.attrs.forEach(function(attr) { + if (attr.name == NG_CONTENT_SELECT_ATTR) { + selectAttr = attr.value; + } else if (attr.name == LINK_STYLE_HREF_ATTR) { + hrefAttr = attr.value; + } else if (attr.name == LINK_STYLE_REL_ATTR) { + relAttr = attr.value; + } else if (attr.name == NG_NON_BINDABLE_ATTR) { + nonBindable = true; + } + }); + selectAttr = normalizeNgContentSelect(selectAttr); + var nodeName = ast.name; + var type = PreparsedElementType.OTHER; + if (nodeName == NG_CONTENT_ELEMENT) { + type = PreparsedElementType.NG_CONTENT; + } else if (nodeName == STYLE_ELEMENT) { + type = PreparsedElementType.STYLE; + } else if (nodeName == SCRIPT_ELEMENT) { + type = PreparsedElementType.SCRIPT; + } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { + type = PreparsedElementType.STYLESHEET; + } + return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable); + } + exports.preparseElement = preparseElement; + (function(PreparsedElementType) { + PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; + PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; + PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; + PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; + PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; + })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); + var PreparsedElementType = exports.PreparsedElementType; + var PreparsedElement = (function() { + function PreparsedElement(type, selectAttr, hrefAttr, nonBindable) { + this.type = type; + this.selectAttr = selectAttr; + this.hrefAttr = hrefAttr; + this.nonBindable = nonBindable; + } + return PreparsedElement; + })(); + exports.PreparsedElement = PreparsedElement; + function normalizeNgContentSelect(selectAttr) { + if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { + return '*'; + } + return selectAttr; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var TemplateNormalizer = (function() { + function TemplateNormalizer(_xhr, _urlResolver, _domParser) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._domParser = _domParser; + } + TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { + var _this = this; + if (lang_1.isPresent(template.template)) { + return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); + } else if (lang_1.isPresent(template.templateUrl)) { + var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); + return this._xhr.get(sourceAbsUrl).then(function(templateContent) { + return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); + }); + } else { + throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); + } + }; + TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { + var _this = this; + var domNodes = this._domParser.parse(template, directiveType.name); + var visitor = new TemplatePreparseVisitor(); + html_ast_1.htmlVisitAll(visitor, domNodes); + var allStyles = templateMeta.styles.concat(visitor.styles); + var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(templateAbsUrl, url); + }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(directiveType.moduleUrl, url); + })); + var allResolvedStyles = allStyles.map(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); + styleWithImports.styleUrls.forEach(function(styleUrl) { + return allStyleAbsUrls.push(styleUrl); + }); + return styleWithImports.style; + }); + var encapsulation = templateMeta.encapsulation; + if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { + encapsulation = view_1.ViewEncapsulation.None; + } + return new directive_metadata_1.CompileTemplateMetadata({ + encapsulation: encapsulation, + template: template, + templateUrl: templateAbsUrl, + styles: allResolvedStyles, + styleUrls: allStyleAbsUrls, + ngContentSelectors: visitor.ngContentSelectors + }); + }; + TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); + return TemplateNormalizer; + })(); + exports.TemplateNormalizer = TemplateNormalizer; + var TemplatePreparseVisitor = (function() { + function TemplatePreparseVisitor() { + this.ngContentSelectors = []; + this.styles = []; + this.styleUrls = []; + this.ngNonBindableStackCount = 0; + } + TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { + var preparsedElement = template_preparser_1.preparseElement(ast); + switch (preparsedElement.type) { + case template_preparser_1.PreparsedElementType.NG_CONTENT: + if (this.ngNonBindableStackCount === 0) { + this.ngContentSelectors.push(preparsedElement.selectAttr); + } + break; + case template_preparser_1.PreparsedElementType.STYLE: + var textContent = ''; + ast.children.forEach(function(child) { + if (child instanceof html_ast_1.HtmlTextAst) { + textContent += child.value; + } + }); + this.styles.push(textContent); + break; + case template_preparser_1.PreparsedElementType.STYLESHEET: + this.styleUrls.push(preparsedElement.hrefAttr); + break; + } + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount++; + } + html_ast_1.htmlVisitAll(this, ast.children); + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount--; + } + return null; + }; + TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + TemplatePreparseVisitor.prototype.visitText = function(ast, context) { + return null; + }; + return TemplatePreparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cpl = require("angular2/src/compiler/directive_metadata"); + var md = require("angular2/src/core/metadata/directives"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var di_2 = require("angular2/src/core/di"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var util_1 = require("angular2/src/compiler/util"); + var RuntimeMetadataResolver = (function() { + function RuntimeMetadataResolver(_directiveResolver, _viewResolver, _platformDirectives) { + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._platformDirectives = _platformDirectives; + this._cache = new Map(); + } + RuntimeMetadataResolver.prototype.getMetadata = function(directiveType) { + var meta = this._cache.get(directiveType); + if (lang_1.isBlank(meta)) { + var dirMeta = this._directiveResolver.resolve(directiveType); + var moduleUrl = calcModuleUrl(directiveType, dirMeta); + var templateMeta = null; + var changeDetectionStrategy = null; + if (dirMeta instanceof md.ComponentMetadata) { + var cmpMeta = dirMeta; + var viewMeta = this._viewResolver.resolve(directiveType); + templateMeta = new cpl.CompileTemplateMetadata({ + encapsulation: viewMeta.encapsulation, + template: viewMeta.template, + templateUrl: viewMeta.templateUrl, + styles: viewMeta.styles, + styleUrls: viewMeta.styleUrls + }); + changeDetectionStrategy = cmpMeta.changeDetection; + } + meta = cpl.CompileDirectiveMetadata.create({ + selector: dirMeta.selector, + exportAs: dirMeta.exportAs, + isComponent: lang_1.isPresent(templateMeta), + dynamicLoadable: true, + type: new cpl.CompileTypeMetadata({ + name: lang_1.stringify(directiveType), + moduleUrl: moduleUrl, + runtime: directiveType + }), + template: templateMeta, + changeDetection: changeDetectionStrategy, + inputs: dirMeta.inputs, + outputs: dirMeta.outputs, + host: dirMeta.host, + lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { + return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); + }) + }); + this._cache.set(directiveType, meta); + } + return meta; + }; + RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { + var _this = this; + var view = this._viewResolver.resolve(component); + var directives = flattenDirectives(view, this._platformDirectives); + for (var i = 0; i < directives.length; i++) { + if (!isValidDirective(directives[i])) { + throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); + } + } + return removeDuplicates(directives).map(function(type) { + return _this.getMetadata(type); + }); + }; + RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(2, di_2.Optional()), __param(2, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, Array])], RuntimeMetadataResolver); + return RuntimeMetadataResolver; + })(); + exports.RuntimeMetadataResolver = RuntimeMetadataResolver; + function removeDuplicates(items) { + var m = new Map(); + items.forEach(function(i) { + return m.set(i, null); + }); + return collection_1.MapWrapper.keys(m); + } + function flattenDirectives(view, platformDirectives) { + var directives = []; + if (lang_1.isPresent(platformDirectives)) { + flattenArray(platformDirectives, directives); + } + if (lang_1.isPresent(view.directives)) { + flattenArray(view.directives, directives); + } + return directives; + } + function flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + flattenArray(item, out); + } else { + out.push(item); + } + } + } + function isValidDirective(value) { + return lang_1.isPresent(value) && (value instanceof lang_1.Type); + } + function calcModuleUrl(type, dirMeta) { + if (lang_1.isPresent(dirMeta.moduleId)) { + return "package:" + dirMeta.moduleId + util_1.MODULE_SUFFIX; + } else { + return reflection_1.reflector.importUri(type); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var promise_1 = require("angular2/src/facade/promise"); + var lang_1 = require("angular2/src/facade/lang"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var XHRImpl = (function(_super) { + __extends(XHRImpl, _super); + function XHRImpl() { + _super.apply(this, arguments); + } + XHRImpl.prototype.get = function(url) { + var completer = promise_1.PromiseWrapper.completer(); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'text'; + xhr.onload = function() { + var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + if (200 <= status && status <= 300) { + completer.resolve(response); + } else { + completer.reject("Failed to load " + url, null); + } + }; + xhr.onerror = function() { + completer.reject("Failed to load " + url, null); + }; + xhr.send(); + return completer.promise; + }; + return XHRImpl; + })(xhr_1.XHR); + exports.XHRImpl = XHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/key_events", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var di_1 = require("angular2/src/core/di"); + var modifierKeys = ['alt', 'control', 'meta', 'shift']; + var modifierKeyGetters = { + 'alt': function(event) { + return event.altKey; + }, + 'control': function(event) { + return event.ctrlKey; + }, + 'meta': function(event) { + return event.metaKey; + }, + 'shift': function(event) { + return event.shiftKey; + } + }; + var KeyEventsPlugin = (function(_super) { + __extends(KeyEventsPlugin, _super); + function KeyEventsPlugin() { + _super.call(this); + } + KeyEventsPlugin.prototype.supports = function(eventName) { + return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); + }; + KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var parsedEvent = KeyEventsPlugin.parseEventName(eventName); + var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); + }); + }; + KeyEventsPlugin.parseEventName = function(eventName) { + var parts = eventName.toLowerCase().split('.'); + var domEventName = parts.shift(); + if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { + return null; + } + var key = KeyEventsPlugin._normalizeKey(parts.pop()); + var fullKey = ''; + modifierKeys.forEach(function(modifierName) { + if (collection_1.ListWrapper.contains(parts, modifierName)) { + collection_1.ListWrapper.remove(parts, modifierName); + fullKey += modifierName + '.'; + } + }); + fullKey += key; + if (parts.length != 0 || key.length === 0) { + return null; + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); + collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); + return result; + }; + KeyEventsPlugin.getEventFullKey = function(event) { + var fullKey = ''; + var key = dom_adapter_1.DOM.getEventKey(event); + key = key.toLowerCase(); + if (lang_1.StringWrapper.equals(key, ' ')) { + key = 'space'; + } else if (lang_1.StringWrapper.equals(key, '.')) { + key = 'dot'; + } + modifierKeys.forEach(function(modifierName) { + if (modifierName != key) { + var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); + if (modifierGetter(event)) { + fullKey += modifierName + '.'; + } + } + }); + fullKey += key; + return fullKey; + }; + KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { + return function(event) { + if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { + zone.run(function() { + return handler(event); + }); + } + }; + }; + KeyEventsPlugin._normalizeKey = function(keyName) { + switch (keyName) { + case 'esc': + return 'escape'; + default: + return keyName; + } + }; + KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); + return KeyEventsPlugin; + })(event_manager_1.EventManagerPlugin); + exports.KeyEventsPlugin = KeyEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_common", ["angular2/src/core/render/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var collection_1 = require("angular2/src/facade/collection"); + var _eventNames = { + 'pan': true, + 'panstart': true, + 'panmove': true, + 'panend': true, + 'pancancel': true, + 'panleft': true, + 'panright': true, + 'panup': true, + 'pandown': true, + 'pinch': true, + 'pinchstart': true, + 'pinchmove': true, + 'pinchend': true, + 'pinchcancel': true, + 'pinchin': true, + 'pinchout': true, + 'press': true, + 'pressup': true, + 'rotate': true, + 'rotatestart': true, + 'rotatemove': true, + 'rotateend': true, + 'rotatecancel': true, + 'swipe': true, + 'swipeleft': true, + 'swiperight': true, + 'swipeup': true, + 'swipedown': true, + 'tap': true + }; + var HammerGesturesPluginCommon = (function(_super) { + __extends(HammerGesturesPluginCommon, _super); + function HammerGesturesPluginCommon() { + _super.call(this); + } + HammerGesturesPluginCommon.prototype.supports = function(eventName) { + eventName = eventName.toLowerCase(); + return collection_1.StringMapWrapper.contains(_eventNames, eventName); + }; + return HammerGesturesPluginCommon; + })(event_manager_1.EventManagerPlugin); + exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_bindings", ["angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + exports.EXCEPTION_PROVIDER = di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(dom_adapter_1.DOM, false); + }, + deps: [] + }); + exports.EXCEPTION_BINDING = exports.EXCEPTION_PROVIDER; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function wtfInit() {} + exports.wtfInit = wtfInit; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/bootstrap", ["angular2/src/core/application"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var application_1 = require("angular2/src/core/application"); + exports.bootstrap = application_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services/title", ["angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Title = (function() { + function Title() {} + Title.prototype.getTitle = function() { + return dom_adapter_1.DOM.getTitle(); + }; + Title.prototype.setTitle = function(newTitle) { + dom_adapter_1.DOM.setTitle(newTitle); + }; + return Title; + })(); + exports.Title = Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_1 = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var DebugElement = (function() { + function DebugElement() {} + Object.defineProperty(DebugElement.prototype, "componentInstance", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "elementRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "componentViewChildren", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + DebugElement.prototype.query = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var results = this.queryAll(predicate, scope); + return results.length > 0 ? results[0] : null; + }; + DebugElement.prototype.queryAll = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var elementsInScope = scope(this); + return elementsInScope.filter(predicate); + }; + return DebugElement; + })(); + exports.DebugElement = DebugElement; + var DebugElement_ = (function(_super) { + __extends(DebugElement_, _super); + function DebugElement_(_parentView, _boundElementIndex) { + _super.call(this); + this._parentView = _parentView; + this._boundElementIndex = _boundElementIndex; + this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex]; + } + Object.defineProperty(DebugElement_.prototype, "componentInstance", { + get: function() { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.getComponent(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "nativeElement", { + get: function() { + return this.elementRef.nativeElement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "elementRef", { + get: function() { + return this._parentView.elementRefs[this._boundElementIndex]; + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.getDirectiveInstance = function(directiveIndex) { + return this._elementInjector.getDirectiveAtIndex(directiveIndex); + }; + Object.defineProperty(DebugElement_.prototype, "children", { + get: function() { + return this._getChildElements(this._parentView, this._boundElementIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "componentViewChildren", { + get: function() { + var shadowView = this._parentView.getNestedView(this._boundElementIndex); + if (!lang_1.isPresent(shadowView) || shadowView.proto.type !== view_1.ViewType.COMPONENT) { + return []; + } + return this._getChildElements(shadowView, null); + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.triggerEventHandler = function(eventName, eventObj) { + this._parentView.triggerEventHandlers(eventName, eventObj, this._boundElementIndex); + }; + DebugElement_.prototype.hasDirective = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return false; + } + return this._elementInjector.hasDirective(type); + }; + DebugElement_.prototype.inject = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.get(type); + }; + DebugElement_.prototype.getLocal = function(name) { + return this._parentView.locals.get(name); + }; + DebugElement_.prototype._getChildElements = function(view, parentBoundElementIndex) { + var _this = this; + var els = []; + var parentElementBinder = null; + if (lang_1.isPresent(parentBoundElementIndex)) { + parentElementBinder = view.proto.elementBinders[parentBoundElementIndex - view.elementOffset]; + } + for (var i = 0; i < view.proto.elementBinders.length; ++i) { + var binder = view.proto.elementBinders[i]; + if (binder.parent == parentElementBinder) { + els.push(new DebugElement_(view, view.elementOffset + i)); + var views = view.viewContainers[view.elementOffset + i]; + if (lang_1.isPresent(views)) { + views.views.forEach(function(nextView) { + els = els.concat(_this._getChildElements(nextView, null)); + }); + } + } + } + return els; + }; + return DebugElement_; + })(DebugElement); + exports.DebugElement_ = DebugElement_; + function inspectElement(elementRef) { + return new DebugElement_(view_ref_1.internalView(elementRef.parentView), elementRef.boundElementIndex); + } + exports.inspectElement = inspectElement; + function asNativeElements(arr) { + return arr.map(function(debugEl) { + return debugEl.nativeElement; + }); + } + exports.asNativeElements = asNativeElements; + var Scope = (function() { + function Scope() {} + Scope.all = function(debugElement) { + var scope = []; + scope.push(debugElement); + debugElement.children.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + debugElement.componentViewChildren.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + return scope; + }; + Scope.light = function(debugElement) { + var scope = []; + debugElement.children.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + Scope.view = function(debugElement) { + var scope = []; + debugElement.componentViewChildren.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + return Scope; + })(); + exports.Scope = Scope; + var By = (function() { + function By() {} + By.all = function() { + return function(debugElement) { + return true; + }; + }; + By.css = function(selector) { + return function(debugElement) { + return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; + }; + }; + By.directive = function(type) { + return function(debugElement) { + return debugElement.hasDirective(type); + }; + }; + return By; + })(); + exports.By = By; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element_view_listener", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/linker/view_listener", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/api", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var api_1 = require("angular2/src/core/render/api"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var NG_ID_PROPERTY = 'ngid'; + var INSPECT_GLOBAL_NAME = 'ng.probe'; + var NG_ID_SEPARATOR = '#'; + var _allIdsByView = new collection_1.Map(); + var _allViewsById = new collection_1.Map(); + var _nextId = 0; + function _setElementId(element, indices) { + if (lang_1.isPresent(element)) { + dom_adapter_1.DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); + } + } + function _getElementId(element) { + var elId = dom_adapter_1.DOM.getData(element, NG_ID_PROPERTY); + if (lang_1.isPresent(elId)) { + return elId.split(NG_ID_SEPARATOR).map(function(partStr) { + return lang_1.NumberWrapper.parseInt(partStr, 10); + }); + } else { + return null; + } + } + function inspectNativeElement(element) { + var elId = _getElementId(element); + if (lang_1.isPresent(elId)) { + var view = _allViewsById.get(elId[0]); + if (lang_1.isPresent(view)) { + return new debug_element_1.DebugElement_(view, elId[1]); + } + } + return null; + } + exports.inspectNativeElement = inspectNativeElement; + var DebugElementViewListener = (function() { + function DebugElementViewListener(_renderer) { + this._renderer = _renderer; + dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); + } + DebugElementViewListener.prototype.onViewCreated = function(view) { + var viewId = _nextId++; + _allViewsById.set(viewId, view); + _allIdsByView.set(view, viewId); + for (var i = 0; i < view.elementRefs.length; i++) { + var el = view.elementRefs[i]; + _setElementId(this._renderer.getNativeElementSync(el), [viewId, i]); + } + }; + DebugElementViewListener.prototype.onViewDestroyed = function(view) { + var viewId = _allIdsByView.get(view); + _allIdsByView.delete(view); + _allViewsById.delete(viewId); + }; + DebugElementViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [api_1.Renderer])], DebugElementViewListener); + return DebugElementViewListener; + })(); + exports.DebugElementViewListener = DebugElementViewListener; + exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([DebugElementViewListener, lang_1.CONST_EXPR(new di_1.Provider(view_listener_1.AppViewListener, {useExisting: DebugElementViewListener}))]); + exports.ELEMENT_PROBE_BINDINGS = exports.ELEMENT_PROBE_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.enableDevMode = lang_1.enableDevMode; + global.define = __define; + return module.exports; +}); + +System.register("angular2/profile", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var profile_1 = require("angular2/src/core/profile/profile"); + exports.wtfCreateScope = profile_1.wtfCreateScope; + exports.wtfLeave = profile_1.wtfLeave; + exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; + exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/lifecycle_hooks", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/bootstrap", ["angular2/src/core/bootstrap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var bootstrap_1 = require("angular2/src/core/bootstrap"); + exports.bootstrap = bootstrap_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/metadata", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var COMPONENT_SELECTOR = /^[\w|-]*$/; + var SKEWER_CASE = /-(\w)/g; + var directiveResolver = new angular2_1.DirectiveResolver(); + function getComponentInfo(type) { + var resolvedMetadata = directiveResolver.resolve(type); + var selector = resolvedMetadata.selector; + if (!selector.match(COMPONENT_SELECTOR)) { + throw new Error('Only selectors matching element names are supported, got: ' + selector); + } + var selector = selector.replace(SKEWER_CASE, function(all, letter) { + return letter.toUpperCase(); + }); + return { + type: type, + selector: selector, + inputs: parseFields(resolvedMetadata.inputs), + outputs: parseFields(resolvedMetadata.outputs) + }; + } + exports.getComponentInfo = getComponentInfo; + function parseFields(names) { + var attrProps = []; + if (names) { + for (var i = 0; i < names.length; i++) { + var parts = names[i].split(':'); + var prop = parts[0].trim(); + var attr = (parts[1] || parts[0]).trim(); + var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1); + attrProps.push({ + prop: prop, + attr: attr, + bracketAttr: "[" + attr + "]", + parenAttr: "(" + attr + ")", + bracketParenAttr: "[(" + attr + ")]", + onAttr: "on" + capitalAttr, + bindAttr: "bind" + capitalAttr, + bindonAttr: "bindon" + capitalAttr + }); + } + } + return attrProps; + } + exports.parseFields = parseFields; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function stringify(obj) { + if (typeof obj == 'function') + return obj.name || obj.toString(); + return '' + obj; + } + exports.stringify = stringify; + function onError(e) { + console.log(e, e.stack); + throw e; + } + exports.onError = onError; + function controllerKey(name) { + return '$' + name + 'Controller'; + } + exports.controllerKey = controllerKey; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager'; + exports.NG2_COMPILER = 'ng2.Compiler'; + exports.NG2_INJECTOR = 'ng2.Injector'; + exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap'; + exports.NG2_ZONE = 'ng2.NgZone'; + exports.NG1_CONTROLLER = '$controller'; + exports.NG1_SCOPE = '$scope'; + exports.NG1_ROOT_SCOPE = '$rootScope'; + exports.NG1_COMPILE = '$compile'; + exports.NG1_HTTP_BACKEND = '$httpBackend'; + exports.NG1_INJECTOR = '$injector'; + exports.NG1_PARSE = '$parse'; + exports.NG1_TEMPLATE_CACHE = '$templateCache'; + exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/angular2", "angular2/src/upgrade/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var DowngradeNg2ComponentAdapter = (function() { + function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) { + this.id = id; + this.info = info; + this.element = element; + this.attrs = attrs; + this.scope = scope; + this.parentInjector = parentInjector; + this.parse = parse; + this.viewManager = viewManager; + this.protoView = protoView; + this.component = null; + this.inputChangeCount = 0; + this.inputChanges = null; + this.hostViewRef = null; + this.changeDetector = null; + this.contentInserctionPoint = null; + this.element[0].id = id; + this.componentScope = scope.$new(); + this.childNodes = element.contents(); + } + DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() { + var childInjector = this.parentInjector.resolveAndCreateChild([angular2_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]); + this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector); + var renderer = this.hostViewRef.render; + var hostElement = this.viewManager.getHostElement(this.hostViewRef); + this.changeDetector = this.hostViewRef.changeDetectorRef; + this.component = this.viewManager.getComponent(hostElement); + this.contentInserctionPoint = renderer.rootContentInsertionPoints[0]; + }; + DowngradeNg2ComponentAdapter.prototype.setupInputs = function() { + var _this = this; + var attrs = this.attrs; + var inputs = this.info.inputs; + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + var expr = null; + if (attrs.hasOwnProperty(input.attr)) { + var observeFn = (function(prop) { + var prevValue = INITIAL_VALUE; + return function(value) { + if (_this.inputChanges !== null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue); + prevValue = value; + } + _this.component[prop] = value; + }; + })(input.prop); + attrs.$observe(input.attr, observeFn); + } else if (attrs.hasOwnProperty(input.bindAttr)) { + expr = attrs[input.bindAttr]; + } else if (attrs.hasOwnProperty(input.bracketAttr)) { + expr = attrs[input.bracketAttr]; + } else if (attrs.hasOwnProperty(input.bindonAttr)) { + expr = attrs[input.bindonAttr]; + } else if (attrs.hasOwnProperty(input.bracketParenAttr)) { + expr = attrs[input.bracketParenAttr]; + } + if (expr != null) { + var watchFn = (function(prop) { + return function(value, prevValue) { + if (_this.inputChanges != null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(prevValue, value); + } + _this.component[prop] = value; + }; + })(input.prop); + this.componentScope.$watch(expr, watchFn); + } + } + var prototype = this.info.type.prototype; + if (prototype && prototype.onChanges) { + this.inputChanges = {}; + this.componentScope.$watch(function() { + return _this.inputChangeCount; + }, function() { + var inputChanges = _this.inputChanges; + _this.inputChanges = {}; + _this.component.onChanges(inputChanges); + }); + } + this.componentScope.$watch(function() { + return _this.changeDetector && _this.changeDetector.detectChanges(); + }); + }; + DowngradeNg2ComponentAdapter.prototype.projectContent = function() { + var childNodes = this.childNodes; + if (this.contentInserctionPoint) { + var parent = this.contentInserctionPoint.parentNode; + for (var i = 0, + ii = childNodes.length; i < ii; i++) { + parent.insertBefore(childNodes[i], this.contentInserctionPoint); + } + } + }; + DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() { + var _this = this; + var attrs = this.attrs; + var outputs = this.info.outputs; + for (var j = 0; j < outputs.length; j++) { + var output = outputs[j]; + var expr = null; + var assignExpr = false; + var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null; + var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null; + if (attrs.hasOwnProperty(output.onAttr)) { + expr = attrs[output.onAttr]; + } else if (attrs.hasOwnProperty(output.parenAttr)) { + expr = attrs[output.parenAttr]; + } else if (attrs.hasOwnProperty(bindonAttr)) { + expr = attrs[bindonAttr]; + assignExpr = true; + } else if (attrs.hasOwnProperty(bracketParenAttr)) { + expr = attrs[bracketParenAttr]; + assignExpr = true; + } + if (expr != null && assignExpr != null) { + var getter = this.parse(expr); + var setter = getter.assign; + if (assignExpr && !setter) { + throw new Error("Expression '" + expr + "' is not assignable!"); + } + var emitter = this.component[output.prop]; + if (emitter) { + emitter.subscribe({next: assignExpr ? (function(setter) { + return function(value) { + return setter(_this.scope, value); + }; + })(setter) : (function(getter) { + return function(value) { + return getter(_this.scope, {$event: value}); + }; + })(getter)}); + } else { + throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!"); + } + } + } + }; + DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() { + var _this = this; + this.element.bind('$remove', function() { + return _this.viewManager.destroyRootHostView(_this.hostViewRef); + }); + }; + return DowngradeNg2ComponentAdapter; + })(); + exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter; + var Ng1Change = (function() { + function Ng1Change(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + Ng1Change.prototype.isFirstChange = function() { + return this.previousValue === this.currentValue; + }; + return Ng1Change; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function noNg() { + throw new Error('AngularJS v1.x is not loaded!'); + } + var angular = { + bootstrap: noNg, + module: noNg, + element: noNg, + version: noNg + }; + try { + if (window.hasOwnProperty('angular')) { + angular = window.angular; + } + } catch (e) {} + exports.bootstrap = angular.bootstrap; + exports.module = angular.module; + exports.element = angular.element; + exports.version = angular.version; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/instruction", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var RouteParams = (function() { + function RouteParams(params) { + this.params = params; + } + RouteParams.prototype.get = function(param) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.params, param)); + }; + return RouteParams; + })(); + exports.RouteParams = RouteParams; + var RouteData = (function() { + function RouteData(data) { + if (data === void 0) { + data = lang_1.CONST_EXPR({}); + } + this.data = data; + } + RouteData.prototype.get = function(key) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.data, key)); + }; + return RouteData; + })(); + exports.RouteData = RouteData; + var BLANK_ROUTE_DATA = new RouteData(); + var Instruction = (function() { + function Instruction(component, child, auxInstruction) { + this.component = component; + this.child = child; + this.auxInstruction = auxInstruction; + } + Instruction.prototype.replaceChild = function(child) { + return new Instruction(this.component, child, this.auxInstruction); + }; + return Instruction; + })(); + exports.Instruction = Instruction; + var PrimaryInstruction = (function() { + function PrimaryInstruction(component, child, auxUrls) { + this.component = component; + this.child = child; + this.auxUrls = auxUrls; + } + return PrimaryInstruction; + })(); + exports.PrimaryInstruction = PrimaryInstruction; + function stringifyInstruction(instruction) { + return stringifyInstructionPath(instruction) + stringifyInstructionQuery(instruction); + } + exports.stringifyInstruction = stringifyInstruction; + function stringifyInstructionPath(instruction) { + return instruction.component.urlPath + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + exports.stringifyInstructionPath = stringifyInstructionPath; + function stringifyInstructionQuery(instruction) { + return instruction.component.urlParams.length > 0 ? ('?' + instruction.component.urlParams.join('&')) : ''; + } + exports.stringifyInstructionQuery = stringifyInstructionQuery; + function stringifyPrimaryPrefixed(instruction) { + var primary = stringifyPrimary(instruction); + if (primary.length > 0) { + primary = '/' + primary; + } + return primary; + } + function stringifyPrimary(instruction) { + if (lang_1.isBlank(instruction)) { + return ''; + } + var params = instruction.component.urlParams.length > 0 ? (';' + instruction.component.urlParams.join(';')) : ''; + return instruction.component.urlPath + params + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + function stringifyAux(instruction) { + var routes = []; + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(auxInstruction, _) { + routes.push(stringifyPrimary(auxInstruction)); + }); + if (routes.length > 0) { + return '(' + routes.join('//') + ')'; + } + return ''; + } + var ComponentInstruction = (function() { + function ComponentInstruction() { + this.reuse = false; + } + Object.defineProperty(ComponentInstruction.prototype, "componentType", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "specificity", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "terminal", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "routeData", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ComponentInstruction; + })(); + exports.ComponentInstruction = ComponentInstruction; + var ComponentInstruction_ = (function(_super) { + __extends(ComponentInstruction_, _super); + function ComponentInstruction_(urlPath, urlParams, _recognizer, params) { + if (params === void 0) { + params = null; + } + _super.call(this); + this._recognizer = _recognizer; + this.urlPath = urlPath; + this.urlParams = urlParams; + this.params = params; + if (lang_1.isPresent(this._recognizer.handler.data)) { + this._routeData = new RouteData(this._recognizer.handler.data); + } else { + this._routeData = BLANK_ROUTE_DATA; + } + } + Object.defineProperty(ComponentInstruction_.prototype, "componentType", { + get: function() { + return this._recognizer.handler.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentInstruction_.prototype.resolveComponentType = function() { + return this._recognizer.handler.resolveComponentType(); + }; + Object.defineProperty(ComponentInstruction_.prototype, "specificity", { + get: function() { + return this._recognizer.specificity; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "terminal", { + get: function() { + return this._recognizer.terminal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "routeData", { + get: function() { + return this._routeData; + }, + enumerable: true, + configurable: true + }); + return ComponentInstruction_; + })(ComponentInstruction); + exports.ComponentInstruction_ = ComponentInstruction_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteLifecycleHook = (function() { + function RouteLifecycleHook(name) { + this.name = name; + } + RouteLifecycleHook = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], RouteLifecycleHook); + return RouteLifecycleHook; + })(); + exports.RouteLifecycleHook = RouteLifecycleHook; + var CanActivate = (function() { + function CanActivate(fn) { + this.fn = fn; + } + CanActivate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Function])], CanActivate); + return CanActivate; + })(); + exports.CanActivate = CanActivate; + exports.canReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("canReuse")); + exports.canDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("canDeactivate")); + exports.onActivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onActivate")); + exports.onReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("onReuse")); + exports.onDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onDeactivate")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations", ["angular2/src/core/util/decorators", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/router/lifecycle_annotations_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var lifecycle_annotations_impl_2 = require("angular2/src/router/lifecycle_annotations_impl"); + exports.canReuse = lifecycle_annotations_impl_2.canReuse; + exports.canDeactivate = lifecycle_annotations_impl_2.canDeactivate; + exports.onActivate = lifecycle_annotations_impl_2.onActivate; + exports.onReuse = lifecycle_annotations_impl_2.onReuse; + exports.onDeactivate = lifecycle_annotations_impl_2.onDeactivate; + exports.CanActivate = decorators_1.makeDecorator(lifecycle_annotations_impl_1.CanActivate); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location_strategy", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var LocationStrategy = (function() { + function LocationStrategy() {} + return LocationStrategy; + })(); + exports.LocationStrategy = LocationStrategy; + function normalizeQueryParams(params) { + return (params.length > 0 && params.substring(0, 1) != '?') ? ('?' + params) : params; + } + exports.normalizeQueryParams = normalizeQueryParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/url_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Url = (function() { + function Url(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + this.path = path; + this.child = child; + this.auxiliary = auxiliary; + this.params = params; + } + Url.prototype.toString = function() { + return this.path + this._matrixParamsToString() + this._auxToString() + this._childString(); + }; + Url.prototype.segmentToString = function() { + return this.path + this._matrixParamsToString(); + }; + Url.prototype._auxToString = function() { + return this.auxiliary.length > 0 ? ('(' + this.auxiliary.map(function(sibling) { + return sibling.toString(); + }).join('//') + ')') : ''; + }; + Url.prototype._matrixParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return ';' + serializeParams(this.params).join(';'); + }; + Url.prototype._childString = function() { + return lang_1.isPresent(this.child) ? ('/' + this.child.toString()) : ''; + }; + return Url; + })(); + exports.Url = Url; + var RootUrl = (function(_super) { + __extends(RootUrl, _super); + function RootUrl(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + _super.call(this, path, child, auxiliary, params); + } + RootUrl.prototype.toString = function() { + return this.path + this._auxToString() + this._childString() + this._queryParamsToString(); + }; + RootUrl.prototype.segmentToString = function() { + return this.path + this._queryParamsToString(); + }; + RootUrl.prototype._queryParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return '?' + serializeParams(this.params).join('&'); + }; + return RootUrl; + })(Url); + exports.RootUrl = RootUrl; + function pathSegmentsToUrl(pathSegments) { + var url = new Url(pathSegments[pathSegments.length - 1]); + for (var i = pathSegments.length - 2; i >= 0; i -= 1) { + url = new Url(pathSegments[i], url); + } + return url; + } + exports.pathSegmentsToUrl = pathSegmentsToUrl; + var SEGMENT_RE = lang_1.RegExpWrapper.create('^[^\\/\\(\\)\\?;=&#]+'); + function matchUrlSegment(str) { + var match = lang_1.RegExpWrapper.firstMatch(SEGMENT_RE, str); + return lang_1.isPresent(match) ? match[0] : ''; + } + var UrlParser = (function() { + function UrlParser() {} + UrlParser.prototype.peekStartsWith = function(str) { + return this._remaining.startsWith(str); + }; + UrlParser.prototype.capture = function(str) { + if (!this._remaining.startsWith(str)) { + throw new exceptions_1.BaseException("Expected \"" + str + "\"."); + } + this._remaining = this._remaining.substring(str.length); + }; + UrlParser.prototype.parse = function(url) { + this._remaining = url; + if (url == '' || url == '/') { + return new Url(''); + } + return this.parseRoot(); + }; + UrlParser.prototype.parseRoot = function() { + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + if (this.peekStartsWith(';')) { + this.parseMatrixParams(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + var queryParams = null; + if (this.peekStartsWith('?')) { + queryParams = this.parseQueryParams(); + } + return new RootUrl(path, child, aux, queryParams); + }; + UrlParser.prototype.parseSegment = function() { + if (this._remaining.length == 0) { + return null; + } + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var matrixParams = null; + if (this.peekStartsWith(';')) { + matrixParams = this.parseMatrixParams(); + } + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + return new Url(path, child, aux, matrixParams); + }; + UrlParser.prototype.parseQueryParams = function() { + var params = {}; + this.capture('?'); + this.parseParam(params); + while (this._remaining.length > 0 && this.peekStartsWith('&')) { + this.capture('&'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseMatrixParams = function() { + var params = {}; + while (this._remaining.length > 0 && this.peekStartsWith(';')) { + this.capture(';'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseParam = function(params) { + var key = matchUrlSegment(this._remaining); + if (lang_1.isBlank(key)) { + return ; + } + this.capture(key); + var value = true; + if (this.peekStartsWith('=')) { + this.capture('='); + var valueMatch = matchUrlSegment(this._remaining); + if (lang_1.isPresent(valueMatch)) { + value = valueMatch; + this.capture(value); + } + } + params[key] = value; + }; + UrlParser.prototype.parseAuxiliaryRoutes = function() { + var routes = []; + this.capture('('); + while (!this.peekStartsWith(')') && this._remaining.length > 0) { + routes.push(this.parseSegment()); + if (this.peekStartsWith('//')) { + this.capture('//'); + } + } + this.capture(')'); + return routes; + }; + return UrlParser; + })(); + exports.UrlParser = UrlParser; + exports.parser = new UrlParser(); + function serializeParams(paramMap) { + var params = []; + if (lang_1.isPresent(paramMap)) { + collection_1.StringMapWrapper.forEach(paramMap, function(value, key) { + if (value == true) { + params.push(key); + } else { + params.push(key + '=' + value); + } + }); + } + return params; + } + exports.serializeParams = serializeParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteConfig = (function() { + function RouteConfig(configs) { + this.configs = configs; + } + RouteConfig = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array])], RouteConfig); + return RouteConfig; + })(); + exports.RouteConfig = RouteConfig; + var Route = (function() { + function Route(_a) { + var path = _a.path, + component = _a.component, + name = _a.name, + data = _a.data; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + this.data = data; + } + Route = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Route); + return Route; + })(); + exports.Route = Route; + var AuxRoute = (function() { + function AuxRoute(_a) { + var path = _a.path, + component = _a.component, + name = _a.name; + this.data = null; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + } + AuxRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AuxRoute); + return AuxRoute; + })(); + exports.AuxRoute = AuxRoute; + var AsyncRoute = (function() { + function AsyncRoute(_a) { + var path = _a.path, + loader = _a.loader, + name = _a.name, + data = _a.data; + this.aux = null; + this.path = path; + this.loader = loader; + this.name = name; + this.data = data; + } + AsyncRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AsyncRoute); + return AsyncRoute; + })(); + exports.AsyncRoute = AsyncRoute; + var Redirect = (function() { + function Redirect(_a) { + var path = _a.path, + redirectTo = _a.redirectTo; + this.name = null; + this.loader = null; + this.data = null; + this.aux = null; + this.path = path; + this.redirectTo = redirectTo; + } + Redirect = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Redirect); + return Redirect; + })(); + exports.Redirect = Redirect; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/async_route_handler", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var AsyncRouteHandler = (function() { + function AsyncRouteHandler(_loader, data) { + this._loader = _loader; + this.data = data; + this._resolvedComponent = null; + } + AsyncRouteHandler.prototype.resolveComponentType = function() { + var _this = this; + if (lang_1.isPresent(this._resolvedComponent)) { + return this._resolvedComponent; + } + return this._resolvedComponent = this._loader().then(function(componentType) { + _this.componentType = componentType; + return componentType; + }); + }; + return AsyncRouteHandler; + })(); + exports.AsyncRouteHandler = AsyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/sync_route_handler", ["angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_1 = require("angular2/src/facade/async"); + var SyncRouteHandler = (function() { + function SyncRouteHandler(componentType, data) { + this.componentType = componentType; + this.data = data; + this._resolvedComponent = null; + this._resolvedComponent = async_1.PromiseWrapper.resolve(componentType); + } + SyncRouteHandler.prototype.resolveComponentType = function() { + return this._resolvedComponent; + }; + return SyncRouteHandler; + })(); + exports.SyncRouteHandler = SyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_decorator", ["angular2/src/router/route_config_impl", "angular2/src/core/util/decorators", "angular2/src/router/route_config_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var decorators_1 = require("angular2/src/core/util/decorators"); + var route_config_impl_2 = require("angular2/src/router/route_config_impl"); + exports.Route = route_config_impl_2.Route; + exports.Redirect = route_config_impl_2.Redirect; + exports.AuxRoute = route_config_impl_2.AuxRoute; + exports.AsyncRoute = route_config_impl_2.AsyncRoute; + exports.RouteConfig = decorators_1.makeDecorator(route_config_impl_1.RouteConfig); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/hash_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var HashLocationStrategy = (function(_super) { + __extends(HashLocationStrategy, _super); + function HashLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + } + HashLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + }; + HashLocationStrategy.prototype.getBaseHref = function() { + return ''; + }; + HashLocationStrategy.prototype.path = function() { + var path = this._location.hash; + return (path.length > 0 ? path.substring(1) : path) + location_strategy_1.normalizeQueryParams(this._location.search); + }; + HashLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return internal.length > 0 ? ('#' + internal) : internal; + }; + HashLocationStrategy.prototype.pushState = function(state, title, path, queryParams) { + var url = path + location_strategy_1.normalizeQueryParams(queryParams); + if (url.length == 0) { + url = this._location.pathname; + } else { + url = this.prepareExternalUrl(url); + } + this._history.pushState(state, title, url); + }; + HashLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + HashLocationStrategy.prototype.back = function() { + this._history.back(); + }; + HashLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], HashLocationStrategy); + return HashLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.HashLocationStrategy = HashLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var PathLocationStrategy = (function(_super) { + __extends(PathLocationStrategy, _super); + function PathLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + this._baseHref = dom_adapter_1.DOM.getBaseHref(); + } + PathLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('hashchange', fn, false); + }; + PathLocationStrategy.prototype.getBaseHref = function() { + return this._baseHref; + }; + PathLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return this._baseHref + internal; + }; + PathLocationStrategy.prototype.path = function() { + return this._location.pathname + location_strategy_1.normalizeQueryParams(this._location.search); + }; + PathLocationStrategy.prototype.pushState = function(state, title, url, queryParams) { + this._history.pushState(state, title, (url + location_strategy_1.normalizeQueryParams(queryParams))); + }; + PathLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + PathLocationStrategy.prototype.back = function() { + this._history.back(); + }; + PathLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], PathLocationStrategy); + return PathLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.PathLocationStrategy = PathLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_definition", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ConnectionBackend = (function() { + function ConnectionBackend() {} + return ConnectionBackend; + })(); + exports.ConnectionBackend = ConnectionBackend; + var Connection = (function() { + function Connection() {} + return Connection; + })(); + exports.Connection = Connection; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/headers", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Headers = (function() { + function Headers(headers) { + var _this = this; + if (headers instanceof Headers) { + this._headersMap = headers._headersMap; + return ; + } + this._headersMap = new collection_1.Map(); + if (lang_1.isBlank(headers)) { + return ; + } + collection_1.StringMapWrapper.forEach(headers, function(v, k) { + _this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]); + }); + } + Headers.prototype.append = function(name, value) { + var mapName = this._headersMap.get(name); + var list = collection_1.isListLikeIterable(mapName) ? mapName : []; + list.push(value); + this._headersMap.set(name, list); + }; + Headers.prototype.delete = function(name) { + this._headersMap.delete(name); + }; + Headers.prototype.forEach = function(fn) { + this._headersMap.forEach(fn); + }; + Headers.prototype.get = function(header) { + return collection_1.ListWrapper.first(this._headersMap.get(header)); + }; + Headers.prototype.has = function(header) { + return this._headersMap.has(header); + }; + Headers.prototype.keys = function() { + return collection_1.MapWrapper.keys(this._headersMap); + }; + Headers.prototype.set = function(header, value) { + var list = []; + if (collection_1.isListLikeIterable(value)) { + var pushValue = value.join(','); + list.push(pushValue); + } else { + list.push(value); + } + this._headersMap.set(header, list); + }; + Headers.prototype.values = function() { + return collection_1.MapWrapper.values(this._headersMap); + }; + Headers.prototype.getAll = function(header) { + var headers = this._headersMap.get(header); + return collection_1.isListLikeIterable(headers) ? headers : []; + }; + Headers.prototype.entries = function() { + throw new exceptions_1.BaseException('"entries" method is not implemented on Headers class'); + }; + return Headers; + })(); + exports.Headers = Headers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/enums", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RequestMethods) { + RequestMethods[RequestMethods["Get"] = 0] = "Get"; + RequestMethods[RequestMethods["Post"] = 1] = "Post"; + RequestMethods[RequestMethods["Put"] = 2] = "Put"; + RequestMethods[RequestMethods["Delete"] = 3] = "Delete"; + RequestMethods[RequestMethods["Options"] = 4] = "Options"; + RequestMethods[RequestMethods["Head"] = 5] = "Head"; + RequestMethods[RequestMethods["Patch"] = 6] = "Patch"; + })(exports.RequestMethods || (exports.RequestMethods = {})); + var RequestMethods = exports.RequestMethods; + (function(ReadyStates) { + ReadyStates[ReadyStates["Unsent"] = 0] = "Unsent"; + ReadyStates[ReadyStates["Open"] = 1] = "Open"; + ReadyStates[ReadyStates["HeadersReceived"] = 2] = "HeadersReceived"; + ReadyStates[ReadyStates["Loading"] = 3] = "Loading"; + ReadyStates[ReadyStates["Done"] = 4] = "Done"; + ReadyStates[ReadyStates["Cancelled"] = 5] = "Cancelled"; + })(exports.ReadyStates || (exports.ReadyStates = {})); + var ReadyStates = exports.ReadyStates; + (function(ResponseTypes) { + ResponseTypes[ResponseTypes["Basic"] = 0] = "Basic"; + ResponseTypes[ResponseTypes["Cors"] = 1] = "Cors"; + ResponseTypes[ResponseTypes["Default"] = 2] = "Default"; + ResponseTypes[ResponseTypes["Error"] = 3] = "Error"; + ResponseTypes[ResponseTypes["Opaque"] = 4] = "Opaque"; + })(exports.ResponseTypes || (exports.ResponseTypes = {})); + var ResponseTypes = exports.ResponseTypes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/url_search_params", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + function paramParser(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + var map = new collection_1.Map(); + if (rawParams.length > 0) { + var params = rawParams.split('&'); + params.forEach(function(param) { + var split = param.split('='); + var key = split[0]; + var val = split[1]; + var list = lang_1.isPresent(map.get(key)) ? map.get(key) : []; + list.push(val); + map.set(key, list); + }); + } + return map; + } + var URLSearchParams = (function() { + function URLSearchParams(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + this.rawParams = rawParams; + this.paramsMap = paramParser(rawParams); + } + URLSearchParams.prototype.clone = function() { + var clone = new URLSearchParams(); + clone.appendAll(this); + return clone; + }; + URLSearchParams.prototype.has = function(param) { + return this.paramsMap.has(param); + }; + URLSearchParams.prototype.get = function(param) { + var storedParam = this.paramsMap.get(param); + if (collection_1.isListLikeIterable(storedParam)) { + return collection_1.ListWrapper.first(storedParam); + } else { + return null; + } + }; + URLSearchParams.prototype.getAll = function(param) { + var mapParam = this.paramsMap.get(param); + return lang_1.isPresent(mapParam) ? mapParam : []; + }; + URLSearchParams.prototype.set = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.setAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(value[0]); + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.append = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.appendAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.replaceAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.toString = function() { + var paramsList = []; + this.paramsMap.forEach(function(values, k) { + values.forEach(function(v) { + return paramsList.push(k + '=' + v); + }); + }); + return paramsList.join('&'); + }; + URLSearchParams.prototype.delete = function(param) { + this.paramsMap.delete(param); + }; + return URLSearchParams; + })(); + exports.URLSearchParams = URLSearchParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_response", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var Response = (function() { + function Response(responseOptions) { + this._body = responseOptions.body; + this.status = responseOptions.status; + this.statusText = responseOptions.statusText; + this.headers = responseOptions.headers; + this.type = responseOptions.type; + this.url = responseOptions.url; + } + Response.prototype.blob = function() { + throw new exceptions_1.BaseException('"blob()" method not implemented on Response superclass'); + }; + Response.prototype.json = function() { + var jsonResponse; + if (http_utils_1.isJsObject(this._body)) { + jsonResponse = this._body; + } else if (lang_1.isString(this._body)) { + jsonResponse = lang_1.Json.parse(this._body); + } + return jsonResponse; + }; + Response.prototype.text = function() { + return this._body.toString(); + }; + Response.prototype.arrayBuffer = function() { + throw new exceptions_1.BaseException('"arrayBuffer()" method not implemented on Response superclass'); + }; + return Response; + })(); + exports.Response = Response; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_response_options", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var ResponseOptions = (function() { + function ResponseOptions(_a) { + var _b = _a === void 0 ? {} : _a, + body = _b.body, + status = _b.status, + headers = _b.headers, + statusText = _b.statusText, + type = _b.type, + url = _b.url; + this.body = lang_1.isPresent(body) ? body : null; + this.status = lang_1.isPresent(status) ? status : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.statusText = lang_1.isPresent(statusText) ? statusText : null; + this.type = lang_1.isPresent(type) ? type : null; + this.url = lang_1.isPresent(url) ? url : null; + } + ResponseOptions.prototype.merge = function(options) { + return new ResponseOptions({ + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + status: lang_1.isPresent(options) && lang_1.isPresent(options.status) ? options.status : this.status, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + statusText: lang_1.isPresent(options) && lang_1.isPresent(options.statusText) ? options.statusText : this.statusText, + type: lang_1.isPresent(options) && lang_1.isPresent(options.type) ? options.type : this.type, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url + }); + }; + return ResponseOptions; + })(); + exports.ResponseOptions = ResponseOptions; + var BaseResponseOptions = (function(_super) { + __extends(BaseResponseOptions, _super); + function BaseResponseOptions() { + _super.call(this, { + status: 200, + statusText: 'Ok', + type: enums_1.ResponseTypes.Default, + headers: new headers_1.Headers() + }); + } + BaseResponseOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseResponseOptions); + return BaseResponseOptions; + })(ResponseOptions); + exports.BaseResponseOptions = BaseResponseOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_xhr", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var BrowserXhr = (function() { + function BrowserXhr() {} + BrowserXhr.prototype.build = function() { + return (new XMLHttpRequest()); + }; + BrowserXhr = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserXhr); + return BrowserXhr; + })(); + exports.BrowserXhr = BrowserXhr; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_jsonp", ["angular2/angular2", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var _nextRequestId = 0; + exports.JSONP_HOME = '__ng_jsonp__'; + var _jsonpConnections = null; + function _getJsonpConnections() { + if (_jsonpConnections === null) { + _jsonpConnections = lang_1.global[exports.JSONP_HOME] = {}; + } + return _jsonpConnections; + } + var BrowserJsonp = (function() { + function BrowserJsonp() {} + BrowserJsonp.prototype.build = function(url) { + var node = document.createElement('script'); + node.src = url; + return node; + }; + BrowserJsonp.prototype.nextRequestID = function() { + return "__req" + _nextRequestId++; + }; + BrowserJsonp.prototype.requestCallback = function(id) { + return exports.JSONP_HOME + "." + id + ".finished"; + }; + BrowserJsonp.prototype.exposeConnection = function(id, connection) { + var connections = _getJsonpConnections(); + connections[id] = connection; + }; + BrowserJsonp.prototype.removeConnection = function(id) { + var connections = _getJsonpConnections(); + connections[id] = null; + }; + BrowserJsonp.prototype.send = function(node) { + document.body.appendChild((node)); + }; + BrowserJsonp.prototype.cleanup = function(node) { + if (node.parentNode) { + node.parentNode.removeChild((node)); + } + }; + BrowserJsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserJsonp); + return BrowserJsonp; + })(); + exports.BrowserJsonp = BrowserJsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/mock_backend", ["angular2/angular2", "angular2/src/http/static_request", "angular2/src/http/enums", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var static_request_1 = require("angular2/src/http/static_request"); + var enums_1 = require("angular2/src/http/enums"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Rx = require("@reactivex/rxjs/dist/cjs/Rx"); + var Subject = Rx.Subject, + ReplaySubject = Rx.ReplaySubject; + var MockConnection = (function() { + function MockConnection(req) { + this.response = new ReplaySubject(1).take(1); + this.readyState = enums_1.ReadyStates.Open; + this.request = req; + } + MockConnection.prototype.mockRespond = function(res) { + if (this.readyState === enums_1.ReadyStates.Done || this.readyState === enums_1.ReadyStates.Cancelled) { + throw new exceptions_1.BaseException('Connection has already been resolved'); + } + this.readyState = enums_1.ReadyStates.Done; + this.response.next(res); + this.response.complete(); + }; + MockConnection.prototype.mockDownload = function(res) {}; + MockConnection.prototype.mockError = function(err) { + this.readyState = enums_1.ReadyStates.Done; + this.response.error(err); + }; + return MockConnection; + })(); + exports.MockConnection = MockConnection; + var MockBackend = (function() { + function MockBackend() { + var _this = this; + this.connectionsArray = []; + this.connections = new Subject(); + this.connections.subscribe(function(connection) { + return _this.connectionsArray.push(connection); + }); + this.pendingConnections = new Subject(); + } + MockBackend.prototype.verifyNoPendingRequests = function() { + var pending = 0; + this.pendingConnections.subscribe(function(c) { + return pending++; + }); + if (pending > 0) + throw new exceptions_1.BaseException(pending + " pending connections to be resolved"); + }; + MockBackend.prototype.resolveAllConnections = function() { + this.connections.subscribe(function(c) { + return c.readyState = 4; + }); + }; + MockBackend.prototype.createConnection = function(req) { + if (!lang_1.isPresent(req) || !(req instanceof static_request_1.Request)) { + throw new exceptions_1.BaseException("createConnection requires an instance of Request, got " + req); + } + var connection = new MockConnection(req); + this.connections.next(connection); + return connection; + }; + MockBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], MockBackend); + return MockBackend; + })(); + exports.MockBackend = MockBackend; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_1 = require("angular2/src/core/metadata/view"); + var selector_1 = require("angular2/src/compiler/selector"); + var util_1 = require("angular2/src/compiler/util"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; + var CompileTypeMetadata = (function() { + function CompileTypeMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + runtime = _b.runtime, + name = _b.name, + moduleUrl = _b.moduleUrl, + isHost = _b.isHost; + this.runtime = runtime; + this.name = name; + this.moduleUrl = moduleUrl; + this.isHost = lang_1.normalizeBool(isHost); + } + CompileTypeMetadata.fromJson = function(data) { + return new CompileTypeMetadata({ + name: data['name'], + moduleUrl: data['moduleUrl'], + isHost: data['isHost'] + }); + }; + CompileTypeMetadata.prototype.toJson = function() { + return { + 'name': this.name, + 'moduleUrl': this.moduleUrl, + 'isHost': this.isHost + }; + }; + return CompileTypeMetadata; + })(); + exports.CompileTypeMetadata = CompileTypeMetadata; + var CompileTemplateMetadata = (function() { + function CompileTemplateMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + encapsulation = _b.encapsulation, + template = _b.template, + templateUrl = _b.templateUrl, + styles = _b.styles, + styleUrls = _b.styleUrls, + ngContentSelectors = _b.ngContentSelectors; + this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; + this.template = template; + this.templateUrl = templateUrl; + this.styles = lang_1.isPresent(styles) ? styles : []; + this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; + this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; + } + CompileTemplateMetadata.fromJson = function(data) { + return new CompileTemplateMetadata({ + encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], + template: data['template'], + templateUrl: data['templateUrl'], + styles: data['styles'], + styleUrls: data['styleUrls'], + ngContentSelectors: data['ngContentSelectors'] + }); + }; + CompileTemplateMetadata.prototype.toJson = function() { + return { + 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, + 'template': this.template, + 'templateUrl': this.templateUrl, + 'styles': this.styles, + 'styleUrls': this.styleUrls, + 'ngContentSelectors': this.ngContentSelectors + }; + }; + return CompileTemplateMetadata; + })(); + exports.CompileTemplateMetadata = CompileTemplateMetadata; + var CompileDirectiveMetadata = (function() { + function CompileDirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + hostListeners = _b.hostListeners, + hostProperties = _b.hostProperties, + hostAttributes = _b.hostAttributes, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + this.type = type; + this.isComponent = isComponent; + this.dynamicLoadable = dynamicLoadable; + this.selector = selector; + this.exportAs = exportAs; + this.changeDetection = changeDetection; + this.inputs = inputs; + this.outputs = outputs; + this.hostListeners = hostListeners; + this.hostProperties = hostProperties; + this.hostAttributes = hostAttributes; + this.lifecycleHooks = lifecycleHooks; + this.template = template; + } + CompileDirectiveMetadata.create = function(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + host = _b.host, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + var hostListeners = {}; + var hostProperties = {}; + var hostAttributes = {}; + if (lang_1.isPresent(host)) { + collection_1.StringMapWrapper.forEach(host, function(value, key) { + var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); + if (lang_1.isBlank(matches)) { + hostAttributes[key] = value; + } else if (lang_1.isPresent(matches[1])) { + hostProperties[matches[1]] = value; + } else if (lang_1.isPresent(matches[2])) { + hostListeners[matches[2]] = value; + } + }); + } + var inputsMap = {}; + if (lang_1.isPresent(inputs)) { + inputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + inputsMap[parts[0]] = parts[1]; + }); + } + var outputsMap = {}; + if (lang_1.isPresent(outputs)) { + outputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + outputsMap[parts[0]] = parts[1]; + }); + } + return new CompileDirectiveMetadata({ + type: type, + isComponent: lang_1.normalizeBool(isComponent), + dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), + selector: selector, + exportAs: exportAs, + changeDetection: changeDetection, + inputs: inputsMap, + outputs: outputsMap, + hostListeners: hostListeners, + hostProperties: hostProperties, + hostAttributes: hostAttributes, + lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], + template: template + }); + }; + CompileDirectiveMetadata.fromJson = function(data) { + return new CompileDirectiveMetadata({ + isComponent: data['isComponent'], + dynamicLoadable: data['dynamicLoadable'], + selector: data['selector'], + exportAs: data['exportAs'], + type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], + changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], + inputs: data['inputs'], + outputs: data['outputs'], + hostListeners: data['hostListeners'], + hostProperties: data['hostProperties'], + hostAttributes: data['hostAttributes'], + lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { + return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; + }), + template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'] + }); + }; + CompileDirectiveMetadata.prototype.toJson = function() { + return { + 'isComponent': this.isComponent, + 'dynamicLoadable': this.dynamicLoadable, + 'selector': this.selector, + 'exportAs': this.exportAs, + 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, + 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, + 'inputs': this.inputs, + 'outputs': this.outputs, + 'hostListeners': this.hostListeners, + 'hostProperties': this.hostProperties, + 'hostAttributes': this.hostAttributes, + 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { + return lang_1.serializeEnum(hook); + }), + 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template + }; + }; + return CompileDirectiveMetadata; + })(); + exports.CompileDirectiveMetadata = CompileDirectiveMetadata; + function createHostComponentMeta(componentType, componentSelector) { + var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); + return CompileDirectiveMetadata.create({ + type: new CompileTypeMetadata({ + runtime: Object, + name: "Host" + componentType.name, + moduleUrl: componentType.moduleUrl, + isHost: true + }), + template: new CompileTemplateMetadata({ + template: template, + templateUrl: '', + styles: [], + styleUrls: [], + ngContentSelectors: [] + }), + changeDetection: change_detection_1.ChangeDetectionStrategy.Default, + inputs: [], + outputs: [], + host: {}, + lifecycleHooks: [], + isComponent: true, + dynamicLoadable: false, + selector: '*' + }); + } + exports.createHostComponentMeta = createHostComponentMeta; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { + var pvVisitors = []; + var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); + template_ast_1.templateVisitAll(visitor, parsedTemplate); + return createChangeDefinitions(pvVisitors, componentType, genConfig); + } + exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; + var ProtoViewVisitor = (function() { + function ProtoViewVisitor(parent, allVisitors, strategy) { + this.parent = parent; + this.allVisitors = allVisitors; + this.strategy = strategy; + this.boundTextCount = 0; + this.boundElementCount = 0; + this.variableNames = []; + this.bindingRecords = []; + this.eventRecords = []; + this.directiveRecords = []; + this.viewIndex = allVisitors.length; + allVisitors.push(this); + } + ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + this.boundElementCount++; + template_ast_1.templateVisitAll(this, ast.outputs); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); + template_ast_1.templateVisitAll(childVisitor, ast.vars); + template_ast_1.templateVisitAll(childVisitor, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitElement = function(ast, context) { + if (ast.isBound()) { + this.boundElementCount++; + } + template_ast_1.templateVisitAll(this, ast.inputs, null); + template_ast_1.templateVisitAll(this, ast.outputs); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + template_ast_1.templateVisitAll(this, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitVariable = function(ast, context) { + this.variableNames.push(ast.name); + return null; + }; + ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { + var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); + this.eventRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { + var boundElementIndex = this.boundElementCount - 1; + var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; + var bindingRecord; + if (ast.type === template_ast_1.PropertyBindingType.Property) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Class) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Style) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); + } + this.bindingRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { + var boundTextIndex = this.boundTextCount++; + this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, boundTextIndex)); + return null; + }; + ProtoViewVisitor.prototype.visitText = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { + var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); + var directiveMetadata = ast.directive; + var directiveRecord = new change_detection_1.DirectiveRecord({ + directiveIndex: directiveIndex, + callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, + callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, + callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, + callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, + callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, + callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, + callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, + changeDetection: directiveMetadata.changeDetection + }); + this.directiveRecords.push(directiveRecord); + template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); + var bindingRecords = this.bindingRecords; + if (directiveRecord.callOnChanges) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); + } + if (directiveRecord.callOnInit) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); + } + if (directiveRecord.callDoCheck) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); + } + template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); + template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + return null; + }; + ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { + var setter = reflection_1.reflector.setter(ast.directiveName); + this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); + return null; + }; + return ProtoViewVisitor; + })(); + function createChangeDefinitions(pvVisitors, componentType, genConfig) { + var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); + return pvVisitors.map(function(pvVisitor) { + var id = componentType.name + "_" + pvVisitor.viewIndex; + return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); + }); + } + function _collectNestedProtoViewsVariableNames(pvVisitors) { + var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); + pvVisitors.forEach(function(pv) { + var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; + nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); + }); + return nestedPvVariableNames; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/core/render/view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var view_1 = require("angular2/src/core/metadata/view"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var shadow_css_1 = require("angular2/src/compiler/shadow_css"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var StyleCompiler = (function() { + function StyleCompiler(_xhr, _urlResolver) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._styleCache = new Map(); + this._shadowCss = new shadow_css_1.ShadowCss(); + } + StyleCompiler.prototype.compileComponentRuntime = function(template) { + var styles = template.styles; + var styleAbsUrls = template.styleUrls; + return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); + }; + StyleCompiler.prototype.compileComponentCodeGen = function(template) { + var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; + return this._styleCodeGen(template.styles, template.styleUrls, shim); + }; + StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); + return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; + }; + StyleCompiler.prototype.clearCache = function() { + this._styleCache.clear(); + }; + StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { + var _this = this; + var promises = absUrls.map(function(absUrl) { + var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); + var result = _this._styleCache.get(cacheKey); + if (lang_1.isBlank(result)) { + result = _this._xhr.get(absUrl).then(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); + return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); + }); + _this._styleCache.set(cacheKey, result); + } + return result; + }); + return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { + var result = plainStyles.map(function(plainStyle) { + return _this._shimIfNeeded(plainStyle, encapsulate); + }); + nestedStyles.forEach(function(styles) { + return result.push(styles); + }); + return result; + }); + }; + StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { + var _this = this; + var arrayPrefix = lang_1.IS_DART ? "const" : ''; + var styleExpressions = plainStyles.map(function(plainStyle) { + return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); + }); + for (var i = 0; i < absUrls.length; i++) { + var moduleUrl = this._createModuleUrl(absUrls[i], shim); + styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); + } + var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; + return new source_module_1.SourceExpression([], expressionSource); + }; + StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { + var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; + return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); + }; + StyleCompiler.prototype._shimIfNeeded = function(style, shim) { + return shim ? this._shadowCss.shimCssText(style, view_factory_1.CONTENT_ATTR, view_factory_1.HOST_ATTR) : style; + }; + StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { + return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + }; + StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); + return StyleCompiler; + })(); + exports.StyleCompiler = StyleCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/html_ast", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var HtmlParser = (function() { + function HtmlParser() {} + HtmlParser.prototype.parse = function(template, sourceInfo) { + var root = dom_adapter_1.DOM.createTemplate(template); + return parseChildNodes(root, sourceInfo); + }; + HtmlParser.prototype.unparse = function(nodes) { + var visitor = new UnparseVisitor(); + var parts = []; + html_ast_1.htmlVisitAll(visitor, nodes, parts); + return parts.join(''); + }; + HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); + return HtmlParser; + })(); + exports.HtmlParser = HtmlParser; + function parseText(text, indexInParent, parentSourceInfo) { + var value = dom_adapter_1.DOM.getText(text); + return new html_ast_1.HtmlTextAst(value, parentSourceInfo + " > #text(" + value + "):nth-child(" + indexInParent + ")"); + } + function parseAttr(element, parentSourceInfo, attrName, attrValue) { + return new html_ast_1.HtmlAttrAst(attrName, attrValue, parentSourceInfo + "[" + attrName + "=" + attrValue + "]"); + } + function parseElement(element, indexInParent, parentSourceInfo) { + var nodeName = dom_adapter_1.DOM.nodeName(element).toLowerCase(); + var sourceInfo = parentSourceInfo + " > " + nodeName + ":nth-child(" + indexInParent + ")"; + var attrs = parseAttrs(element, sourceInfo); + var childNodes = parseChildNodes(element, sourceInfo); + return new html_ast_1.HtmlElementAst(nodeName, attrs, childNodes, sourceInfo); + } + function parseAttrs(element, elementSourceInfo) { + var attrMap = dom_adapter_1.DOM.attributeMap(element); + var attrList = []; + attrMap.forEach(function(value, name) { + return attrList.push([name, value]); + }); + attrList.sort(function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + return attrList.map(function(entry) { + return parseAttr(element, elementSourceInfo, entry[0], entry[1]); + }); + } + function parseChildNodes(element, parentSourceInfo) { + var root = dom_adapter_1.DOM.templateAwareRoot(element); + var childNodes = dom_adapter_1.DOM.childNodesAsList(root); + var result = []; + var index = 0; + childNodes.forEach(function(childNode) { + var childResult = null; + if (dom_adapter_1.DOM.isTextNode(childNode)) { + var text = childNode; + childResult = parseText(text, index, parentSourceInfo); + } else if (dom_adapter_1.DOM.isElementNode(childNode)) { + var el = childNode; + childResult = parseElement(el, index, parentSourceInfo); + } + if (lang_1.isPresent(childResult)) { + result.push(childResult); + } + index++; + }); + return result; + } + var UnparseVisitor = (function() { + function UnparseVisitor() {} + UnparseVisitor.prototype.visitElement = function(ast, parts) { + parts.push("<" + ast.name); + var attrs = []; + html_ast_1.htmlVisitAll(this, ast.attrs, attrs); + if (ast.attrs.length > 0) { + parts.push(' '); + parts.push(attrs.join(' ')); + } + parts.push(">"); + html_ast_1.htmlVisitAll(this, ast.children, parts); + parts.push(""); + return null; + }; + UnparseVisitor.prototype.visitAttr = function(ast, parts) { + parts.push(ast.name + "=" + util_1.escapeDoubleQuoteString(ast.value)); + return null; + }; + UnparseVisitor.prototype.visitText = function(ast, parts) { + parts.push(ast.value); + return null; + }; + return UnparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var GenericBrowserDomAdapter = (function(_super) { + __extends(GenericBrowserDomAdapter, _super); + function GenericBrowserDomAdapter() { + var _this = this; + _super.call(this); + this._animationPrefix = null; + this._transitionEnd = null; + try { + var element = this.createElement('div', this.defaultDoc()); + if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { + this._animationPrefix = ''; + } else { + var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; + for (var i = 0; i < domPrefixes.length; i++) { + if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { + this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; + break; + } + } + } + var transEndEventNames = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { + if (lang_1.isPresent(_this.getStyle(element, key))) { + _this._transitionEnd = value; + } + }); + } catch (e) { + this._animationPrefix = null; + this._transitionEnd = null; + } + } + GenericBrowserDomAdapter.prototype.getXHR = function() { + return xhr_impl_1.XHRImpl; + }; + GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { + return el.getDistributedNodes(); + }; + GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + el.href = href == null ? baseUrl : baseUrl + '/../' + href; + }; + GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { + return true; + }; + GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { + return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); + }; + GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { + return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; + }; + GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { + return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; + }; + GenericBrowserDomAdapter.prototype.supportsAnimation = function() { + return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); + }; + return GenericBrowserDomAdapter; + })(dom_adapter_1.DomAdapter); + exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/browser_testability", ["angular2/src/core/testability/testability", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var testability_1 = require("angular2/src/core/testability/testability"); + var lang_1 = require("angular2/src/facade/lang"); + var PublicTestability = (function() { + function PublicTestability(testability) { + this._testability = testability; + } + PublicTestability.prototype.isStable = function() { + return this._testability.isStable(); + }; + PublicTestability.prototype.whenStable = function(callback) { + this._testability.whenStable(callback); + }; + PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { + return this.findProviders(using, provider, exactMatch); + }; + PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { + return this._testability.findBindings(using, provider, exactMatch); + }; + return PublicTestability; + })(); + var BrowserGetTestability = (function() { + function BrowserGetTestability() {} + BrowserGetTestability.init = function() { + testability_1.setTestabilityGetter(new BrowserGetTestability()); + }; + BrowserGetTestability.prototype.addToWindow = function(registry) { + lang_1.global.getAngularTestability = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + var testability = registry.findTestabilityInTree(elem, findInAncestors); + if (testability == null) { + throw new Error('Could not find testability for element.'); + } + return new PublicTestability(testability); + }; + lang_1.global.getAllAngularTestabilities = function() { + var testabilities = registry.getAllTestabilities(); + return testabilities.map(function(testability) { + return new PublicTestability(testability); + }); + }; + }; + return BrowserGetTestability; + })(); + exports.BrowserGetTestability = BrowserGetTestability; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_gestures", ["angular2/src/core/render/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var hammer_common_1 = require("angular2/src/core/render/dom/events/hammer_common"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var di_1 = require("angular2/src/core/di"); + var HammerGesturesPlugin = (function(_super) { + __extends(HammerGesturesPlugin, _super); + function HammerGesturesPlugin() { + _super.apply(this, arguments); + } + HammerGesturesPlugin.prototype.supports = function(eventName) { + if (!_super.prototype.supports.call(this, eventName)) + return false; + if (!lang_1.isPresent(window['Hammer'])) { + throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); + } + return true; + }; + HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + eventName = eventName.toLowerCase(); + zone.runOutsideAngular(function() { + var mc = new Hammer(element); + mc.get('pinch').set({enable: true}); + mc.get('rotate').set({enable: true}); + mc.on(eventName, function(eventObj) { + zone.run(function() { + handler(eventObj); + }); + }); + }); + }; + HammerGesturesPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HammerGesturesPlugin); + return HammerGesturesPlugin; + })(hammer_common_1.HammerGesturesPluginCommon); + exports.HammerGesturesPlugin = HammerGesturesPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services", ["angular2/src/compiler/app_root_url", "angular2/src/compiler/url_resolver", "angular2/src/core/services/title"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + exports.AppRootUrl = app_root_url_1.AppRootUrl; + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + exports.UrlResolver = url_resolver_1.UrlResolver; + var title_1 = require("angular2/src/core/services/title"); + exports.Title = title_1.Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug", ["angular2/src/core/debug/debug_element", "angular2/src/core/debug/debug_element_view_listener"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + exports.DebugElement = debug_element_1.DebugElement; + exports.asNativeElements = debug_element_1.asNativeElements; + exports.By = debug_element_1.By; + exports.Scope = debug_element_1.Scope; + exports.inspectElement = debug_element_1.inspectElement; + var debug_element_view_listener_1 = require("angular2/src/core/debug/debug_element_view_listener"); + exports.inspectNativeElement = debug_element_view_listener_1.inspectNativeElement; + exports.ELEMENT_PROBE_PROVIDERS = debug_element_view_listener_1.ELEMENT_PROBE_PROVIDERS; + exports.ELEMENT_PROBE_BINDINGS = debug_element_view_listener_1.ELEMENT_PROBE_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/angular2", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var util_1 = require("angular2/src/upgrade/util"); + var angular = require("angular2/src/upgrade/angular_js"); + var CAMEL_CASE = /([A-Z])/g; + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var NOT_SUPPORTED = 'NOT_SUPPORTED'; + var UpgradeNg1ComponentAdapterBuilder = (function() { + function UpgradeNg1ComponentAdapterBuilder(name) { + this.name = name; + this.inputs = []; + this.inputsRename = []; + this.outputs = []; + this.outputsRename = []; + this.propertyOutputs = []; + this.checkProperties = []; + this.propertyMap = {}; + this.linkFn = null; + this.directive = null; + this.$controller = null; + var selector = name.replace(CAMEL_CASE, function(all, next) { + return '-' + next.toLowerCase(); + }); + var self = this; + this.type = angular2_1.Directive({ + selector: selector, + inputs: this.inputsRename, + outputs: this.outputsRename + }).Class({ + constructor: [new angular2_1.Inject(constants_1.NG1_SCOPE), angular2_1.ElementRef, function(scope, elementRef) { + return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap); + }], + onChanges: function() {}, + doCheck: function() {} + }); + } + UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) { + var directives = injector.get(this.name + 'Directive'); + if (directives.length > 1) { + throw new Error('Only support single directive definition for: ' + this.name); + } + var directive = directives[0]; + if (directive.replace) + this.notSupported('replace'); + if (directive.terminal) + this.notSupported('terminal'); + var link = directive.link; + if (typeof link == 'object') { + if (link.post) + this.notSupported('link.post'); + } + return directive; + }; + UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) { + throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'."); + }; + UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() { + var scope = this.directive.scope; + if (typeof scope == 'object') { + for (var name in scope) { + if (scope.hasOwnProperty(name)) { + var localName = scope[name]; + var type = localName.charAt(0); + localName = localName.substr(1) || name; + var outputName = 'output_' + name; + var outputNameRename = outputName + ': ' + name; + var outputNameRenameChange = outputName + ': ' + name + 'Change'; + var inputName = 'input_' + name; + var inputNameRename = inputName + ': ' + name; + switch (type) { + case '=': + this.propertyOutputs.push(outputName); + this.checkProperties.push(localName); + this.outputs.push(outputName); + this.outputsRename.push(outputNameRenameChange); + this.propertyMap[outputName] = localName; + case '@': + this.inputs.push(inputName); + this.inputsRename.push(inputNameRename); + this.propertyMap[inputName] = localName; + break; + case '&': + this.outputs.push(outputName); + this.outputsRename.push(outputNameRename); + this.propertyMap[outputName] = localName; + break; + default: + var json = JSON.stringify(scope); + throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive."); + } + } + } + } + }; + UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) { + var _this = this; + if (this.directive.template) { + this.linkFn = compileHtml(this.directive.template); + } else if (this.directive.templateUrl) { + var url = this.directive.templateUrl; + var html = templateCache.get(url); + if (html !== undefined) { + this.linkFn = compileHtml(html); + } else { + return new Promise(function(resolve, err) { + httpBackend('GET', url, null, function(status, response) { + if (status == 200) { + resolve(_this.linkFn = compileHtml(templateCache.put(url, response))); + } else { + err("GET " + url + " returned " + status + ": " + response); + } + }); + }); + } + } else { + throw new Error("Directive '" + this.name + "' is not a component, it is missing template."); + } + return null; + function compileHtml(html) { + var div = document.createElement('div'); + div.innerHTML = html; + return compile(div.childNodes); + } + }; + UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) { + var promises = []; + var compile = injector.get(constants_1.NG1_COMPILE); + var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE); + var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND); + var $controller = injector.get(constants_1.NG1_CONTROLLER); + for (var name in exportedComponents) { + if (exportedComponents.hasOwnProperty(name)) { + var exportedComponent = exportedComponents[name]; + exportedComponent.directive = exportedComponent.extractDirective(injector); + exportedComponent.$controller = $controller; + exportedComponent.extractBindings(); + var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend); + if (promise) + promises.push(promise); + } + } + return Promise.all(promises); + }; + return UpgradeNg1ComponentAdapterBuilder; + })(); + exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder; + var UpgradeNg1ComponentAdapter = (function() { + function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) { + this.directive = directive; + this.inputs = inputs; + this.outputs = outputs; + this.propOuts = propOuts; + this.checkProperties = checkProperties; + this.propertyMap = propertyMap; + this.destinationObj = null; + this.checkLastValues = []; + var element = elementRef.nativeElement; + var childNodes = []; + var childNode; + while (childNode = element.firstChild) { + element.removeChild(childNode); + childNodes.push(childNode); + } + var componentScope = scope.$new(!!directive.scope); + var $element = angular.element(element); + var controllerType = directive.controller; + var controller = null; + if (controllerType) { + var locals = { + $scope: componentScope, + $element: $element + }; + controller = $controller(controllerType, locals, null, directive.controllerAs); + $element.data(util_1.controllerKey(directive.name), controller); + } + var link = directive.link; + if (typeof link == 'object') + link = link.pre; + if (link) { + var attrs = NOT_SUPPORTED; + var transcludeFn = NOT_SUPPORTED; + var linkController = this.resolveRequired($element, directive.require); + directive.link(componentScope, $element, attrs, linkController, transcludeFn); + } + this.destinationObj = directive.bindToController && controller ? controller : componentScope; + linkFn(componentScope, function(clonedElement, scope) { + for (var i = 0, + ii = clonedElement.length; i < ii; i++) { + element.appendChild(clonedElement[i]); + } + }, {parentBoundTranscludeFn: function(scope, cloneAttach) { + cloneAttach(childNodes); + }}); + for (var i = 0; i < inputs.length; i++) { + this[inputs[i]] = null; + } + for (var j = 0; j < outputs.length; j++) { + var emitter = this[outputs[j]] = new angular2_1.EventEmitter(); + this.setComponentProperty(outputs[j], (function(emitter) { + return function(value) { + return emitter.next(value); + }; + })(emitter)); + } + for (var k = 0; k < propOuts.length; k++) { + this[propOuts[k]] = new angular2_1.EventEmitter(); + this.checkLastValues.push(INITIAL_VALUE); + } + } + UpgradeNg1ComponentAdapter.prototype.onChanges = function(changes) { + for (var name in changes) { + if (changes.hasOwnProperty(name)) { + var change = changes[name]; + this.setComponentProperty(name, change.currentValue); + } + } + }; + UpgradeNg1ComponentAdapter.prototype.doCheck = function() { + var count = 0; + var destinationObj = this.destinationObj; + var lastValues = this.checkLastValues; + var checkProperties = this.checkProperties; + for (var i = 0; i < checkProperties.length; i++) { + var value = destinationObj[checkProperties[i]]; + var last = lastValues[i]; + if (value !== last) { + if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else { + var eventEmitter = this[this.propOuts[i]]; + eventEmitter.next(lastValues[i] = value); + } + } + } + return count; + }; + UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) { + this.destinationObj[this.propertyMap[name]] = value; + }; + UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) { + if (!require) { + return undefined; + } else if (typeof require == 'string') { + var name = require; + var isOptional = false; + var startParent = false; + var searchParents = false; + var ch; + if (name.charAt(0) == '?') { + isOptional = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + searchParents = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + startParent = true; + name = name.substr(1); + } + var key = util_1.controllerKey(name); + if (startParent) + $element = $element.parent(); + var dep = searchParents ? $element.inheritedData(key) : $element.data(key); + if (!dep && !isOptional) { + throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'."); + } + return dep; + } else if (require instanceof Array) { + var deps = []; + for (var i = 0; i < require.length; i++) { + deps.push(this.resolveRequired($element, require[i])); + } + return deps; + } + throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require); + }; + return UpgradeNg1ComponentAdapter; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function hasLifecycleHook(e, type) { + if (!(type instanceof lang_1.Type)) + return false; + return e.name in type.prototype; + } + exports.hasLifecycleHook = hasLifecycleHook; + function getCanActivateHook(type) { + var annotations = reflection_1.reflector.annotations(type); + for (var i = 0; i < annotations.length; i += 1) { + var annotation = annotations[i]; + if (annotation instanceof lifecycle_annotations_impl_1.CanActivate) { + return annotation.fn; + } + } + return null; + } + exports.getCanActivateHook = getCanActivateHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_outlet", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/router/router", "angular2/src/router/instruction", "angular2/src/router/lifecycle_annotations", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var routerMod = require("angular2/src/router/router"); + var instruction_1 = require("angular2/src/router/instruction"); + var hookMod = require("angular2/src/router/lifecycle_annotations"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var RouterOutlet = (function() { + function RouterOutlet(_elementRef, _loader, _parentRouter, nameAttr) { + this._elementRef = _elementRef; + this._loader = _loader; + this._parentRouter = _parentRouter; + this.name = null; + this._componentRef = null; + this._currentInstruction = null; + if (lang_1.isPresent(nameAttr)) { + this.name = nameAttr; + this._parentRouter.registerAuxOutlet(this); + } else { + this._parentRouter.registerPrimaryOutlet(this); + } + } + RouterOutlet.prototype.activate = function(nextInstruction) { + var _this = this; + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + var componentType = nextInstruction.componentType; + var childRouter = this._parentRouter.childRouter(componentType); + var providers = angular2_1.Injector.resolve([angular2_1.provide(instruction_1.RouteData, {useValue: nextInstruction.routeData}), angular2_1.provide(instruction_1.RouteParams, {useValue: new instruction_1.RouteParams(nextInstruction.params)}), angular2_1.provide(routerMod.Router, {useValue: childRouter})]); + return this._loader.loadNextToLocation(componentType, this._elementRef, providers).then(function(componentRef) { + _this._componentRef = componentRef; + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onActivate, componentType)) { + return _this._componentRef.instance.onActivate(nextInstruction, previousInstruction); + } + }); + }; + RouterOutlet.prototype.reuse = function(nextInstruction) { + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + if (lang_1.isBlank(this._componentRef)) { + throw new exceptions_1.BaseException("Cannot reuse an outlet that does not contain a component."); + } + return async_1.PromiseWrapper.resolve(route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onReuse, this._currentInstruction.componentType) ? this._componentRef.instance.onReuse(nextInstruction, previousInstruction) : true); + }; + RouterOutlet.prototype.deactivate = function(nextInstruction) { + var _this = this; + var next = _resolveToTrue; + if (lang_1.isPresent(this._componentRef) && lang_1.isPresent(this._currentInstruction) && route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onDeactivate, this._currentInstruction.componentType)) { + next = async_1.PromiseWrapper.resolve(this._componentRef.instance.onDeactivate(nextInstruction, this._currentInstruction)); + } + return next.then(function(_) { + if (lang_1.isPresent(_this._componentRef)) { + _this._componentRef.dispose(); + _this._componentRef = null; + } + }); + }; + RouterOutlet.prototype.canDeactivate = function(nextInstruction) { + if (lang_1.isBlank(this._currentInstruction)) { + return _resolveToTrue; + } + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canDeactivate, this._currentInstruction.componentType)) { + return async_1.PromiseWrapper.resolve(this._componentRef.instance.canDeactivate(nextInstruction, this._currentInstruction)); + } + return _resolveToTrue; + }; + RouterOutlet.prototype.canReuse = function(nextInstruction) { + var result; + if (lang_1.isBlank(this._currentInstruction) || this._currentInstruction.componentType != nextInstruction.componentType) { + result = false; + } else if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canReuse, this._currentInstruction.componentType)) { + result = this._componentRef.instance.canReuse(nextInstruction, this._currentInstruction); + } else { + result = nextInstruction == this._currentInstruction || (lang_1.isPresent(nextInstruction.params) && lang_1.isPresent(this._currentInstruction.params) && collection_1.StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params)); + } + return async_1.PromiseWrapper.resolve(result); + }; + RouterOutlet = __decorate([angular2_1.Directive({selector: 'router-outlet'}), __param(3, angular2_1.Attribute('name')), __metadata('design:paramtypes', [angular2_1.ElementRef, angular2_1.DynamicComponentLoader, routerMod.Router, String])], RouterOutlet); + return RouterOutlet; + })(); + exports.RouterOutlet = RouterOutlet; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location", ["angular2/src/router/location_strategy", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var lang_2 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + exports.APP_BASE_HREF = lang_1.CONST_EXPR(new angular2_1.OpaqueToken('appBaseHref')); + var Location = (function() { + function Location(platformStrategy, href) { + var _this = this; + this.platformStrategy = platformStrategy; + this._subject = new async_1.EventEmitter(); + var browserBaseHref = lang_1.isPresent(href) ? href : this.platformStrategy.getBaseHref(); + if (lang_2.isBlank(browserBaseHref)) { + throw new exceptions_1.BaseException("No base href set. Either provide a provider for the APP_BASE_HREF token or add a base element to the document."); + } + this._baseHref = stripTrailingSlash(stripIndexHtml(browserBaseHref)); + this.platformStrategy.onPopState(function(_) { + async_1.ObservableWrapper.callNext(_this._subject, { + 'url': _this.path(), + 'pop': true + }); + }); + } + Location.prototype.path = function() { + return this.normalize(this.platformStrategy.path()); + }; + Location.prototype.normalize = function(url) { + return stripTrailingSlash(_stripBaseHref(this._baseHref, stripIndexHtml(url))); + }; + Location.prototype.prepareExternalUrl = function(url) { + if (!url.startsWith('/')) { + url = '/' + url; + } + return this.platformStrategy.prepareExternalUrl(stripTrailingSlash(_addBaseHref(this._baseHref, url))); + }; + Location.prototype.go = function(path, query) { + if (query === void 0) { + query = ''; + } + this.platformStrategy.pushState(null, '', path, query); + }; + Location.prototype.forward = function() { + this.platformStrategy.forward(); + }; + Location.prototype.back = function() { + this.platformStrategy.back(); + }; + Location.prototype.subscribe = function(onNext, onThrow, onReturn) { + if (onThrow === void 0) { + onThrow = null; + } + if (onReturn === void 0) { + onReturn = null; + } + return async_1.ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn); + }; + Location = __decorate([angular2_1.Injectable(), __param(1, angular2_1.Optional()), __param(1, angular2_1.Inject(exports.APP_BASE_HREF)), __metadata('design:paramtypes', [location_strategy_1.LocationStrategy, String])], Location); + return Location; + })(); + exports.Location = Location; + function _stripBaseHref(baseHref, url) { + if (baseHref.length > 0 && url.startsWith(baseHref)) { + return url.substring(baseHref.length); + } + return url; + } + function _addBaseHref(baseHref, url) { + if (!url.startsWith(baseHref)) { + return baseHref + url; + } + return url; + } + function stripIndexHtml(url) { + if (/\/index.html$/g.test(url)) { + return url.substring(0, url.length - 11); + } + return url; + } + function stripTrailingSlash(url) { + if (/\/$/g.test(url)) { + url = url.substring(0, url.length - 1); + } + return url; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/url_parser", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var instruction_1 = require("angular2/src/router/instruction"); + var TouchMap = (function() { + function TouchMap(map) { + var _this = this; + this.map = {}; + this.keys = {}; + if (lang_1.isPresent(map)) { + collection_1.StringMapWrapper.forEach(map, function(value, key) { + _this.map[key] = lang_1.isPresent(value) ? value.toString() : null; + _this.keys[key] = true; + }); + } + } + TouchMap.prototype.get = function(key) { + collection_1.StringMapWrapper.delete(this.keys, key); + return this.map[key]; + }; + TouchMap.prototype.getUnused = function() { + var _this = this; + var unused = collection_1.StringMapWrapper.create(); + var keys = collection_1.StringMapWrapper.keys(this.keys); + keys.forEach(function(key) { + return unused[key] = collection_1.StringMapWrapper.get(_this.map, key); + }); + return unused; + }; + return TouchMap; + })(); + function normalizeString(obj) { + if (lang_1.isBlank(obj)) { + return null; + } else { + return obj.toString(); + } + } + var ContinuationSegment = (function() { + function ContinuationSegment() { + this.name = ''; + } + ContinuationSegment.prototype.generate = function(params) { + return ''; + }; + ContinuationSegment.prototype.match = function(path) { + return true; + }; + return ContinuationSegment; + })(); + var StaticSegment = (function() { + function StaticSegment(path) { + this.path = path; + this.name = ''; + } + StaticSegment.prototype.match = function(path) { + return path == this.path; + }; + StaticSegment.prototype.generate = function(params) { + return this.path; + }; + return StaticSegment; + })(); + var DynamicSegment = (function() { + function DynamicSegment(name) { + this.name = name; + } + DynamicSegment.prototype.match = function(path) { + return path.length > 0; + }; + DynamicSegment.prototype.generate = function(params) { + if (!collection_1.StringMapWrapper.contains(params.map, this.name)) { + throw new exceptions_1.BaseException("Route generator for '" + this.name + "' was not included in parameters passed."); + } + return normalizeString(params.get(this.name)); + }; + return DynamicSegment; + })(); + var StarSegment = (function() { + function StarSegment(name) { + this.name = name; + } + StarSegment.prototype.match = function(path) { + return true; + }; + StarSegment.prototype.generate = function(params) { + return normalizeString(params.get(this.name)); + }; + return StarSegment; + })(); + var paramMatcher = /^:([^\/]+)$/g; + var wildcardMatcher = /^\*([^\/]+)$/g; + function parsePathString(route) { + if (route.startsWith("/")) { + route = route.substring(1); + } + var segments = splitBySlash(route); + var results = []; + var specificity = 0; + if (segments.length > 98) { + throw new exceptions_1.BaseException("'" + route + "' has more than the maximum supported number of segments."); + } + var limit = segments.length - 1; + for (var i = 0; i <= limit; i++) { + var segment = segments[i], + match; + if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(paramMatcher, segment))) { + results.push(new DynamicSegment(match[1])); + specificity += (100 - i); + } else if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(wildcardMatcher, segment))) { + results.push(new StarSegment(match[1])); + } else if (segment == '...') { + if (i < limit) { + throw new exceptions_1.BaseException("Unexpected \"...\" before the end of the path for \"" + route + "\"."); + } + results.push(new ContinuationSegment()); + } else { + results.push(new StaticSegment(segment)); + specificity += 100 * (100 - i); + } + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'segments', results); + collection_1.StringMapWrapper.set(result, 'specificity', specificity); + return result; + } + function pathDslHash(segments) { + return segments.map(function(segment) { + if (segment instanceof StarSegment) { + return '*'; + } else if (segment instanceof ContinuationSegment) { + return '...'; + } else if (segment instanceof DynamicSegment) { + return ':'; + } else if (segment instanceof StaticSegment) { + return segment.path; + } + }).join('/'); + } + function splitBySlash(url) { + return url.split('/'); + } + var RESERVED_CHARS = lang_1.RegExpWrapper.create('//|\\(|\\)|;|\\?|='); + function assertPath(path) { + if (lang_1.StringWrapper.contains(path, '#')) { + throw new exceptions_1.BaseException("Path \"" + path + "\" should not include \"#\". Use \"HashLocationStrategy\" instead."); + } + var illegalCharacter = lang_1.RegExpWrapper.firstMatch(RESERVED_CHARS, path); + if (lang_1.isPresent(illegalCharacter)) { + throw new exceptions_1.BaseException("Path \"" + path + "\" contains \"" + illegalCharacter[0] + "\" which is not allowed in a route config."); + } + } + var PathMatch = (function() { + function PathMatch(instruction, remaining, remainingAux) { + this.instruction = instruction; + this.remaining = remaining; + this.remainingAux = remainingAux; + } + return PathMatch; + })(); + exports.PathMatch = PathMatch; + var PathRecognizer = (function() { + function PathRecognizer(path, handler) { + this.path = path; + this.handler = handler; + this.terminal = true; + this._cache = new collection_1.Map(); + assertPath(path); + var parsed = parsePathString(path); + this._segments = parsed['segments']; + this.specificity = parsed['specificity']; + this.hash = pathDslHash(this._segments); + var lastSegment = this._segments[this._segments.length - 1]; + this.terminal = !(lastSegment instanceof ContinuationSegment); + } + PathRecognizer.prototype.recognize = function(beginningSegment) { + var nextSegment = beginningSegment; + var currentSegment; + var positionalParams = {}; + var captured = []; + for (var i = 0; i < this._segments.length; i += 1) { + var segment = this._segments[i]; + currentSegment = nextSegment; + if (segment instanceof ContinuationSegment) { + break; + } + if (lang_1.isPresent(currentSegment)) { + captured.push(currentSegment.path); + if (segment instanceof StarSegment) { + positionalParams[segment.name] = currentSegment.toString(); + nextSegment = null; + break; + } + if (segment instanceof DynamicSegment) { + positionalParams[segment.name] = currentSegment.path; + } else if (!segment.match(currentSegment.path)) { + return null; + } + nextSegment = currentSegment.child; + } else if (!segment.match('')) { + return null; + } + } + if (this.terminal && lang_1.isPresent(nextSegment)) { + return null; + } + var urlPath = captured.join('/'); + var auxiliary; + var instruction; + var urlParams; + var allParams; + if (lang_1.isPresent(currentSegment)) { + var paramsSegment = beginningSegment instanceof url_parser_1.RootUrl ? beginningSegment : currentSegment; + allParams = lang_1.isPresent(paramsSegment.params) ? collection_1.StringMapWrapper.merge(paramsSegment.params, positionalParams) : positionalParams; + urlParams = url_parser_1.serializeParams(paramsSegment.params); + auxiliary = currentSegment.auxiliary; + } else { + allParams = positionalParams; + auxiliary = []; + urlParams = []; + } + instruction = this._getInstruction(urlPath, urlParams, this, allParams); + return new PathMatch(instruction, nextSegment, auxiliary); + }; + PathRecognizer.prototype.generate = function(params) { + var paramTokens = new TouchMap(params); + var path = []; + for (var i = 0; i < this._segments.length; i++) { + var segment = this._segments[i]; + if (!(segment instanceof ContinuationSegment)) { + path.push(segment.generate(paramTokens)); + } + } + var urlPath = path.join('/'); + var nonPositionalParams = paramTokens.getUnused(); + var urlParams = url_parser_1.serializeParams(nonPositionalParams); + return this._getInstruction(urlPath, urlParams, this, params); + }; + PathRecognizer.prototype._getInstruction = function(urlPath, urlParams, _recognizer, params) { + var hashKey = urlPath + '?' + urlParams.join('?'); + if (this._cache.has(hashKey)) { + return this._cache.get(hashKey); + } + var instruction = new instruction_1.ComponentInstruction_(urlPath, urlParams, _recognizer, params); + this._cache.set(hashKey, instruction); + return instruction; + }; + return PathRecognizer; + })(); + exports.PathRecognizer = PathRecognizer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_nomalizer", ["angular2/src/router/route_config_decorator", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_decorator_1 = require("angular2/src/router/route_config_decorator"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeRouteConfig(config) { + if (config instanceof route_config_decorator_1.Route || config instanceof route_config_decorator_1.Redirect || config instanceof route_config_decorator_1.AsyncRoute || config instanceof route_config_decorator_1.AuxRoute) { + return config; + } + if ((+!!config.component) + (+!!config.redirectTo) + (+!!config.loader) != 1) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"component\", \"loader\", or \"redirectTo\" property."); + } + if (config.as && config.name) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"as\" or \"name\" property."); + } + if (config.as) { + config.name = config.as; + } + if (config.loader) { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: config.loader, + name: config.name + }); + } + if (config.aux) { + return new route_config_decorator_1.AuxRoute({ + path: config.aux, + component: config.component, + name: config.name + }); + } + if (config.component) { + if (typeof config.component == 'object') { + var componentDefinitionObject = config.component; + if (componentDefinitionObject.type == 'constructor') { + return new route_config_decorator_1.Route({ + path: config.path, + component: componentDefinitionObject.constructor, + name: config.name + }); + } else if (componentDefinitionObject.type == 'loader') { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: componentDefinitionObject.loader, + name: config.name + }); + } else { + throw new exceptions_1.BaseException("Invalid component type \"" + componentDefinitionObject.type + "\". Valid types are \"constructor\" and \"loader\"."); + } + } + return new route_config_decorator_1.Route(config); + } + if (config.redirectTo) { + return new route_config_decorator_1.Redirect({ + path: config.path, + redirectTo: config.redirectTo + }); + } + return config; + } + exports.normalizeRouteConfig = normalizeRouteConfig; + function assertComponentExists(component, path) { + if (!lang_1.isType(component)) { + throw new exceptions_1.BaseException("Component for route \"" + path + "\" is not defined, or is not a class."); + } + } + exports.assertComponentExists = assertComponentExists; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http_utils", ["angular2/src/facade/lang", "angular2/src/http/enums", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var enums_1 = require("angular2/src/http/enums"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeMethodName(method) { + if (lang_1.isString(method)) { + var originalMethod = method; + method = method.replace(/(\w)(\w*)/g, function(g0, g1, g2) { + return g1.toUpperCase() + g2.toLowerCase(); + }); + method = enums_1.RequestMethods[method]; + if (typeof method !== 'number') + throw exceptions_1.makeTypeError("Invalid request method. The method \"" + originalMethod + "\" is not supported."); + } + return method; + } + exports.normalizeMethodName = normalizeMethodName; + var lang_2 = require("angular2/src/facade/lang"); + exports.isJsObject = lang_2.isJsObject; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_request_options", ["angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/angular2", "angular2/src/http/url_search_params", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var angular2_1 = require("angular2/angular2"); + var url_search_params_1 = require("angular2/src/http/url_search_params"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var RequestOptions = (function() { + function RequestOptions(_a) { + var _b = _a === void 0 ? {} : _a, + method = _b.method, + headers = _b.headers, + body = _b.body, + url = _b.url, + search = _b.search; + this.method = lang_1.isPresent(method) ? http_utils_1.normalizeMethodName(method) : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.body = lang_1.isPresent(body) ? body : null; + this.url = lang_1.isPresent(url) ? url : null; + this.search = lang_1.isPresent(search) ? (lang_1.isString(search) ? new url_search_params_1.URLSearchParams((search)) : (search)) : null; + } + RequestOptions.prototype.merge = function(options) { + return new RequestOptions({ + method: lang_1.isPresent(options) && lang_1.isPresent(options.method) ? options.method : this.method, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url, + search: lang_1.isPresent(options) && lang_1.isPresent(options.search) ? (lang_1.isString(options.search) ? new url_search_params_1.URLSearchParams((options.search)) : (options.search).clone()) : this.search + }); + }; + return RequestOptions; + })(); + exports.RequestOptions = RequestOptions; + var BaseRequestOptions = (function(_super) { + __extends(BaseRequestOptions, _super); + function BaseRequestOptions() { + _super.call(this, { + method: enums_1.RequestMethods.Get, + headers: new headers_1.Headers() + }); + } + BaseRequestOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseRequestOptions); + return BaseRequestOptions; + })(RequestOptions); + exports.BaseRequestOptions = BaseRequestOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/xhr_backend", ["angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_xhr", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var XHRConnection = (function() { + function XHRConnection(req, browserXHR, baseResponseOptions) { + var _this = this; + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + var _xhr = browserXHR.build(); + _xhr.open(enums_1.RequestMethods[req.method].toUpperCase(), req.url); + var onLoad = function() { + var response = lang_1.isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; + var status = _xhr.status === 1223 ? 204 : _xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + var responseOptions = new base_response_options_1.ResponseOptions({ + body: response, + status: status + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(err) { + var responseOptions = new base_response_options_1.ResponseOptions({ + body: err, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + if (lang_1.isPresent(req.headers)) { + req.headers.forEach(function(values, name) { + return _xhr.setRequestHeader(name, values.join(',')); + }); + } + _xhr.addEventListener('load', onLoad); + _xhr.addEventListener('error', onError); + _xhr.send(_this.request.text()); + return function() { + _xhr.removeEventListener('load', onLoad); + _xhr.removeEventListener('error', onError); + _xhr.abort(); + }; + }); + } + return XHRConnection; + })(); + exports.XHRConnection = XHRConnection; + var XHRBackend = (function() { + function XHRBackend(_browserXHR, _baseResponseOptions) { + this._browserXHR = _browserXHR; + this._baseResponseOptions = _baseResponseOptions; + } + XHRBackend.prototype.createConnection = function(request) { + return new XHRConnection(request, this._browserXHR, this._baseResponseOptions); + }; + XHRBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_xhr_1.BrowserXhr, base_response_options_1.ResponseOptions])], XHRBackend); + return XHRBackend; + })(); + exports.XHRBackend = XHRBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/jsonp_backend", ["angular2/src/http/interfaces", "angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_jsonp", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var interfaces_1 = require("angular2/src/http/interfaces"); + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; + var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.'; + var JSONPConnection = (function() { + function JSONPConnection() {} + return JSONPConnection; + })(); + exports.JSONPConnection = JSONPConnection; + var JSONPConnection_ = (function(_super) { + __extends(JSONPConnection_, _super); + function JSONPConnection_(req, _dom, baseResponseOptions) { + var _this = this; + _super.call(this); + this._dom = _dom; + this.baseResponseOptions = baseResponseOptions; + this._finished = false; + if (req.method !== enums_1.RequestMethods.Get) { + throw exceptions_1.makeTypeError(JSONP_ERR_WRONG_METHOD); + } + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + _this.readyState = enums_1.ReadyStates.Loading; + var id = _this._id = _dom.nextRequestID(); + _dom.exposeConnection(id, _this); + var callback = _dom.requestCallback(_this._id); + var url = req.url; + if (url.indexOf('=JSONP_CALLBACK&') > -1) { + url = lang_1.StringWrapper.replace(url, '=JSONP_CALLBACK&', "=" + callback + "&"); + } else if (url.lastIndexOf('=JSONP_CALLBACK') === url.length - '=JSONP_CALLBACK'.length) { + url = url.substring(0, url.length - '=JSONP_CALLBACK'.length) + ("=" + callback); + } + var script = _this._script = _dom.build(url); + var onLoad = function(event) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + if (!_this._finished) { + var responseOptions_1 = new base_response_options_1.ResponseOptions({ + body: JSONP_ERR_NO_CALLBACK, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions_1 = baseResponseOptions.merge(responseOptions_1); + } + responseObserver.error(new static_response_1.Response(responseOptions_1)); + return ; + } + var responseOptions = new base_response_options_1.ResponseOptions({body: _this._responseData}); + if (lang_1.isPresent(_this.baseResponseOptions)) { + responseOptions = _this.baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(error) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + var responseOptions = new base_response_options_1.ResponseOptions({ + body: error.message, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + script.addEventListener('load', onLoad); + script.addEventListener('error', onError); + _dom.send(script); + return function() { + _this.readyState = enums_1.ReadyStates.Cancelled; + script.removeEventListener('load', onLoad); + script.removeEventListener('error', onError); + if (lang_1.isPresent(script)) { + _this._dom.cleanup(script); + } + }; + }); + } + JSONPConnection_.prototype.finished = function(data) { + this._finished = true; + this._dom.removeConnection(this._id); + if (this.readyState === enums_1.ReadyStates.Cancelled) + return ; + this._responseData = data; + }; + return JSONPConnection_; + })(JSONPConnection); + exports.JSONPConnection_ = JSONPConnection_; + var JSONPBackend = (function(_super) { + __extends(JSONPBackend, _super); + function JSONPBackend() { + _super.apply(this, arguments); + } + return JSONPBackend; + })(interfaces_1.ConnectionBackend); + exports.JSONPBackend = JSONPBackend; + var JSONPBackend_ = (function(_super) { + __extends(JSONPBackend_, _super); + function JSONPBackend_(_browserJSONP, _baseResponseOptions) { + _super.call(this); + this._browserJSONP = _browserJSONP; + this._baseResponseOptions = _baseResponseOptions; + } + JSONPBackend_.prototype.createConnection = function(request) { + return new JSONPConnection_(request, this._browserJSONP, this._baseResponseOptions); + }; + JSONPBackend_ = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_jsonp_1.BrowserJsonp, base_response_options_1.ResponseOptions])], JSONPBackend_); + return JSONPBackend_; + })(JSONPBackend); + exports.JSONPBackend_ = JSONPBackend_; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); + var lang_1 = require("angular2/src/facade/lang"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; + var UTIL = "ChangeDetectionUtil"; + var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; + var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); + var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); + var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); + var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); + var ChangeDetectionCompiler = (function() { + function ChangeDetectionCompiler(_genConfig) { + this._genConfig = _genConfig; + } + ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { + var _this = this; + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + return changeDetectorDefinitions.map(function(definition) { + return _this._createChangeDetectorFactory(definition); + }); + }; + ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { + if (lang_1.IS_DART || !this._genConfig.useJit) { + var proto = new change_detection_1.DynamicProtoChangeDetector(definition); + return function(dispatcher) { + return proto.instantiate(dispatcher); + }; + } else { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR, CHANGE_DETECTOR_STATE).generate(); + } + }; + ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + var factories = []; + var index = 0; + var sourceParts = changeDetectorDefinitions.map(function(definition) { + var codegen; + var sourcePart; + if (lang_1.IS_DART) { + codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); + var className = "_" + definition.id; + var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; + codegen.generate(typeRef, className, definition); + factories.push(className + ".newChangeDetector"); + sourcePart = codegen.toString(); + } else { + codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); + factories.push("function(dispatcher) { return new " + codegen.typeName + "(dispatcher); }"); + sourcePart = codegen.generateSource(); + } + index++; + return sourcePart; + }); + return new source_module_1.SourceExpressions(sourceParts, factories); + }; + ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); + return ChangeDetectionCompiler; + })(); + exports.ChangeDetectionCompiler = ChangeDetectionCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var selector_1 = require("angular2/src/compiler/selector"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = new RegExp('\\.'); + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + } + TemplateParser.prototype.parse = function(template, directives, sourceInfo) { + var parseVisitor = new TemplateParseVisitor(directives, this._exprParser, this._schemaRegistry); + var result = html_ast_1.htmlVisitAll(parseVisitor, this._htmlParser.parse(template, sourceInfo), EMPTY_COMPONENT); + if (parseVisitor.errors.length > 0) { + var errorString = parseVisitor.errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result; + }; + TemplateParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser])], TemplateParser); + return TemplateParser; + })(); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(directives, _exprParser, _schemaRegistry) { + var _this = this; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + } + TemplateParseVisitor.prototype._reportError = function(message) { + this.errors.push(message); + }; + TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceInfo) { + try { + return this._exprParser.parseInterpolation(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseAction = function(value, sourceInfo) { + try { + return this._exprParser.parseAction(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseBinding = function(value, sourceInfo) { + try { + return this._exprParser.parseBinding(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceInfo) { + try { + return this._exprParser.parseTemplateBindings(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return []; + } + }; + TemplateParseVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + var expr = this._parseInterpolation(ast.value, ast.sourceInfo); + if (lang_1.isPresent(expr)) { + return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceInfo); + } else { + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + } + }; + TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + TemplateParseVisitor.prototype.visitElement = function(element, component) { + var _this = this; + var nodeName = element.name; + var preparsedElement = template_preparser_1.preparseElement(element); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { + return null; + } + if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { + return null; + } + var matchableAttrs = []; + var elementOrDirectiveProps = []; + var vars = []; + var events = []; + var templateElementOrDirectiveProps = []; + var templateVars = []; + var templateMatchableAttrs = []; + var hasInlineTemplates = false; + var attrs = []; + element.attrs.forEach(function(attr) { + matchableAttrs.push([attr.name, attr.value]); + var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); + var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); + if (!hasBinding && !hasTemplateBinding) { + attrs.push(_this.visitAttr(attr, null)); + } + if (hasTemplateBinding) { + hasInlineTemplates = true; + } + }); + var isTemplateElement = nodeName == TEMPLATE_ELEMENT; + var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); + var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceInfo); + var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); + var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); + var elementNgContentIndex = hasInlineTemplates ? null : component.findNgContentIndex(elementCssSelector); + var parsedElement; + if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { + parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, elementNgContentIndex, element.sourceInfo); + } else if (isTemplateElement) { + this._assertAllEventsPublishedByDirectives(directives, events, element.sourceInfo); + this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, elementNgContentIndex, element.sourceInfo); + } else { + this._assertOnlyOneComponent(directives, element.sourceInfo); + var elementExportAsVars = vars.filter(function(varAst) { + return varAst.value.length === 0; + }); + parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, elementNgContentIndex, element.sourceInfo); + } + if (hasInlineTemplates) { + var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); + var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceInfo); + var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); + this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], component.findNgContentIndex(templateCssSelector), element.sourceInfo); + } + return parsedElement; + }; + TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { + var templateBindingsSource = null; + if (attr.name == TEMPLATE_ATTR) { + templateBindingsSource = attr.value; + } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { + var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; + } + if (lang_1.isPresent(templateBindingsSource)) { + var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceInfo); + for (var i = 0; i < bindings.length; i++) { + var binding = bindings[i]; + var dashCaseKey = util_1.camelCaseToDashCase(binding.key); + if (binding.keyIsVar) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(binding.key), binding.name, attr.sourceInfo)); + targetMatchableAttrs.push([dashCaseKey, binding.name]); + } else if (lang_1.isPresent(binding.expression)) { + this._parsePropertyAst(dashCaseKey, binding.expression, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else { + targetMatchableAttrs.push([dashCaseKey, '']); + this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps); + } + } + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { + var attrName = this._normalizeAttributeName(attr.name); + var attrValue = attr.value; + var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); + var hasBinding = false; + if (lang_1.isPresent(bindParts)) { + hasBinding = true; + if (lang_1.isPresent(bindParts[1])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[2])) { + var identifier = bindParts[5]; + this._parseVariable(identifier, attrValue, attr.sourceInfo, targetVars); + } else if (lang_1.isPresent(bindParts[3])) { + this._parseEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[4])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[6])) { + this._parseProperty(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[7])) { + this._parseProperty(bindParts[7], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[8])) { + this._parseEvent(bindParts[8], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } + } else { + hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } + if (!hasBinding) { + this._parseLiteralAttr(attrName, attrValue, attr.sourceInfo, targetProps); + } + return hasBinding; + }; + TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { + return attrName.startsWith('data-') ? attrName.substring(5) : attrName; + }; + TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceInfo, targetVars) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(identifier), value, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceInfo, targetMatchableAttrs, targetProps) { + this._parsePropertyAst(name, this._parseBinding(expression, sourceInfo), sourceInfo, targetMatchableAttrs, targetProps); + }; + TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceInfo, targetMatchableAttrs, targetProps) { + var expr = this._parseInterpolation(value, sourceInfo); + if (lang_1.isPresent(expr)) { + this._parsePropertyAst(name, expr, sourceInfo, targetMatchableAttrs, targetProps); + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceInfo, targetMatchableAttrs, targetProps) { + targetMatchableAttrs.push([name, ast.source]); + targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + this._parseEvent(name + "-change", expression + "=$event", sourceInfo, targetMatchableAttrs, targetEvents); + }; + TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + var parts = util_1.splitAtColon(name, [null, name]); + var target = parts[0]; + var eventName = parts[1]; + targetEvents.push(new template_ast_1.BoundEventAst(util_1.dashCaseToCamelCase(eventName), target, this._parseAction(expression, sourceInfo), sourceInfo)); + }; + TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceInfo, targetProps) { + targetProps.push(new BoundElementOrDirectiveProperty(util_1.dashCaseToCamelCase(name), this._exprParser.wrapLiteralPrimitive(value, sourceInfo), true, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { + var _this = this; + var directives = []; + selectorMatcher.match(elementCssSelector, function(selector, directive) { + directives.push(directive); + }); + collection_1.ListWrapper.sort(directives, function(dir1, dir2) { + var dir1Comp = dir1.isComponent; + var dir2Comp = dir2.isComponent; + if (dir1Comp && !dir2Comp) { + return -1; + } else if (!dir1Comp && dir2Comp) { + return 1; + } else { + return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); + } + }); + return directives; + }; + TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceInfo) { + var _this = this; + var matchedVariables = new Set(); + var directiveAsts = directives.map(function(directive) { + var hostProperties = []; + var hostEvents = []; + var directiveProperties = []; + _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceInfo, hostProperties); + _this._createDirectiveHostEventAsts(directive.hostListeners, sourceInfo, hostEvents); + _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); + var exportAsVars = []; + possibleExportAsVars.forEach(function(varAst) { + if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { + exportAsVars.push(varAst); + matchedVariables.add(varAst.name); + } + }); + return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceInfo); + }); + possibleExportAsVars.forEach(function(varAst) { + if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { + _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\" at " + varAst.sourceInfo); + } + }); + return directiveAsts; + }; + TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceInfo, targetPropertyAsts) { + var _this = this; + if (lang_1.isPresent(hostProps)) { + collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { + var exprAst = _this._parseBinding(expression, sourceInfo); + targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceInfo)); + }); + } + }; + TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceInfo, targetEventAsts) { + var _this = this; + if (lang_1.isPresent(hostListeners)) { + collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { + _this._parseEvent(propName, expression, sourceInfo, [], targetEventAsts); + }); + } + }; + TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { + if (lang_1.isPresent(directiveProperties)) { + var boundPropsByName = new Map(); + boundProps.forEach(function(boundProp) { + var key = util_1.dashCaseToCamelCase(boundProp.name); + var prevValue = boundPropsByName.get(boundProp.name); + if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { + boundPropsByName.set(key, boundProp); + } + }); + collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { + elProp = util_1.dashCaseToCamelCase(elProp); + var boundProp = boundPropsByName.get(elProp); + if (lang_1.isPresent(boundProp)) { + targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceInfo)); + } + }); + } + }; + TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { + var _this = this; + var boundElementProps = []; + var boundDirectivePropsIndex = new Map(); + directives.forEach(function(directive) { + directive.inputs.forEach(function(prop) { + boundDirectivePropsIndex.set(prop.templateName, prop); + }); + }); + props.forEach(function(prop) { + if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { + boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceInfo)); + } + }); + return boundElementProps; + }; + TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceInfo) { + var unit = null; + var bindingType; + var boundPropertyName; + var parts = lang_1.StringWrapper.split(name, PROPERTY_PARTS_SEPARATOR); + if (parts.length === 1) { + boundPropertyName = this._schemaRegistry.getMappedPropName(util_1.dashCaseToCamelCase(parts[0])); + bindingType = template_ast_1.PropertyBindingType.Property; + if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { + this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property in " + sourceInfo); + } + } else if (parts[0] == ATTRIBUTE_PREFIX) { + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Attribute; + } else if (parts[0] == CLASS_PREFIX) { + boundPropertyName = parts[1]; + bindingType = template_ast_1.PropertyBindingType.Class; + } else if (parts[0] == STYLE_PREFIX) { + unit = parts.length > 2 ? parts[2] : null; + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Style; + } else { + this._reportError("Invalid property name " + name + " in " + sourceInfo); + bindingType = null; + } + return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceInfo); + }; + TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { + var componentTypeNames = []; + directives.forEach(function(directive) { + var typeName = directive.directive.type.name; + if (directive.directive.isComponent) { + componentTypeNames.push(typeName); + } + }); + return componentTypeNames; + }; + TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceInfo) { + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 1) { + this._reportError("More than one component: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + }; + TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceInfo) { + var _this = this; + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 0) { + this._reportError("Components on an embedded template: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + elementProps.forEach(function(prop) { + _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template in " + prop.sourceInfo); + }); + }; + TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events, sourceInfo) { + var _this = this; + var allDirectiveEvents = new Set(); + directives.forEach(function(directive) { + collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { + allDirectiveEvents.add(eventName); + }); + }); + events.forEach(function(event) { + if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { + _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template in " + sourceInfo); + } + }); + }; + return TemplateParseVisitor; + })(); + var NonBindableVisitor = (function() { + function NonBindableVisitor() {} + NonBindableVisitor.prototype.visitElement = function(ast, component) { + var preparsedElement = template_preparser_1.preparseElement(ast); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { + return null; + } + var attrNameAndValues = ast.attrs.map(function(attrAst) { + return [attrAst.name, attrAst.value]; + }); + var selector = createElementCssSelector(ast.name, attrNameAndValues); + var ngContentIndex = component.findNgContentIndex(selector); + var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); + return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitAttr = function(ast, context) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + }; + return NonBindableVisitor; + })(); + var BoundElementOrDirectiveProperty = (function() { + function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceInfo) { + this.name = name; + this.expression = expression; + this.isLiteral = isLiteral; + this.sourceInfo = sourceInfo; + } + return BoundElementOrDirectiveProperty; + })(); + function splitClasses(classAttrValue) { + return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); + } + exports.splitClasses = splitClasses; + var Component = (function() { + function Component(ngContentIndexMatcher, wildcardNgContentIndex) { + this.ngContentIndexMatcher = ngContentIndexMatcher; + this.wildcardNgContentIndex = wildcardNgContentIndex; + } + Component.create = function(directives) { + if (directives.length === 0 || !directives[0].directive.isComponent) { + return EMPTY_COMPONENT; + } + var matcher = new selector_1.SelectorMatcher(); + var ngContentSelectors = directives[0].directive.template.ngContentSelectors; + var wildcardNgContentIndex = null; + for (var i = 0; i < ngContentSelectors.length; i++) { + var selector = ngContentSelectors[i]; + if (lang_1.StringWrapper.equals(selector, '*')) { + wildcardNgContentIndex = i; + } else { + matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); + } + } + return new Component(matcher, wildcardNgContentIndex); + }; + Component.prototype.findNgContentIndex = function(selector) { + var ngContentIndices = []; + this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { + ngContentIndices.push(ngContentIndex); + }); + collection_1.ListWrapper.sort(ngContentIndices); + if (lang_1.isPresent(this.wildcardNgContentIndex)) { + ngContentIndices.push(this.wildcardNgContentIndex); + } + return ngContentIndices.length > 0 ? ngContentIndices[0] : null; + }; + return Component; + })(); + function createElementCssSelector(elementName, matchableAttrs) { + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(elementName); + for (var i = 0; i < matchableAttrs.length; i++) { + var attrName = matchableAttrs[i][0].toLowerCase(); + var attrValue = matchableAttrs[i][1]; + cssSelector.addAttribute(attrName, attrValue); + if (attrName == CLASS_ATTR) { + var classes = splitClasses(attrValue); + classes.forEach(function(className) { + return cssSelector.addClassName(className); + }); + } + } + return cssSelector; + } + var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); + var NON_BINDABLE_VISITOR = new NonBindableVisitor(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/core/dom/generic_browser_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var generic_browser_adapter_1 = require("angular2/src/core/dom/generic_browser_adapter"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var DOM_KEY_LOCATION_NUMPAD = 3; + var _keyMap = { + '\b': 'Backspace', + '\t': 'Tab', + '\x7F': 'Delete', + '\x1B': 'Escape', + 'Del': 'Delete', + 'Esc': 'Escape', + 'Left': 'ArrowLeft', + 'Right': 'ArrowRight', + 'Up': 'ArrowUp', + 'Down': 'ArrowDown', + 'Menu': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'Win': 'OS' + }; + var _chromeNumKeyPadMap = { + 'A': '1', + 'B': '2', + 'C': '3', + 'D': '4', + 'E': '5', + 'F': '6', + 'G': '7', + 'H': '8', + 'I': '9', + 'J': '*', + 'K': '+', + 'M': '-', + 'N': '.', + 'O': '/', + '\x60': '0', + '\x90': 'NumLock' + }; + var BrowserDomAdapter = (function(_super) { + __extends(BrowserDomAdapter, _super); + function BrowserDomAdapter() { + _super.apply(this, arguments); + } + BrowserDomAdapter.prototype.parse = function(templateHtml) { + throw new Error("parse not implemented"); + }; + BrowserDomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); + }; + BrowserDomAdapter.prototype.hasProperty = function(element, name) { + return name in element; + }; + BrowserDomAdapter.prototype.setProperty = function(el, name, value) { + el[name] = value; + }; + BrowserDomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { + el[methodName].apply(el, args); + }; + BrowserDomAdapter.prototype.logError = function(error) { + if (window.console.error) { + window.console.error(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.log = function(error) { + window.console.log(error); + }; + BrowserDomAdapter.prototype.logGroup = function(error) { + if (window.console.group) { + window.console.group(error); + this.logError(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.logGroupEnd = function() { + if (window.console.groupEnd) { + window.console.groupEnd(); + } + }; + Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + BrowserDomAdapter.prototype.query = function(selector) { + return document.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelector = function(el, selector) { + return el.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { + return el.querySelectorAll(selector); + }; + BrowserDomAdapter.prototype.on = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + }; + BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + return function() { + el.removeEventListener(evt, listener, false); + }; + }; + BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { + el.dispatchEvent(evt); + }; + BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { + var evt = document.createEvent('MouseEvent'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.createEvent = function(eventType) { + var evt = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.preventDefault = function(evt) { + evt.preventDefault(); + evt.returnValue = false; + }; + BrowserDomAdapter.prototype.isPrevented = function(evt) { + return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + BrowserDomAdapter.prototype.getInnerHTML = function(el) { + return el.innerHTML; + }; + BrowserDomAdapter.prototype.getOuterHTML = function(el) { + return el.outerHTML; + }; + BrowserDomAdapter.prototype.nodeName = function(node) { + return node.nodeName; + }; + BrowserDomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + BrowserDomAdapter.prototype.type = function(node) { + return node.type; + }; + BrowserDomAdapter.prototype.content = function(node) { + if (this.hasProperty(node, "content")) { + return node.content; + } else { + return node; + } + }; + BrowserDomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + BrowserDomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + BrowserDomAdapter.prototype.parentElement = function(el) { + return el.parentNode; + }; + BrowserDomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + BrowserDomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + BrowserDomAdapter.prototype.clearNodes = function(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }; + BrowserDomAdapter.prototype.appendChild = function(el, node) { + el.appendChild(node); + }; + BrowserDomAdapter.prototype.removeChild = function(el, node) { + el.removeChild(node); + }; + BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { + el.replaceChild(newChild, oldChild); + }; + BrowserDomAdapter.prototype.remove = function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + return node; + }; + BrowserDomAdapter.prototype.insertBefore = function(el, node) { + el.parentNode.insertBefore(node, el); + }; + BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { + nodes.forEach(function(n) { + return el.parentNode.insertBefore(n, el); + }); + }; + BrowserDomAdapter.prototype.insertAfter = function(el, node) { + el.parentNode.insertBefore(node, el.nextSibling); + }; + BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { + el.innerHTML = value; + }; + BrowserDomAdapter.prototype.getText = function(el) { + return el.textContent; + }; + BrowserDomAdapter.prototype.setText = function(el, value) { + el.textContent = value; + }; + BrowserDomAdapter.prototype.getValue = function(el) { + return el.value; + }; + BrowserDomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + BrowserDomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + BrowserDomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + BrowserDomAdapter.prototype.createComment = function(text) { + return document.createComment(text); + }; + BrowserDomAdapter.prototype.createTemplate = function(html) { + var t = document.createElement('template'); + t.innerHTML = html; + return t; + }; + BrowserDomAdapter.prototype.createElement = function(tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElement(tagName); + }; + BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElementNS(ns, tagName); + }; + BrowserDomAdapter.prototype.createTextNode = function(text, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createTextNode(text); + }; + BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { + if (doc === void 0) { + doc = document; + } + var el = doc.createElement('SCRIPT'); + el.setAttribute(attrName, attrValue); + return el; + }; + BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { + if (doc === void 0) { + doc = document; + } + var style = doc.createElement('style'); + this.appendChild(style, this.createTextNode(css)); + return style; + }; + BrowserDomAdapter.prototype.createShadowRoot = function(el) { + return el.createShadowRoot(); + }; + BrowserDomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + BrowserDomAdapter.prototype.getHost = function(el) { + return el.host; + }; + BrowserDomAdapter.prototype.clone = function(node) { + return node.cloneNode(true); + }; + BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { + return element.getElementsByClassName(name); + }; + BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { + return element.getElementsByTagName(name); + }; + BrowserDomAdapter.prototype.classList = function(element) { + return Array.prototype.slice.call(element.classList, 0); + }; + BrowserDomAdapter.prototype.addClass = function(element, classname) { + element.classList.add(classname); + }; + BrowserDomAdapter.prototype.removeClass = function(element, classname) { + element.classList.remove(classname); + }; + BrowserDomAdapter.prototype.hasClass = function(element, classname) { + return element.classList.contains(classname); + }; + BrowserDomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + element.style[stylename] = stylevalue; + }; + BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { + element.style[stylename] = null; + }; + BrowserDomAdapter.prototype.getStyle = function(element, stylename) { + return element.style[stylename]; + }; + BrowserDomAdapter.prototype.tagName = function(element) { + return element.tagName; + }; + BrowserDomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = element.attributes; + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.hasAttribute(attribute); + }; + BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { + return element.getAttribute(attribute); + }; + BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { + element.setAttribute(name, value); + }; + BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { + element.setAttributeNS(ns, name, value); + }; + BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { + element.removeAttribute(attribute); + }; + BrowserDomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + BrowserDomAdapter.prototype.createHtmlDocument = function() { + return document.implementation.createHTMLDocument('fakeTitle'); + }; + BrowserDomAdapter.prototype.defaultDoc = function() { + return document; + }; + BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { + try { + return el.getBoundingClientRect(); + } catch (e) { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; + } + }; + BrowserDomAdapter.prototype.getTitle = function() { + return document.title; + }; + BrowserDomAdapter.prototype.setTitle = function(newTitle) { + document.title = newTitle || ''; + }; + BrowserDomAdapter.prototype.elementMatches = function(n, selector) { + var matches = false; + if (n instanceof HTMLElement) { + if (n.matches) { + matches = n.matches(selector); + } else if (n.msMatchesSelector) { + matches = n.msMatchesSelector(selector); + } else if (n.webkitMatchesSelector) { + matches = n.webkitMatchesSelector(selector); + } + } + return matches; + }; + BrowserDomAdapter.prototype.isTemplateElement = function(el) { + return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; + }; + BrowserDomAdapter.prototype.isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + BrowserDomAdapter.prototype.isCommentNode = function(node) { + return node.nodeType === Node.COMMENT_NODE; + }; + BrowserDomAdapter.prototype.isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + BrowserDomAdapter.prototype.hasShadowRoot = function(node) { + return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); + }; + BrowserDomAdapter.prototype.isShadowRoot = function(node) { + return node instanceof DocumentFragment; + }; + BrowserDomAdapter.prototype.importIntoDoc = function(node) { + var toImport = node; + if (this.isTemplateElement(node)) { + toImport = this.content(node); + } + return document.importNode(toImport, true); + }; + BrowserDomAdapter.prototype.adoptNode = function(node) { + return document.adoptNode(node); + }; + BrowserDomAdapter.prototype.getHref = function(el) { + return el.href; + }; + BrowserDomAdapter.prototype.getEventKey = function(event) { + var key = event.key; + if (lang_1.isBlank(key)) { + key = event.keyIdentifier; + if (lang_1.isBlank(key)) { + return 'Unidentified'; + } + if (key.startsWith('U+')) { + key = String.fromCharCode(parseInt(key.substring(2), 16)); + if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { + key = _chromeNumKeyPadMap[key]; + } + } + } + if (_keyMap.hasOwnProperty(key)) { + key = _keyMap[key]; + } + return key; + }; + BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return window; + } else if (target == "document") { + return document; + } else if (target == "body") { + return document.body; + } + }; + BrowserDomAdapter.prototype.getHistory = function() { + return window.history; + }; + BrowserDomAdapter.prototype.getLocation = function() { + return window.location; + }; + BrowserDomAdapter.prototype.getBaseHref = function() { + var href = getBaseElementHref(); + if (lang_1.isBlank(href)) { + return null; + } + return relativePath(href); + }; + BrowserDomAdapter.prototype.resetBaseElement = function() { + baseElement = null; + }; + BrowserDomAdapter.prototype.getUserAgent = function() { + return window.navigator.userAgent; + }; + BrowserDomAdapter.prototype.setData = function(element, name, value) { + this.setAttribute(element, 'data-' + name, value); + }; + BrowserDomAdapter.prototype.getData = function(element, name) { + return this.getAttribute(element, 'data-' + name); + }; + BrowserDomAdapter.prototype.getComputedStyle = function(element) { + return getComputedStyle(element); + }; + BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { + return window.requestAnimationFrame(callback); + }; + BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { + window.cancelAnimationFrame(id); + }; + BrowserDomAdapter.prototype.performanceNow = function() { + if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { + return window.performance.now(); + } else { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + } + }; + return BrowserDomAdapter; + })(generic_browser_adapter_1.GenericBrowserDomAdapter); + exports.BrowserDomAdapter = BrowserDomAdapter; + var baseElement = null; + function getBaseElementHref() { + if (lang_1.isBlank(baseElement)) { + baseElement = document.querySelector('base'); + if (lang_1.isBlank(baseElement)) { + return null; + } + } + return baseElement.getAttribute('href'); + } + var urlParsingNode = null; + function relativePath(url) { + if (lang_1.isBlank(urlParsingNode)) { + urlParsingNode = document.createElement("a"); + } + urlParsingNode.setAttribute('href', url); + return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/angular2", "angular2/src/core/application_common", "angular2/src/core/application_ref", "angular2/src/compiler/compiler", "angular2/src/facade/async", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/upgrade/metadata"); + var util_1 = require("angular2/src/upgrade/util"); + var constants_1 = require("angular2/src/upgrade/constants"); + var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter"); + var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter"); + var angular = require("angular2/src/upgrade/angular_js"); + var upgradeCount = 0; + var UpgradeAdapter = (function() { + function UpgradeAdapter() { + this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_"; + this.upgradedComponents = []; + this.downgradedComponents = {}; + this.providers = []; + } + UpgradeAdapter.prototype.downgradeNg2Component = function(type) { + this.upgradedComponents.push(type); + var info = metadata_1.getComponentInfo(type); + return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c"); + }; + UpgradeAdapter.prototype.upgradeNg1Component = function(name) { + if (this.downgradedComponents.hasOwnProperty(name)) { + return this.downgradedComponents[name].type; + } else { + return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type; + } + }; + UpgradeAdapter.prototype.bootstrap = function(element, modules, config) { + var _this = this; + var upgrade = new UpgradeAdapterRef(); + var ng1Injector = null; + var platformRef = angular2_1.platform(); + var applicationRef = platformRef.application([application_ref_1.applicationCommonProviders(), application_common_1.applicationDomProviders(), compiler_1.compilerProviders(), angular2_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() { + return ng1Injector; + }}), angular2_1.provide(constants_1.NG1_COMPILE, {useFactory: function() { + return ng1Injector.get(constants_1.NG1_COMPILE); + }}), this.providers]); + var injector = applicationRef.injector; + var ngZone = injector.get(angular2_1.NgZone); + var compiler = injector.get(angular2_1.Compiler); + var delayApplyExps = []; + var original$applyFn; + var rootScopePrototype; + var rootScope; + var protoViewRefMap = {}; + var ng1Module = angular.module(this.idPrefix, modules); + var ng1compilePromise = null; + ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(angular2_1.AppViewManager)).config(['$provide', function(provide) { + provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) { + rootScopePrototype = rootScopeDelegate.constructor.prototype; + if (rootScopePrototype.hasOwnProperty('$apply')) { + original$applyFn = rootScopePrototype.$apply; + rootScopePrototype.$apply = function(exp) { + return delayApplyExps.push(exp); + }; + } else { + throw new Error("Failed to find '$apply' on '$rootScope'!"); + } + return rootScope = rootScopeDelegate; + }]); + }]).run(['$injector', '$rootScope', function(injector, rootScope) { + ng1Injector = injector; + async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) { + ngZone.run(function() { + return rootScope.$apply(); + }); + }); + ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector); + }]); + angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector); + ngZone.run(function() { + angular.bootstrap(element, [_this.idPrefix], config); + }); + Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() { + ngZone.run(function() { + if (rootScopePrototype) { + rootScopePrototype.$apply = original$applyFn; + while (delayApplyExps.length) { + rootScope.$apply(delayApplyExps.shift()); + } + upgrade._bootstrapDone(applicationRef, ng1Injector); + rootScopePrototype = null; + } + }); + }, util_1.onError); + return upgrade; + }; + UpgradeAdapter.prototype.addProvider = function(provider) { + this.providers.push(provider); + }; + UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) { + var token = options && options.asToken || name; + this.providers.push(angular2_1.provide(token, { + useFactory: function(ng1Injector) { + return ng1Injector.get(name); + }, + deps: [constants_1.NG1_INJECTOR] + })); + }; + UpgradeAdapter.prototype.downgradeNg2Provider = function(token) { + var factory = function(injector) { + return injector.get(token); + }; + factory.$inject = [constants_1.NG2_INJECTOR]; + return factory; + }; + UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) { + var _this = this; + var promises = []; + var types = this.upgradedComponents; + for (var i = 0; i < types.length; i++) { + promises.push(compiler.compileInHost(types[i])); + } + return Promise.all(promises).then(function(protoViews) { + var types = _this.upgradedComponents; + for (var i = 0; i < protoViews.length; i++) { + protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i]; + } + return protoViewRefMap; + }, util_1.onError); + }; + return UpgradeAdapter; + })(); + exports.UpgradeAdapter = UpgradeAdapter; + function ng1ComponentDirective(info, idPrefix) { + directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE]; + function directiveFactory(protoViewRefMap, viewManager, parse) { + var protoView = protoViewRefMap[info.selector]; + if (!protoView) + throw new Error('Expecting ProtoViewRef for: ' + info.selector); + var idCount = 0; + return { + restrict: 'E', + require: constants_1.REQUIRE_INJECTOR, + link: {post: function(scope, element, attrs, parentInjector, transclude) { + var domElement = element[0]; + var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView); + facade.setupInputs(); + facade.bootstrapNg2(); + facade.projectContent(); + facade.setupOutputs(); + facade.registerCleanup(); + }} + }; + } + return directiveFactory; + } + var UpgradeAdapterRef = (function() { + function UpgradeAdapterRef() { + this._readyFn = null; + this.ng1RootScope = null; + this.ng1Injector = null; + this.ng2ApplicationRef = null; + this.ng2Injector = null; + } + UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) { + this.ng2ApplicationRef = applicationRef; + this.ng2Injector = applicationRef.injector; + this.ng1Injector = ng1Injector; + this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE); + this._readyFn && this._readyFn(this); + }; + UpgradeAdapterRef.prototype.ready = function(fn) { + this._readyFn = fn; + }; + UpgradeAdapterRef.prototype.dispose = function() { + this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy(); + this.ng2ApplicationRef.dispose(); + }; + return UpgradeAdapterRef; + })(); + exports.UpgradeAdapterRef = UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/instruction", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var instruction_1 = require("angular2/src/router/instruction"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var _resolveToFalse = async_1.PromiseWrapper.resolve(false); + var Router = (function() { + function Router(registry, parent, hostComponent) { + this.registry = registry; + this.parent = parent; + this.hostComponent = hostComponent; + this.navigating = false; + this._currentInstruction = null; + this._currentNavigation = _resolveToTrue; + this._outlet = null; + this._auxRouters = new collection_1.Map(); + this._subject = new async_1.EventEmitter(); + } + Router.prototype.childRouter = function(hostComponent) { + return this._childRouter = new ChildRouter(this, hostComponent); + }; + Router.prototype.auxRouter = function(hostComponent) { + return new ChildRouter(this, hostComponent); + }; + Router.prototype.registerPrimaryOutlet = function(outlet) { + if (lang_1.isPresent(outlet.name)) { + throw new exceptions_1.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet."); + } + this._outlet = outlet; + if (lang_1.isPresent(this._currentInstruction)) { + return this.commit(this._currentInstruction, false); + } + return _resolveToTrue; + }; + Router.prototype.registerAuxOutlet = function(outlet) { + var outletName = outlet.name; + if (lang_1.isBlank(outletName)) { + throw new exceptions_1.BaseException("registerAuxOutlet expects to be called with an outlet with a name."); + } + var router = this.auxRouter(this.hostComponent); + this._auxRouters.set(outletName, router); + router._outlet = outlet; + var auxInstruction; + if (lang_1.isPresent(this._currentInstruction) && lang_1.isPresent(auxInstruction = this._currentInstruction.auxInstruction[outletName])) { + return router.commit(auxInstruction); + } + return _resolveToTrue; + }; + Router.prototype.isRouteActive = function(instruction) { + var router = this; + while (lang_1.isPresent(router.parent) && lang_1.isPresent(instruction.child)) { + router = router.parent; + instruction = instruction.child; + } + return lang_1.isPresent(this._currentInstruction) && this._currentInstruction.component == instruction.component; + }; + Router.prototype.config = function(definitions) { + var _this = this; + definitions.forEach(function(routeDefinition) { + _this.registry.config(_this.hostComponent, routeDefinition); + }); + return this.renavigate(); + }; + Router.prototype.navigate = function(linkParams) { + var instruction = this.generate(linkParams); + return this.navigateByInstruction(instruction, false); + }; + Router.prototype.navigateByUrl = function(url, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this.lastNavigationAttempt = url; + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this.recognize(url).then(function(instruction) { + if (lang_1.isBlank(instruction)) { + return false; + } + return _this._navigate(instruction, _skipLocationChange); + })); + }); + }; + Router.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + if (lang_1.isBlank(instruction)) { + return _resolveToFalse; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this._navigate(instruction, _skipLocationChange)); + }); + }; + Router.prototype._navigate = function(instruction, _skipLocationChange) { + var _this = this; + return this._settleInstruction(instruction).then(function(_) { + return _this._canReuse(instruction); + }).then(function(_) { + return _this._canActivate(instruction); + }).then(function(result) { + if (!result) { + return false; + } + return _this._canDeactivate(instruction).then(function(result) { + if (result) { + return _this.commit(instruction, _skipLocationChange).then(function(_) { + _this._emitNavigationFinish(instruction_1.stringifyInstruction(instruction)); + return true; + }); + } + }); + }); + }; + Router.prototype._settleInstruction = function(instruction) { + var _this = this; + var unsettledInstructions = []; + if (lang_1.isBlank(instruction.component.componentType)) { + unsettledInstructions.push(instruction.component.resolveComponentType().then(function(type) { + _this.registry.configFromComponent(type); + })); + } + if (lang_1.isPresent(instruction.child)) { + unsettledInstructions.push(this._settleInstruction(instruction.child)); + } + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(instruction, _) { + unsettledInstructions.push(_this._settleInstruction(instruction)); + }); + return async_1.PromiseWrapper.all(unsettledInstructions); + }; + Router.prototype._emitNavigationFinish = function(url) { + async_1.ObservableWrapper.callNext(this._subject, url); + }; + Router.prototype._afterPromiseFinishNavigating = function(promise) { + var _this = this; + return async_1.PromiseWrapper.catchError(promise.then(function(_) { + return _this._finishNavigating(); + }), function(err) { + _this._finishNavigating(); + throw err; + }); + }; + Router.prototype._canReuse = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToFalse; + } + return this._outlet.canReuse(instruction.component).then(function(result) { + instruction.component.reuse = result; + if (result && lang_1.isPresent(_this._childRouter) && lang_1.isPresent(instruction.child)) { + return _this._childRouter._canReuse(instruction.child); + } + }); + }; + Router.prototype._canActivate = function(nextInstruction) { + return canActivateOne(nextInstruction, this._currentInstruction); + }; + Router.prototype._canDeactivate = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToTrue; + } + var next; + var childInstruction = null; + var reuse = false; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + reuse = instruction.component.reuse; + } + if (reuse) { + next = _resolveToTrue; + } else { + next = this._outlet.canDeactivate(componentInstruction); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter._canDeactivate(childInstruction); + } + return true; + }); + }; + Router.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + this._currentInstruction = instruction; + var next = _resolveToTrue; + if (lang_1.isPresent(this._outlet)) { + var componentInstruction = instruction.component; + if (componentInstruction.reuse) { + next = this._outlet.reuse(componentInstruction); + } else { + next = this.deactivate(instruction).then(function(_) { + return _this._outlet.activate(componentInstruction); + }); + } + if (lang_1.isPresent(instruction.child)) { + next = next.then(function(_) { + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter.commit(instruction.child); + } + }); + } + } + var promises = []; + this._auxRouters.forEach(function(router, name) { + if (lang_1.isPresent(instruction.auxInstruction[name])) { + promises.push(router.commit(instruction.auxInstruction[name])); + } + }); + return next.then(function(_) { + return async_1.PromiseWrapper.all(promises); + }); + }; + Router.prototype._startNavigating = function() { + this.navigating = true; + }; + Router.prototype._finishNavigating = function() { + this.navigating = false; + }; + Router.prototype.subscribe = function(onNext) { + return async_1.ObservableWrapper.subscribe(this._subject, onNext); + }; + Router.prototype.deactivate = function(instruction) { + var _this = this; + var childInstruction = null; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + } + var next = _resolveToTrue; + if (lang_1.isPresent(this._childRouter)) { + next = this._childRouter.deactivate(childInstruction); + } + if (lang_1.isPresent(this._outlet)) { + next = next.then(function(_) { + return _this._outlet.deactivate(componentInstruction); + }); + } + return next; + }; + Router.prototype.recognize = function(url) { + return this.registry.recognize(url, this.hostComponent); + }; + Router.prototype.renavigate = function() { + if (lang_1.isBlank(this.lastNavigationAttempt)) { + return this._currentNavigation; + } + return this.navigateByUrl(this.lastNavigationAttempt); + }; + Router.prototype.generate = function(linkParams) { + var normalizedLinkParams = splitAndFlattenLinkParams(linkParams); + var first = collection_1.ListWrapper.first(normalizedLinkParams); + var rest = collection_1.ListWrapper.slice(normalizedLinkParams, 1); + var router = this; + if (first == '') { + while (lang_1.isPresent(router.parent)) { + router = router.parent; + } + } else if (first == '..') { + router = router.parent; + while (collection_1.ListWrapper.first(rest) == '..') { + rest = collection_1.ListWrapper.slice(rest, 1); + router = router.parent; + if (lang_1.isBlank(router)) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" has too many \"../\" segments."); + } + } + } else if (first != '.') { + var childRouteExists = this.registry.hasRoute(first, this.hostComponent); + var parentRouteExists = lang_1.isPresent(this.parent) && this.registry.hasRoute(first, this.parent.hostComponent); + if (parentRouteExists && childRouteExists) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" is ambiguous, use \"./\" or \"../\" to disambiguate."; + throw new exceptions_1.BaseException(msg); + } + if (parentRouteExists) { + router = this.parent; + } + rest = linkParams; + } + if (rest[rest.length - 1] == '') { + rest.pop(); + } + if (rest.length < 1) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" must include a route name."; + throw new exceptions_1.BaseException(msg); + } + var nextInstruction = this.registry.generate(rest, router.hostComponent); + var url = []; + var parent = router.parent; + while (lang_1.isPresent(parent)) { + url.unshift(parent._currentInstruction); + parent = parent.parent; + } + while (url.length > 0) { + nextInstruction = url.pop().replaceChild(nextInstruction); + } + return nextInstruction; + }; + return Router; + })(); + exports.Router = Router; + var RootRouter = (function(_super) { + __extends(RootRouter, _super); + function RootRouter(registry, location, primaryComponent) { + var _this = this; + _super.call(this, registry, null, primaryComponent); + this._location = location; + this._locationSub = this._location.subscribe(function(change) { + return _this.navigateByUrl(change['url'], lang_1.isPresent(change['pop'])); + }); + this.registry.configFromComponent(primaryComponent); + this.navigateByUrl(location.path()); + } + RootRouter.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + var emitPath = instruction_1.stringifyInstructionPath(instruction); + var emitQuery = instruction_1.stringifyInstructionQuery(instruction); + if (emitPath.length > 0) { + emitPath = '/' + emitPath; + } + var promise = _super.prototype.commit.call(this, instruction); + if (!_skipLocationChange) { + promise = promise.then(function(_) { + _this._location.go(emitPath, emitQuery); + }); + } + return promise; + }; + RootRouter.prototype.dispose = function() { + if (lang_1.isPresent(this._locationSub)) { + async_1.ObservableWrapper.dispose(this._locationSub); + this._locationSub = null; + } + }; + return RootRouter; + })(Router); + exports.RootRouter = RootRouter; + var ChildRouter = (function(_super) { + __extends(ChildRouter, _super); + function ChildRouter(parent, hostComponent) { + _super.call(this, parent.registry, parent, hostComponent); + this.parent = parent; + } + ChildRouter.prototype.navigateByUrl = function(url, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByUrl(url, _skipLocationChange); + }; + ChildRouter.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByInstruction(instruction, _skipLocationChange); + }; + return ChildRouter; + })(Router); + function splitAndFlattenLinkParams(linkParams) { + return linkParams.reduce(function(accumulation, item) { + if (lang_1.isString(item)) { + var strItem = item; + return accumulation.concat(strItem.split('/')); + } + accumulation.push(item); + return accumulation; + }, []); + } + function canActivateOne(nextInstruction, prevInstruction) { + var next = _resolveToTrue; + if (lang_1.isPresent(nextInstruction.child)) { + next = canActivateOne(nextInstruction.child, lang_1.isPresent(prevInstruction) ? prevInstruction.child : null); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (nextInstruction.component.reuse) { + return true; + } + var hook = route_lifecycle_reflector_1.getCanActivateHook(nextInstruction.component.componentType); + if (lang_1.isPresent(hook)) { + return hook(nextInstruction.component, lang_1.isPresent(prevInstruction) ? prevInstruction.component : null); + } + return true; + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_link", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/router/router", "angular2/src/router/location", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var router_1 = require("angular2/src/router/router"); + var location_1 = require("angular2/src/router/location"); + var instruction_1 = require("angular2/src/router/instruction"); + var RouterLink = (function() { + function RouterLink(_router, _location) { + this._router = _router; + this._location = _location; + } + Object.defineProperty(RouterLink.prototype, "isRouteActive", { + get: function() { + return this._router.isRouteActive(this._navigationInstruction); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RouterLink.prototype, "routeParams", { + set: function(changes) { + this._routeParams = changes; + this._navigationInstruction = this._router.generate(this._routeParams); + var navigationHref = instruction_1.stringifyInstruction(this._navigationInstruction); + this.visibleHref = this._location.prepareExternalUrl(navigationHref); + }, + enumerable: true, + configurable: true + }); + RouterLink.prototype.onClick = function() { + if (!lang_1.isString(this.target) || this.target == '_self') { + this._router.navigateByInstruction(this._navigationInstruction); + return false; + } + return true; + }; + RouterLink = __decorate([angular2_1.Directive({ + selector: '[router-link]', + inputs: ['routeParams: routerLink', 'target: target'], + host: { + '(click)': 'onClick()', + '[attr.href]': 'visibleHref', + '[class.router-link-active]': 'isRouteActive' + } + }), __metadata('design:paramtypes', [router_1.Router, location_1.Location])], RouterLink); + return RouterLink; + })(); + exports.RouterLink = RouterLink; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/path_recognizer", "angular2/src/router/route_config_impl", "angular2/src/router/async_route_handler", "angular2/src/router/sync_route_handler", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var path_recognizer_1 = require("angular2/src/router/path_recognizer"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var async_route_handler_1 = require("angular2/src/router/async_route_handler"); + var sync_route_handler_1 = require("angular2/src/router/sync_route_handler"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var RouteRecognizer = (function() { + function RouteRecognizer() { + this.names = new collection_1.Map(); + this.auxRoutes = new collection_1.Map(); + this.matchers = []; + this.redirects = []; + } + RouteRecognizer.prototype.config = function(config) { + var handler; + if (lang_1.isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) { + var suggestedName = config.name[0].toUpperCase() + config.name.substring(1); + throw new exceptions_1.BaseException("Route \"" + config.path + "\" with name \"" + config.name + "\" does not begin with an uppercase letter. Route names should be CamelCase like \"" + suggestedName + "\"."); + } + if (config instanceof route_config_impl_1.AuxRoute) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + var path = config.path.startsWith('/') ? config.path.substring(1) : config.path; + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.auxRoutes.set(path, recognizer); + return recognizer.terminal; + } + if (config instanceof route_config_impl_1.Redirect) { + this.redirects.push(new Redirector(config.path, config.redirectTo)); + return true; + } + if (config instanceof route_config_impl_1.Route) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + } else if (config instanceof route_config_impl_1.AsyncRoute) { + handler = new async_route_handler_1.AsyncRouteHandler(config.loader, config.data); + } + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.matchers.forEach(function(matcher) { + if (recognizer.hash == matcher.hash) { + throw new exceptions_1.BaseException("Configuration '" + config.path + "' conflicts with existing route '" + matcher.path + "'"); + } + }); + this.matchers.push(recognizer); + if (lang_1.isPresent(config.name)) { + this.names.set(config.name, recognizer); + } + return recognizer.terminal; + }; + RouteRecognizer.prototype.recognize = function(urlParse) { + var solutions = []; + urlParse = this._redirect(urlParse); + this.matchers.forEach(function(pathRecognizer) { + var pathMatch = pathRecognizer.recognize(urlParse); + if (lang_1.isPresent(pathMatch)) { + solutions.push(pathMatch); + } + }); + return solutions; + }; + RouteRecognizer.prototype._redirect = function(urlParse) { + for (var i = 0; i < this.redirects.length; i += 1) { + var redirector = this.redirects[i]; + var redirectedUrl = redirector.redirect(urlParse); + if (lang_1.isPresent(redirectedUrl)) { + return redirectedUrl; + } + } + return urlParse; + }; + RouteRecognizer.prototype.recognizeAuxiliary = function(urlParse) { + var pathRecognizer = this.auxRoutes.get(urlParse.path); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.recognize(urlParse); + }; + RouteRecognizer.prototype.hasRoute = function(name) { + return this.names.has(name); + }; + RouteRecognizer.prototype.generate = function(name, params) { + var pathRecognizer = this.names.get(name); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.generate(params); + }; + return RouteRecognizer; + })(); + exports.RouteRecognizer = RouteRecognizer; + var Redirector = (function() { + function Redirector(path, redirectTo) { + this.segments = []; + this.toSegments = []; + if (path.startsWith('/')) { + path = path.substring(1); + } + this.segments = path.split('/'); + if (redirectTo.startsWith('/')) { + redirectTo = redirectTo.substring(1); + } + this.toSegments = redirectTo.split('/'); + } + Redirector.prototype.redirect = function(urlParse) { + for (var i = 0; i < this.segments.length; i += 1) { + if (lang_1.isBlank(urlParse)) { + return null; + } + var segment = this.segments[i]; + if (segment != urlParse.path) { + return null; + } + urlParse = urlParse.child; + } + for (var i = this.toSegments.length - 1; i >= 0; i -= 1) { + var segment = this.toSegments[i]; + urlParse = new url_parser_1.Url(segment, urlParse); + } + return urlParse; + }; + return Redirector; + })(); + exports.Redirector = Redirector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_request", ["angular2/src/http/headers", "angular2/src/http/http_utils", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var headers_1 = require("angular2/src/http/headers"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var lang_1 = require("angular2/src/facade/lang"); + var Request = (function() { + function Request(requestOptions) { + var url = requestOptions.url; + this.url = requestOptions.url; + if (lang_1.isPresent(requestOptions.search)) { + var search = requestOptions.search.toString(); + if (search.length > 0) { + var prefix = '?'; + if (lang_1.StringWrapper.contains(this.url, '?')) { + prefix = (this.url[this.url.length - 1] == '&') ? '' : '&'; + } + this.url = url + prefix + search; + } + } + this._body = requestOptions.body; + this.method = http_utils_1.normalizeMethodName(requestOptions.method); + this.headers = new headers_1.Headers(requestOptions.headers); + } + Request.prototype.text = function() { + return lang_1.isPresent(this._body) ? this._body.toString() : ''; + }; + return Request; + })(); + exports.Request = Request; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/linker/template_commands", "angular2/src/compiler/directive_metadata", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/command_compiler", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var di_1 = require("angular2/src/core/di"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var command_compiler_2 = require("angular2/src/compiler/command_compiler"); + var util_1 = require("angular2/src/compiler/util"); + var TemplateCompiler = (function() { + function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _commandCompiler, _cdCompiler) { + this._runtimeMetadataResolver = _runtimeMetadataResolver; + this._templateNormalizer = _templateNormalizer; + this._templateParser = _templateParser; + this._styleCompiler = _styleCompiler; + this._commandCompiler = _commandCompiler; + this._cdCompiler = _cdCompiler; + this._hostCacheKeys = new Map(); + this._compiledTemplateCache = new Map(); + this._compiledTemplateDone = new Map(); + this._nextTemplateId = 0; + } + TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { + if (!directive.isComponent) { + return async_1.PromiseWrapper.resolve(directive); + } + return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { + return new directive_metadata_1.CompileDirectiveMetadata({ + type: directive.type, + isComponent: directive.isComponent, + dynamicLoadable: directive.dynamicLoadable, + selector: directive.selector, + exportAs: directive.exportAs, + changeDetection: directive.changeDetection, + inputs: directive.inputs, + outputs: directive.outputs, + hostListeners: directive.hostListeners, + hostProperties: directive.hostProperties, + hostAttributes: directive.hostAttributes, + lifecycleHooks: directive.lifecycleHooks, + template: normalizedTemplate + }); + }); + }; + TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { + var hostCacheKey = this._hostCacheKeys.get(type); + if (lang_1.isBlank(hostCacheKey)) { + hostCacheKey = new Object(); + this._hostCacheKeys.set(type, hostCacheKey); + var compMeta = this._runtimeMetadataResolver.getMetadata(type); + assertComponent(compMeta); + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], new Set()); + } + return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { + return new template_commands_1.CompiledHostTemplate(compiledTemplate); + }); + }; + TemplateCompiler.prototype.clearCache = function() { + this._hostCacheKeys.clear(); + this._styleCompiler.clearCache(); + this._compiledTemplateCache.clear(); + this._compiledTemplateDone.clear(); + }; + TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, compilingComponentCacheKeys) { + var _this = this; + var compiledTemplate = this._compiledTemplateCache.get(cacheKey); + var done = this._compiledTemplateDone.get(cacheKey); + if (lang_1.isBlank(compiledTemplate)) { + var styles = []; + var changeDetectorFactory; + var commands = []; + var templateId = lang_1.stringify(compMeta.type.runtime) + "Template" + this._nextTemplateId++; + compiledTemplate = new template_commands_1.CompiledComponentTemplate(templateId, function(dispatcher) { + return changeDetectorFactory(dispatcher); + }, commands, styles); + this._compiledTemplateCache.set(cacheKey, compiledTemplate); + compilingComponentCacheKeys.add(cacheKey); + done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(viewDirectives.map(function(dirMeta) { + return _this.normalizeDirectiveMetadata(dirMeta); + }))).then(function(stylesAndNormalizedViewDirMetas) { + var childPromises = []; + var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); + var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, compMeta.type.name); + var changeDetectorFactories = _this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); + changeDetectorFactory = changeDetectorFactories[0]; + var tmpStyles = stylesAndNormalizedViewDirMetas[0]; + tmpStyles.forEach(function(style) { + return styles.push(style); + }); + var tmpCommands = _this._compileCommandsRuntime(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises); + tmpCommands.forEach(function(cmd) { + return commands.push(cmd); + }); + return async_1.PromiseWrapper.all(childPromises); + }).then(function(_) { + collection_1.SetWrapper.delete(compilingComponentCacheKeys, cacheKey); + return compiledTemplate; + }); + this._compiledTemplateDone.set(cacheKey, done); + } + return compiledTemplate; + }; + TemplateCompiler.prototype._compileCommandsRuntime = function(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises) { + var _this = this; + var cmds = this._commandCompiler.compileComponentRuntime(compMeta, parsedTemplate, changeDetectorFactories, function(childComponentDir) { + var childCacheKey = childComponentDir.type.runtime; + var childViewDirectives = _this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); + var childIsRecursive = collection_1.SetWrapper.has(compilingComponentCacheKeys, childCacheKey); + var childTemplate = _this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, compilingComponentCacheKeys); + if (!childIsRecursive) { + childPromises.push(_this._compiledTemplateDone.get(childCacheKey)); + } + return function() { + return childTemplate; + }; + }); + cmds.forEach(function(cmd) { + if (cmd instanceof template_commands_1.BeginComponentCmd) { + cmd.templateGetter(); + } + }); + return cmds; + }; + TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { + var _this = this; + if (components.length === 0) { + throw new exceptions_1.BaseException('No components given'); + } + var declarations = []; + var templateArguments = []; + var componentMetas = []; + components.forEach(function(componentWithDirs) { + var compMeta = componentWithDirs.component; + assertComponent(compMeta); + componentMetas.push(compMeta); + _this._processTemplateCodeGen(compMeta, componentWithDirs.directives, declarations, templateArguments); + if (compMeta.dynamicLoadable) { + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + componentMetas.push(hostMeta); + _this._processTemplateCodeGen(hostMeta, [compMeta], declarations, templateArguments); + } + }); + collection_1.ListWrapper.forEachWithIndex(componentMetas, function(compMeta, index) { + var templateId = compMeta.type.moduleUrl + "|" + compMeta.type.name; + var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; + var compiledTemplateExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledComponentTemplate('" + templateId + "'," + templateArguments[index].join(',') + ")"; + var variableValueExpr; + if (compMeta.type.isHost) { + variableValueExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledHostTemplate(" + compiledTemplateExpr + ")"; + } else { + variableValueExpr = compiledTemplateExpr; + } + var varName = templateVariableName(compMeta.type); + declarations.push("" + util_1.codeGenExportVariable(varName) + variableValueExpr + ";"); + declarations.push(util_1.codeGenValueFn([], varName, templateGetterName(compMeta.type)) + ";"); + }); + var moduleUrl = components[0].component.type.moduleUrl; + return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); + }; + TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); + }; + TemplateCompiler.prototype._processTemplateCodeGen = function(compMeta, directives, targetDeclarations, targetTemplateArguments) { + var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); + var parsedTemplate = this._templateParser.parse(compMeta.template.template, directives, compMeta.type.name); + var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); + var commandsExpr = this._commandCompiler.compileComponentCodeGen(compMeta, parsedTemplate, changeDetectorsExprs.expressions, codeGenComponentTemplateFactory); + addAll(styleExpr.declarations, targetDeclarations); + addAll(changeDetectorsExprs.declarations, targetDeclarations); + addAll(commandsExpr.declarations, targetDeclarations); + targetTemplateArguments.push([changeDetectorsExprs.expressions[0], commandsExpr.expression, styleExpr.expression]); + }; + TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler])], TemplateCompiler); + return TemplateCompiler; + })(); + exports.TemplateCompiler = TemplateCompiler; + var NormalizedComponentWithViewDirectives = (function() { + function NormalizedComponentWithViewDirectives(component, directives) { + this.component = component; + this.directives = directives; + } + return NormalizedComponentWithViewDirectives; + })(); + exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; + function assertComponent(meta) { + if (!meta.isComponent) { + throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); + } + } + function templateVariableName(type) { + return type.name + "Template"; + } + function templateGetterName(type) { + return templateVariableName(type) + "Getter"; + } + function templateModuleUrl(moduleUrl) { + var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); + return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; + } + function addAll(source, target) { + for (var i = 0; i < source.length; i++) { + target.push(source[i]); + } + } + function codeGenComponentTemplateFactory(nestedCompType) { + return "" + source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + templateGetterName(nestedCompType.type); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_common", ["angular2/src/common/forms", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/dom/browser_adapter", "angular2/src/core/testability/browser_testability", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr", "angular2/src/compiler/xhr_impl", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/events/key_events", "angular2/src/core/render/dom/events/hammer_gestures", "angular2/src/core/testability/testability", "angular2/src/core/render/api", "angular2/src/core/render/render", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/platform_bindings", "angular2/src/animate/animation_builder", "angular2/src/animate/browser_details", "angular2/src/core/profile/wtf_init", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var forms_1 = require("angular2/src/common/forms"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var browser_testability_1 = require("angular2/src/core/testability/browser_testability"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var key_events_1 = require("angular2/src/core/render/dom/events/key_events"); + var hammer_gestures_1 = require("angular2/src/core/render/dom/events/hammer_gestures"); + var testability_1 = require("angular2/src/core/testability/testability"); + var api_1 = require("angular2/src/core/render/api"); + var render_1 = require("angular2/src/core/render/render"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var platform_bindings_1 = require("angular2/src/core/platform_bindings"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); + var application_ref_1 = require("angular2/src/core/application_ref"); + function applicationDomProviders() { + if (lang_1.isBlank(dom_adapter_1.DOM)) { + throw "Must set a root DOM adapter first."; + } + return [di_1.provide(render_1.DOCUMENT, {useValue: dom_adapter_1.DOM.defaultDoc()}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: key_events_1.KeyEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: hammer_gestures_1.HammerGesturesPlugin, + multi: true + }), di_1.provide(render_1.DomRenderer, {useClass: render_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), shared_styles_host_1.DomSharedStylesHost, di_1.provide(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), platform_bindings_1.EXCEPTION_PROVIDER, di_1.provide(xhr_1.XHR, {useValue: new xhr_impl_1.XHRImpl()}), testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, forms_1.FORM_PROVIDERS]; + } + exports.applicationDomProviders = applicationDomProviders; + function platform(providers) { + return application_ref_1.platformCommon(providers, function() { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + wtf_init_1.wtfInit(); + browser_testability_1.BrowserGetTestability.init(); + }); + } + exports.platform = platform; + function commonBootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var p = platform(); + var bindings = [application_ref_1.applicationCommonProviders(), applicationDomProviders()]; + if (lang_1.isPresent(appProviders)) { + bindings.push(appProviders); + } + return p.application(bindings).bootstrap(appComponentType); + } + exports.commonBootstrap = commonBootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter"); + exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter; + exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_registry", ["angular2/src/router/route_recognizer", "angular2/src/router/instruction", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/route_config_impl", "angular2/src/core/reflection/reflection", "angular2/angular2", "angular2/src/router/route_config_nomalizer", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var route_recognizer_1 = require("angular2/src/router/route_recognizer"); + var instruction_1 = require("angular2/src/router/instruction"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var angular2_1 = require("angular2/angular2"); + var route_config_nomalizer_1 = require("angular2/src/router/route_config_nomalizer"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var _resolveToNull = async_1.PromiseWrapper.resolve(null); + var RouteRegistry = (function() { + function RouteRegistry() { + this._rules = new collection_1.Map(); + } + RouteRegistry.prototype.config = function(parentComponent, config) { + config = route_config_nomalizer_1.normalizeRouteConfig(config); + if (config instanceof route_config_impl_1.Route) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } else if (config instanceof route_config_impl_1.AuxRoute) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } + var recognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(recognizer)) { + recognizer = new route_recognizer_1.RouteRecognizer(); + this._rules.set(parentComponent, recognizer); + } + var terminal = recognizer.config(config); + if (config instanceof route_config_impl_1.Route) { + if (terminal) { + assertTerminalComponent(config.component, config.path); + } else { + this.configFromComponent(config.component); + } + } + }; + RouteRegistry.prototype.configFromComponent = function(component) { + var _this = this; + if (!lang_1.isType(component)) { + return ; + } + if (this._rules.has(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + var routeCfgs = annotation.configs; + routeCfgs.forEach(function(config) { + return _this.config(component, config); + }); + } + } + } + }; + RouteRegistry.prototype.recognize = function(url, parentComponent) { + var parsedUrl = url_parser_1.parser.parse(url); + return this._recognize(parsedUrl, parentComponent); + }; + RouteRegistry.prototype._recognize = function(parsedUrl, parentComponent) { + var _this = this; + return this._recognizePrimaryRoute(parsedUrl, parentComponent).then(function(instruction) { + return _this._completeAuxiliaryRouteMatches(instruction, parentComponent); + }); + }; + RouteRegistry.prototype._recognizePrimaryRoute = function(parsedUrl, parentComponent) { + var _this = this; + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return _resolveToNull; + } + var possibleMatches = componentRecognizer.recognize(parsedUrl); + var matchPromises = possibleMatches.map(function(candidate) { + return _this._completePrimaryRouteMatch(candidate); + }); + return async_1.PromiseWrapper.all(matchPromises).then(mostSpecific); + }; + RouteRegistry.prototype._completePrimaryRouteMatch = function(partialMatch) { + var _this = this; + var instruction = partialMatch.instruction; + return instruction.resolveComponentType().then(function(componentType) { + _this.configFromComponent(componentType); + if (instruction.terminal) { + return new instruction_1.PrimaryInstruction(instruction, null, partialMatch.remainingAux); + } + return _this._recognizePrimaryRoute(partialMatch.remaining, componentType).then(function(childInstruction) { + if (lang_1.isBlank(childInstruction)) { + return null; + } else { + return new instruction_1.PrimaryInstruction(instruction, childInstruction, partialMatch.remainingAux); + } + }); + }); + }; + RouteRegistry.prototype._completeAuxiliaryRouteMatches = function(instruction, parentComponent) { + var _this = this; + if (lang_1.isBlank(instruction)) { + return _resolveToNull; + } + var componentRecognizer = this._rules.get(parentComponent); + var auxInstructions = {}; + var promises = instruction.auxUrls.map(function(auxSegment) { + var match = componentRecognizer.recognizeAuxiliary(auxSegment); + if (lang_1.isBlank(match)) { + return _resolveToNull; + } + return _this._completePrimaryRouteMatch(match).then(function(auxInstruction) { + if (lang_1.isPresent(auxInstruction)) { + return _this._completeAuxiliaryRouteMatches(auxInstruction, parentComponent).then(function(finishedAuxRoute) { + auxInstructions[auxSegment.path] = finishedAuxRoute; + }); + } + }); + }); + return async_1.PromiseWrapper.all(promises).then(function(_) { + if (lang_1.isBlank(instruction.child)) { + return new instruction_1.Instruction(instruction.component, null, auxInstructions); + } + return _this._completeAuxiliaryRouteMatches(instruction.child, instruction.component.componentType).then(function(completeChild) { + return new instruction_1.Instruction(instruction.component, completeChild, auxInstructions); + }); + }); + }; + RouteRegistry.prototype.generate = function(linkParams, parentComponent) { + var segments = []; + var componentCursor = parentComponent; + var lastInstructionIsTerminal = false; + for (var i = 0; i < linkParams.length; i += 1) { + var segment = linkParams[i]; + if (lang_1.isBlank(componentCursor)) { + throw new exceptions_1.BaseException("Could not find route named \"" + segment + "\"."); + } + if (!lang_1.isString(segment)) { + throw new exceptions_1.BaseException("Unexpected segment \"" + segment + "\" in link DSL. Expected a string."); + } else if (segment == '' || segment == '.' || segment == '..') { + throw new exceptions_1.BaseException("\"" + segment + "/\" is only allowed at the beginning of a link DSL."); + } + var params = {}; + if (i + 1 < linkParams.length) { + var nextSegment = linkParams[i + 1]; + if (lang_1.isStringMap(nextSegment)) { + params = nextSegment; + i += 1; + } + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route config."); + } + var response = componentRecognizer.generate(segment, params); + if (lang_1.isBlank(response)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route named \"" + segment + "\"."); + } + segments.push(response); + componentCursor = response.componentType; + lastInstructionIsTerminal = response.terminal; + } + var instruction = null; + if (!lastInstructionIsTerminal) { + instruction = this._generateRedirects(componentCursor); + if (lang_1.isPresent(instruction)) { + var lastInstruction = instruction; + while (lang_1.isPresent(lastInstruction.child)) { + lastInstruction = lastInstruction.child; + } + lastInstructionIsTerminal = lastInstruction.component.terminal; + } + if (lang_1.isPresent(componentCursor) && !lastInstructionIsTerminal) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" does not resolve to a terminal or async instruction."); + } + } + while (segments.length > 0) { + instruction = new instruction_1.Instruction(segments.pop(), instruction, {}); + } + return instruction; + }; + RouteRegistry.prototype.hasRoute = function(name, parentComponent) { + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return false; + } + return componentRecognizer.hasRoute(name); + }; + RouteRegistry.prototype._generateRedirects = function(componentCursor) { + if (lang_1.isBlank(componentCursor)) { + return null; + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + return null; + } + for (var i = 0; i < componentRecognizer.redirects.length; i += 1) { + var redirect = componentRecognizer.redirects[i]; + if (redirect.segments.length == 1 && redirect.segments[0] == '') { + var toSegments = url_parser_1.pathSegmentsToUrl(redirect.toSegments); + var matches = componentRecognizer.recognize(toSegments); + var primaryInstruction = collection_1.ListWrapper.maximum(matches, function(match) { + return match.instruction.specificity; + }); + if (lang_1.isPresent(primaryInstruction)) { + var child = this._generateRedirects(primaryInstruction.instruction.componentType); + return new instruction_1.Instruction(primaryInstruction.instruction, child, {}); + } + return null; + } + } + return null; + }; + RouteRegistry = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], RouteRegistry); + return RouteRegistry; + })(); + exports.RouteRegistry = RouteRegistry; + function mostSpecific(instructions) { + return collection_1.ListWrapper.maximum(instructions, function(instruction) { + return instruction.component.specificity; + }); + } + function assertTerminalComponent(component, path) { + if (!lang_1.isType(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + throw new exceptions_1.BaseException("Child routes are not allowed for \"" + path + "\". Use \"...\" on the parent's route path."); + } + } + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/http/interfaces", "angular2/src/http/static_request", "angular2/src/http/base_request_options", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var interfaces_1 = require("angular2/src/http/interfaces"); + var static_request_1 = require("angular2/src/http/static_request"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var enums_1 = require("angular2/src/http/enums"); + function httpRequest(backend, request) { + return backend.createConnection(request).response; + } + function mergeOptions(defaultOpts, providedOpts, method, url) { + var newOptions = defaultOpts; + if (lang_1.isPresent(providedOpts)) { + newOptions = newOptions.merge(new base_request_options_1.RequestOptions({ + method: providedOpts.method, + url: providedOpts.url, + search: providedOpts.search, + headers: providedOpts.headers, + body: providedOpts.body + })); + } + if (lang_1.isPresent(method)) { + return newOptions.merge(new base_request_options_1.RequestOptions({ + method: method, + url: url + })); + } else { + return newOptions.merge(new base_request_options_1.RequestOptions({url: url})); + } + } + var Http = (function() { + function Http(_backend, _defaultOptions) { + this._backend = _backend; + this._defaultOptions = _defaultOptions; + } + Http.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + responseObservable = httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + } else if (url instanceof static_request_1.Request) { + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Http.prototype.get = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + }; + Http.prototype.post = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Post, url))); + }; + Http.prototype.put = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Put, url))); + }; + Http.prototype.delete = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Delete, url))); + }; + Http.prototype.patch = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Patch, url))); + }; + Http.prototype.head = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Head, url))); + }; + Http = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Http); + return Http; + })(); + exports.Http = Http; + var Jsonp = (function(_super) { + __extends(Jsonp, _super); + function Jsonp(backend, defaultOptions) { + _super.call(this, backend, defaultOptions); + } + Jsonp.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + url = new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url)); + } + if (url instanceof static_request_1.Request) { + if (url.method !== enums_1.RequestMethods.Get) { + exceptions_1.makeTypeError('JSONP requests must use GET request method.'); + } + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Jsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Jsonp); + return Jsonp; + })(Http); + exports.Jsonp = Jsonp; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/proto_view_factory", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var compiler_1 = require("angular2/src/core/linker/compiler"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + var di_1 = require("angular2/src/core/di"); + var RuntimeCompiler = (function(_super) { + __extends(RuntimeCompiler, _super); + function RuntimeCompiler() { + _super.apply(this, arguments); + } + return RuntimeCompiler; + })(compiler_1.Compiler); + exports.RuntimeCompiler = RuntimeCompiler; + var RuntimeCompiler_ = (function(_super) { + __extends(RuntimeCompiler_, _super); + function RuntimeCompiler_(_protoViewFactory, _templateCompiler) { + _super.call(this, _protoViewFactory); + this._templateCompiler = _templateCompiler; + } + RuntimeCompiler_.prototype.compileInHost = function(componentType) { + var _this = this; + return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(compiledHostTemplate) { + return compiler_1.internalCreateProtoView(_this, compiledHostTemplate); + }); + }; + RuntimeCompiler_.prototype.clearCache = function() { + _super.prototype.clearCache.call(this); + this._templateCompiler.clearCache(); + }; + RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory, template_compiler_1.TemplateCompiler])], RuntimeCompiler_); + return RuntimeCompiler_; + })(compiler_1.Compiler_); + exports.RuntimeCompiler_ = RuntimeCompiler_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/router", ["angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/instruction", "angular2/src/router/route_registry", "angular2/src/router/location_strategy", "angular2/src/router/hash_location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/location", "angular2/src/router/route_config_decorator", "angular2/src/router/route_definition", "angular2/src/router/lifecycle_annotations", "angular2/src/router/instruction", "angular2/angular2", "angular2/src/router/location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/route_registry", "angular2/src/router/location", "angular2/angular2", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var router_1 = require("angular2/src/router/router"); + exports.Router = router_1.Router; + var router_outlet_1 = require("angular2/src/router/router_outlet"); + exports.RouterOutlet = router_outlet_1.RouterOutlet; + var router_link_1 = require("angular2/src/router/router_link"); + exports.RouterLink = router_link_1.RouterLink; + var instruction_1 = require("angular2/src/router/instruction"); + exports.RouteParams = instruction_1.RouteParams; + exports.RouteData = instruction_1.RouteData; + var route_registry_1 = require("angular2/src/router/route_registry"); + exports.RouteRegistry = route_registry_1.RouteRegistry; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + exports.LocationStrategy = location_strategy_1.LocationStrategy; + var hash_location_strategy_1 = require("angular2/src/router/hash_location_strategy"); + exports.HashLocationStrategy = hash_location_strategy_1.HashLocationStrategy; + var path_location_strategy_1 = require("angular2/src/router/path_location_strategy"); + exports.PathLocationStrategy = path_location_strategy_1.PathLocationStrategy; + var location_1 = require("angular2/src/router/location"); + exports.Location = location_1.Location; + exports.APP_BASE_HREF = location_1.APP_BASE_HREF; + __export(require("angular2/src/router/route_config_decorator")); + __export(require("angular2/src/router/route_definition")); + var lifecycle_annotations_1 = require("angular2/src/router/lifecycle_annotations"); + exports.CanActivate = lifecycle_annotations_1.CanActivate; + var instruction_2 = require("angular2/src/router/instruction"); + exports.Instruction = instruction_2.Instruction; + exports.ComponentInstruction = instruction_2.ComponentInstruction; + var angular2_1 = require("angular2/angular2"); + exports.OpaqueToken = angular2_1.OpaqueToken; + var location_strategy_2 = require("angular2/src/router/location_strategy"); + var path_location_strategy_2 = require("angular2/src/router/path_location_strategy"); + var router_2 = require("angular2/src/router/router"); + var router_outlet_2 = require("angular2/src/router/router_outlet"); + var router_link_2 = require("angular2/src/router/router_link"); + var route_registry_2 = require("angular2/src/router/route_registry"); + var location_2 = require("angular2/src/router/location"); + var angular2_2 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.ROUTER_PRIMARY_COMPONENT = lang_1.CONST_EXPR(new angular2_2.OpaqueToken('RouterPrimaryComponent')); + exports.ROUTER_DIRECTIVES = lang_1.CONST_EXPR([router_outlet_2.RouterOutlet, router_link_2.RouterLink]); + exports.ROUTER_PROVIDERS = lang_1.CONST_EXPR([route_registry_2.RouteRegistry, lang_1.CONST_EXPR(new angular2_2.Provider(location_strategy_2.LocationStrategy, {useClass: path_location_strategy_2.PathLocationStrategy})), location_2.Location, lang_1.CONST_EXPR(new angular2_2.Provider(router_2.Router, { + useFactory: routerFactory, + deps: lang_1.CONST_EXPR([route_registry_2.RouteRegistry, location_2.Location, exports.ROUTER_PRIMARY_COMPONENT, angular2_2.ApplicationRef]) + })), lang_1.CONST_EXPR(new angular2_2.Provider(exports.ROUTER_PRIMARY_COMPONENT, { + useFactory: routerPrimaryComponentFactory, + deps: lang_1.CONST_EXPR([angular2_2.ApplicationRef]) + }))]); + exports.ROUTER_BINDINGS = exports.ROUTER_PROVIDERS; + function routerFactory(registry, location, primaryComponent, appRef) { + var rootRouter = new router_2.RootRouter(registry, location, primaryComponent); + appRef.registerDisposeListener(function() { + return rootRouter.dispose(); + }); + return rootRouter; + } + function routerPrimaryComponentFactory(app) { + if (app.componentTypes.length == 0) { + throw new exceptions_1.BaseException("Bootstrap at least one component before injecting Router."); + } + return app.componentTypes[0]; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/http", ["angular2/angular2", "angular2/src/http/http", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/backends/browser_xhr", "angular2/src/http/backends/browser_jsonp", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/mock_backend", "angular2/src/http/static_request", "angular2/src/http/static_response", "angular2/src/http/interfaces", "angular2/src/http/backends/browser_xhr", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/http", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/src/http/url_search_params"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var http_1 = require("angular2/src/http/http"); + var xhr_backend_1 = require("angular2/src/http/backends/xhr_backend"); + var jsonp_backend_1 = require("angular2/src/http/backends/jsonp_backend"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var mock_backend_1 = require("angular2/src/http/backends/mock_backend"); + exports.MockConnection = mock_backend_1.MockConnection; + exports.MockBackend = mock_backend_1.MockBackend; + var static_request_1 = require("angular2/src/http/static_request"); + exports.Request = static_request_1.Request; + var static_response_1 = require("angular2/src/http/static_response"); + exports.Response = static_response_1.Response; + var interfaces_1 = require("angular2/src/http/interfaces"); + exports.Connection = interfaces_1.Connection; + exports.ConnectionBackend = interfaces_1.ConnectionBackend; + var browser_xhr_2 = require("angular2/src/http/backends/browser_xhr"); + exports.BrowserXhr = browser_xhr_2.BrowserXhr; + var base_request_options_2 = require("angular2/src/http/base_request_options"); + exports.BaseRequestOptions = base_request_options_2.BaseRequestOptions; + exports.RequestOptions = base_request_options_2.RequestOptions; + var base_response_options_2 = require("angular2/src/http/base_response_options"); + exports.BaseResponseOptions = base_response_options_2.BaseResponseOptions; + exports.ResponseOptions = base_response_options_2.ResponseOptions; + var xhr_backend_2 = require("angular2/src/http/backends/xhr_backend"); + exports.XHRBackend = xhr_backend_2.XHRBackend; + exports.XHRConnection = xhr_backend_2.XHRConnection; + var jsonp_backend_2 = require("angular2/src/http/backends/jsonp_backend"); + exports.JSONPBackend = jsonp_backend_2.JSONPBackend; + exports.JSONPConnection = jsonp_backend_2.JSONPConnection; + var http_2 = require("angular2/src/http/http"); + exports.Http = http_2.Http; + exports.Jsonp = http_2.Jsonp; + var headers_1 = require("angular2/src/http/headers"); + exports.Headers = headers_1.Headers; + var enums_1 = require("angular2/src/http/enums"); + exports.ResponseTypes = enums_1.ResponseTypes; + exports.ReadyStates = enums_1.ReadyStates; + exports.RequestMethods = enums_1.RequestMethods; + var url_search_params_1 = require("angular2/src/http/url_search_params"); + exports.URLSearchParams = url_search_params_1.URLSearchParams; + exports.HTTP_PROVIDERS = [angular2_1.provide(http_1.Http, { + useFactory: function(xhrBackend, requestOptions) { + return new http_1.Http(xhrBackend, requestOptions); + }, + deps: [xhr_backend_1.XHRBackend, base_request_options_1.RequestOptions] + }), browser_xhr_1.BrowserXhr, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), xhr_backend_1.XHRBackend]; + exports.HTTP_BINDINGS = exports.HTTP_PROVIDERS; + exports.JSONP_PROVIDERS = [angular2_1.provide(http_1.Jsonp, { + useFactory: function(jsonpBackend, requestOptions) { + return new http_1.Jsonp(jsonpBackend, requestOptions); + }, + deps: [jsonp_backend_1.JSONPBackend, base_request_options_1.RequestOptions] + }), browser_jsonp_1.BrowserJsonp, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), angular2_1.provide(jsonp_backend_1.JSONPBackend, {useClass: jsonp_backend_1.JSONPBackend_})]; + exports.JSON_BINDINGS = exports.JSONP_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/compiler/app_root_url", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + exports.TemplateCompiler = template_compiler_1.TemplateCompiler; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; + exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; + exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; + var source_module_1 = require("angular2/src/compiler/source_module"); + exports.SourceModule = source_module_1.SourceModule; + exports.SourceWithImports = source_module_1.SourceWithImports; + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; + exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_compiler_2 = require("angular2/src/compiler/template_compiler"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); + function compilerProviders() { + return [change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_1.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler, di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true)}), template_compiler_2.TemplateCompiler, di_1.provide(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), di_1.provide(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), url_resolver_1.UrlResolver]; + } + exports.compilerProviders = compilerProviders; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application", ["angular2/src/facade/lang", "angular2/src/compiler/compiler", "angular2/src/core/application_common", "angular2/src/core/application_tokens", "angular2/src/core/application_common", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT; + exports.APP_ID = application_tokens_1.APP_ID; + var application_common_2 = require("angular2/src/core/application_common"); + exports.platform = application_common_2.platform; + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.PlatformRef = application_ref_1.PlatformRef; + exports.ApplicationRef = application_ref_1.ApplicationRef; + exports.applicationCommonProviders = application_ref_1.applicationCommonProviders; + exports.createNgZone = application_ref_1.createNgZone; + exports.platformCommon = application_ref_1.platformCommon; + exports.platformProviders = application_ref_1.platformProviders; + function bootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var providers = [compiler_1.compilerProviders()]; + if (lang_1.isPresent(appProviders)) { + providers.push(appProviders); + } + return application_common_1.commonBootstrap(appComponentType, providers); + } + exports.bootstrap = bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/di", "angular2/src/common/pipes", "angular2/src/facade/facade", "angular2/src/core/application", "angular2/src/core/bootstrap", "angular2/src/core/services", "angular2/src/core/linker", "angular2/src/core/application_ref", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/core/debug", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/dev_mode"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/metadata")); + __export(require("angular2/src/core/util")); + __export(require("angular2/src/core/di")); + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/application")); + __export(require("angular2/src/core/bootstrap")); + __export(require("angular2/src/core/services")); + __export(require("angular2/src/core/linker")); + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.ApplicationRef = application_ref_1.ApplicationRef; + __export(require("angular2/src/core/zone")); + __export(require("angular2/src/core/render")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/core/debug")); + __export(require("angular2/src/core/change_detection")); + __export(require("angular2/src/core/platform_directives_and_pipes")); + __export(require("angular2/src/core/dev_mode")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/angular2", ["angular2/common", "angular2/core", "angular2/profile", "angular2/lifecycle_hooks", "angular2/bootstrap", "angular2/upgrade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/common")); + __export(require("angular2/core")); + __export(require("angular2/profile")); + __export(require("angular2/lifecycle_hooks")); + __export(require("angular2/bootstrap")); + __export(require("angular2/upgrade")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/angular2_sfx", ["angular2/angular2", "angular2/router", "angular2/http"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng = require("angular2/angular2"); + var router = require("angular2/router"); + var http = require("angular2/http"); + var _prevNg = window.ng; + window.ng = ng; + window.ngRouter = router; + window.ngHttp = http; + ng.noConflict = function() { + window.ng = _prevNg; + return ng; + }; + global.define = __define; + return module.exports; +}); + +}); +//# sourceMappingURLDisabled=angular2.sfx.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/http.dev.js b/2.0.0-alpha.46/http.dev.js new file mode 100644 index 0000000000..c57f91d4b8 --- /dev/null +++ b/2.0.0-alpha.46/http.dev.js @@ -0,0 +1,1179 @@ +"format register"; +System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ConnectionBackend = (function() { + function ConnectionBackend() {} + return ConnectionBackend; + })(); + exports.ConnectionBackend = ConnectionBackend; + var Connection = (function() { + function Connection() {} + return Connection; + })(); + exports.Connection = Connection; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/headers", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Headers = (function() { + function Headers(headers) { + var _this = this; + if (headers instanceof Headers) { + this._headersMap = headers._headersMap; + return ; + } + this._headersMap = new collection_1.Map(); + if (lang_1.isBlank(headers)) { + return ; + } + collection_1.StringMapWrapper.forEach(headers, function(v, k) { + _this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]); + }); + } + Headers.prototype.append = function(name, value) { + var mapName = this._headersMap.get(name); + var list = collection_1.isListLikeIterable(mapName) ? mapName : []; + list.push(value); + this._headersMap.set(name, list); + }; + Headers.prototype.delete = function(name) { + this._headersMap.delete(name); + }; + Headers.prototype.forEach = function(fn) { + this._headersMap.forEach(fn); + }; + Headers.prototype.get = function(header) { + return collection_1.ListWrapper.first(this._headersMap.get(header)); + }; + Headers.prototype.has = function(header) { + return this._headersMap.has(header); + }; + Headers.prototype.keys = function() { + return collection_1.MapWrapper.keys(this._headersMap); + }; + Headers.prototype.set = function(header, value) { + var list = []; + if (collection_1.isListLikeIterable(value)) { + var pushValue = value.join(','); + list.push(pushValue); + } else { + list.push(value); + } + this._headersMap.set(header, list); + }; + Headers.prototype.values = function() { + return collection_1.MapWrapper.values(this._headersMap); + }; + Headers.prototype.getAll = function(header) { + var headers = this._headersMap.get(header); + return collection_1.isListLikeIterable(headers) ? headers : []; + }; + Headers.prototype.entries = function() { + throw new exceptions_1.BaseException('"entries" method is not implemented on Headers class'); + }; + return Headers; + })(); + exports.Headers = Headers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/enums", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RequestMethods) { + RequestMethods[RequestMethods["Get"] = 0] = "Get"; + RequestMethods[RequestMethods["Post"] = 1] = "Post"; + RequestMethods[RequestMethods["Put"] = 2] = "Put"; + RequestMethods[RequestMethods["Delete"] = 3] = "Delete"; + RequestMethods[RequestMethods["Options"] = 4] = "Options"; + RequestMethods[RequestMethods["Head"] = 5] = "Head"; + RequestMethods[RequestMethods["Patch"] = 6] = "Patch"; + })(exports.RequestMethods || (exports.RequestMethods = {})); + var RequestMethods = exports.RequestMethods; + (function(ReadyStates) { + ReadyStates[ReadyStates["Unsent"] = 0] = "Unsent"; + ReadyStates[ReadyStates["Open"] = 1] = "Open"; + ReadyStates[ReadyStates["HeadersReceived"] = 2] = "HeadersReceived"; + ReadyStates[ReadyStates["Loading"] = 3] = "Loading"; + ReadyStates[ReadyStates["Done"] = 4] = "Done"; + ReadyStates[ReadyStates["Cancelled"] = 5] = "Cancelled"; + })(exports.ReadyStates || (exports.ReadyStates = {})); + var ReadyStates = exports.ReadyStates; + (function(ResponseTypes) { + ResponseTypes[ResponseTypes["Basic"] = 0] = "Basic"; + ResponseTypes[ResponseTypes["Cors"] = 1] = "Cors"; + ResponseTypes[ResponseTypes["Default"] = 2] = "Default"; + ResponseTypes[ResponseTypes["Error"] = 3] = "Error"; + ResponseTypes[ResponseTypes["Opaque"] = 4] = "Opaque"; + })(exports.ResponseTypes || (exports.ResponseTypes = {})); + var ResponseTypes = exports.ResponseTypes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/url_search_params", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + function paramParser(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + var map = new collection_1.Map(); + if (rawParams.length > 0) { + var params = rawParams.split('&'); + params.forEach(function(param) { + var split = param.split('='); + var key = split[0]; + var val = split[1]; + var list = lang_1.isPresent(map.get(key)) ? map.get(key) : []; + list.push(val); + map.set(key, list); + }); + } + return map; + } + var URLSearchParams = (function() { + function URLSearchParams(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + this.rawParams = rawParams; + this.paramsMap = paramParser(rawParams); + } + URLSearchParams.prototype.clone = function() { + var clone = new URLSearchParams(); + clone.appendAll(this); + return clone; + }; + URLSearchParams.prototype.has = function(param) { + return this.paramsMap.has(param); + }; + URLSearchParams.prototype.get = function(param) { + var storedParam = this.paramsMap.get(param); + if (collection_1.isListLikeIterable(storedParam)) { + return collection_1.ListWrapper.first(storedParam); + } else { + return null; + } + }; + URLSearchParams.prototype.getAll = function(param) { + var mapParam = this.paramsMap.get(param); + return lang_1.isPresent(mapParam) ? mapParam : []; + }; + URLSearchParams.prototype.set = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.setAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(value[0]); + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.append = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.appendAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.replaceAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.toString = function() { + var paramsList = []; + this.paramsMap.forEach(function(values, k) { + values.forEach(function(v) { + return paramsList.push(k + '=' + v); + }); + }); + return paramsList.join('&'); + }; + URLSearchParams.prototype.delete = function(param) { + this.paramsMap.delete(param); + }; + return URLSearchParams; + })(); + exports.URLSearchParams = URLSearchParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_response", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var Response = (function() { + function Response(responseOptions) { + this._body = responseOptions.body; + this.status = responseOptions.status; + this.statusText = responseOptions.statusText; + this.headers = responseOptions.headers; + this.type = responseOptions.type; + this.url = responseOptions.url; + } + Response.prototype.blob = function() { + throw new exceptions_1.BaseException('"blob()" method not implemented on Response superclass'); + }; + Response.prototype.json = function() { + var jsonResponse; + if (http_utils_1.isJsObject(this._body)) { + jsonResponse = this._body; + } else if (lang_1.isString(this._body)) { + jsonResponse = lang_1.Json.parse(this._body); + } + return jsonResponse; + }; + Response.prototype.text = function() { + return this._body.toString(); + }; + Response.prototype.arrayBuffer = function() { + throw new exceptions_1.BaseException('"arrayBuffer()" method not implemented on Response superclass'); + }; + return Response; + })(); + exports.Response = Response; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_response_options", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var ResponseOptions = (function() { + function ResponseOptions(_a) { + var _b = _a === void 0 ? {} : _a, + body = _b.body, + status = _b.status, + headers = _b.headers, + statusText = _b.statusText, + type = _b.type, + url = _b.url; + this.body = lang_1.isPresent(body) ? body : null; + this.status = lang_1.isPresent(status) ? status : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.statusText = lang_1.isPresent(statusText) ? statusText : null; + this.type = lang_1.isPresent(type) ? type : null; + this.url = lang_1.isPresent(url) ? url : null; + } + ResponseOptions.prototype.merge = function(options) { + return new ResponseOptions({ + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + status: lang_1.isPresent(options) && lang_1.isPresent(options.status) ? options.status : this.status, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + statusText: lang_1.isPresent(options) && lang_1.isPresent(options.statusText) ? options.statusText : this.statusText, + type: lang_1.isPresent(options) && lang_1.isPresent(options.type) ? options.type : this.type, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url + }); + }; + return ResponseOptions; + })(); + exports.ResponseOptions = ResponseOptions; + var BaseResponseOptions = (function(_super) { + __extends(BaseResponseOptions, _super); + function BaseResponseOptions() { + _super.call(this, { + status: 200, + statusText: 'Ok', + type: enums_1.ResponseTypes.Default, + headers: new headers_1.Headers() + }); + } + BaseResponseOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseResponseOptions); + return BaseResponseOptions; + })(ResponseOptions); + exports.BaseResponseOptions = BaseResponseOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_xhr", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var BrowserXhr = (function() { + function BrowserXhr() {} + BrowserXhr.prototype.build = function() { + return (new XMLHttpRequest()); + }; + BrowserXhr = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserXhr); + return BrowserXhr; + })(); + exports.BrowserXhr = BrowserXhr; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_jsonp", ["angular2/angular2", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var _nextRequestId = 0; + exports.JSONP_HOME = '__ng_jsonp__'; + var _jsonpConnections = null; + function _getJsonpConnections() { + if (_jsonpConnections === null) { + _jsonpConnections = lang_1.global[exports.JSONP_HOME] = {}; + } + return _jsonpConnections; + } + var BrowserJsonp = (function() { + function BrowserJsonp() {} + BrowserJsonp.prototype.build = function(url) { + var node = document.createElement('script'); + node.src = url; + return node; + }; + BrowserJsonp.prototype.nextRequestID = function() { + return "__req" + _nextRequestId++; + }; + BrowserJsonp.prototype.requestCallback = function(id) { + return exports.JSONP_HOME + "." + id + ".finished"; + }; + BrowserJsonp.prototype.exposeConnection = function(id, connection) { + var connections = _getJsonpConnections(); + connections[id] = connection; + }; + BrowserJsonp.prototype.removeConnection = function(id) { + var connections = _getJsonpConnections(); + connections[id] = null; + }; + BrowserJsonp.prototype.send = function(node) { + document.body.appendChild((node)); + }; + BrowserJsonp.prototype.cleanup = function(node) { + if (node.parentNode) { + node.parentNode.removeChild((node)); + } + }; + BrowserJsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserJsonp); + return BrowserJsonp; + })(); + exports.BrowserJsonp = BrowserJsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/mock_backend", ["angular2/angular2", "angular2/src/http/static_request", "angular2/src/http/enums", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var static_request_1 = require("angular2/src/http/static_request"); + var enums_1 = require("angular2/src/http/enums"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Rx = require("@reactivex/rxjs/dist/cjs/Rx"); + var Subject = Rx.Subject, + ReplaySubject = Rx.ReplaySubject; + var MockConnection = (function() { + function MockConnection(req) { + this.response = new ReplaySubject(1).take(1); + this.readyState = enums_1.ReadyStates.Open; + this.request = req; + } + MockConnection.prototype.mockRespond = function(res) { + if (this.readyState === enums_1.ReadyStates.Done || this.readyState === enums_1.ReadyStates.Cancelled) { + throw new exceptions_1.BaseException('Connection has already been resolved'); + } + this.readyState = enums_1.ReadyStates.Done; + this.response.next(res); + this.response.complete(); + }; + MockConnection.prototype.mockDownload = function(res) {}; + MockConnection.prototype.mockError = function(err) { + this.readyState = enums_1.ReadyStates.Done; + this.response.error(err); + }; + return MockConnection; + })(); + exports.MockConnection = MockConnection; + var MockBackend = (function() { + function MockBackend() { + var _this = this; + this.connectionsArray = []; + this.connections = new Subject(); + this.connections.subscribe(function(connection) { + return _this.connectionsArray.push(connection); + }); + this.pendingConnections = new Subject(); + } + MockBackend.prototype.verifyNoPendingRequests = function() { + var pending = 0; + this.pendingConnections.subscribe(function(c) { + return pending++; + }); + if (pending > 0) + throw new exceptions_1.BaseException(pending + " pending connections to be resolved"); + }; + MockBackend.prototype.resolveAllConnections = function() { + this.connections.subscribe(function(c) { + return c.readyState = 4; + }); + }; + MockBackend.prototype.createConnection = function(req) { + if (!lang_1.isPresent(req) || !(req instanceof static_request_1.Request)) { + throw new exceptions_1.BaseException("createConnection requires an instance of Request, got " + req); + } + var connection = new MockConnection(req); + this.connections.next(connection); + return connection; + }; + MockBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], MockBackend); + return MockBackend; + })(); + exports.MockBackend = MockBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http_utils", ["angular2/src/facade/lang", "angular2/src/http/enums", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var enums_1 = require("angular2/src/http/enums"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeMethodName(method) { + if (lang_1.isString(method)) { + var originalMethod = method; + method = method.replace(/(\w)(\w*)/g, function(g0, g1, g2) { + return g1.toUpperCase() + g2.toLowerCase(); + }); + method = enums_1.RequestMethods[method]; + if (typeof method !== 'number') + throw exceptions_1.makeTypeError("Invalid request method. The method \"" + originalMethod + "\" is not supported."); + } + return method; + } + exports.normalizeMethodName = normalizeMethodName; + var lang_2 = require("angular2/src/facade/lang"); + exports.isJsObject = lang_2.isJsObject; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_request_options", ["angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/angular2", "angular2/src/http/url_search_params", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var angular2_1 = require("angular2/angular2"); + var url_search_params_1 = require("angular2/src/http/url_search_params"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var RequestOptions = (function() { + function RequestOptions(_a) { + var _b = _a === void 0 ? {} : _a, + method = _b.method, + headers = _b.headers, + body = _b.body, + url = _b.url, + search = _b.search; + this.method = lang_1.isPresent(method) ? http_utils_1.normalizeMethodName(method) : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.body = lang_1.isPresent(body) ? body : null; + this.url = lang_1.isPresent(url) ? url : null; + this.search = lang_1.isPresent(search) ? (lang_1.isString(search) ? new url_search_params_1.URLSearchParams((search)) : (search)) : null; + } + RequestOptions.prototype.merge = function(options) { + return new RequestOptions({ + method: lang_1.isPresent(options) && lang_1.isPresent(options.method) ? options.method : this.method, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url, + search: lang_1.isPresent(options) && lang_1.isPresent(options.search) ? (lang_1.isString(options.search) ? new url_search_params_1.URLSearchParams((options.search)) : (options.search).clone()) : this.search + }); + }; + return RequestOptions; + })(); + exports.RequestOptions = RequestOptions; + var BaseRequestOptions = (function(_super) { + __extends(BaseRequestOptions, _super); + function BaseRequestOptions() { + _super.call(this, { + method: enums_1.RequestMethods.Get, + headers: new headers_1.Headers() + }); + } + BaseRequestOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseRequestOptions); + return BaseRequestOptions; + })(RequestOptions); + exports.BaseRequestOptions = BaseRequestOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/xhr_backend", ["angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_xhr", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var XHRConnection = (function() { + function XHRConnection(req, browserXHR, baseResponseOptions) { + var _this = this; + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + var _xhr = browserXHR.build(); + _xhr.open(enums_1.RequestMethods[req.method].toUpperCase(), req.url); + var onLoad = function() { + var response = lang_1.isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; + var status = _xhr.status === 1223 ? 204 : _xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + var responseOptions = new base_response_options_1.ResponseOptions({ + body: response, + status: status + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(err) { + var responseOptions = new base_response_options_1.ResponseOptions({ + body: err, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + if (lang_1.isPresent(req.headers)) { + req.headers.forEach(function(values, name) { + return _xhr.setRequestHeader(name, values.join(',')); + }); + } + _xhr.addEventListener('load', onLoad); + _xhr.addEventListener('error', onError); + _xhr.send(_this.request.text()); + return function() { + _xhr.removeEventListener('load', onLoad); + _xhr.removeEventListener('error', onError); + _xhr.abort(); + }; + }); + } + return XHRConnection; + })(); + exports.XHRConnection = XHRConnection; + var XHRBackend = (function() { + function XHRBackend(_browserXHR, _baseResponseOptions) { + this._browserXHR = _browserXHR; + this._baseResponseOptions = _baseResponseOptions; + } + XHRBackend.prototype.createConnection = function(request) { + return new XHRConnection(request, this._browserXHR, this._baseResponseOptions); + }; + XHRBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_xhr_1.BrowserXhr, base_response_options_1.ResponseOptions])], XHRBackend); + return XHRBackend; + })(); + exports.XHRBackend = XHRBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/jsonp_backend", ["angular2/src/http/interfaces", "angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_jsonp", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var interfaces_1 = require("angular2/src/http/interfaces"); + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; + var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.'; + var JSONPConnection = (function() { + function JSONPConnection() {} + return JSONPConnection; + })(); + exports.JSONPConnection = JSONPConnection; + var JSONPConnection_ = (function(_super) { + __extends(JSONPConnection_, _super); + function JSONPConnection_(req, _dom, baseResponseOptions) { + var _this = this; + _super.call(this); + this._dom = _dom; + this.baseResponseOptions = baseResponseOptions; + this._finished = false; + if (req.method !== enums_1.RequestMethods.Get) { + throw exceptions_1.makeTypeError(JSONP_ERR_WRONG_METHOD); + } + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + _this.readyState = enums_1.ReadyStates.Loading; + var id = _this._id = _dom.nextRequestID(); + _dom.exposeConnection(id, _this); + var callback = _dom.requestCallback(_this._id); + var url = req.url; + if (url.indexOf('=JSONP_CALLBACK&') > -1) { + url = lang_1.StringWrapper.replace(url, '=JSONP_CALLBACK&', "=" + callback + "&"); + } else if (url.lastIndexOf('=JSONP_CALLBACK') === url.length - '=JSONP_CALLBACK'.length) { + url = url.substring(0, url.length - '=JSONP_CALLBACK'.length) + ("=" + callback); + } + var script = _this._script = _dom.build(url); + var onLoad = function(event) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + if (!_this._finished) { + var responseOptions_1 = new base_response_options_1.ResponseOptions({ + body: JSONP_ERR_NO_CALLBACK, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions_1 = baseResponseOptions.merge(responseOptions_1); + } + responseObserver.error(new static_response_1.Response(responseOptions_1)); + return ; + } + var responseOptions = new base_response_options_1.ResponseOptions({body: _this._responseData}); + if (lang_1.isPresent(_this.baseResponseOptions)) { + responseOptions = _this.baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(error) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + var responseOptions = new base_response_options_1.ResponseOptions({ + body: error.message, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + script.addEventListener('load', onLoad); + script.addEventListener('error', onError); + _dom.send(script); + return function() { + _this.readyState = enums_1.ReadyStates.Cancelled; + script.removeEventListener('load', onLoad); + script.removeEventListener('error', onError); + if (lang_1.isPresent(script)) { + _this._dom.cleanup(script); + } + }; + }); + } + JSONPConnection_.prototype.finished = function(data) { + this._finished = true; + this._dom.removeConnection(this._id); + if (this.readyState === enums_1.ReadyStates.Cancelled) + return ; + this._responseData = data; + }; + return JSONPConnection_; + })(JSONPConnection); + exports.JSONPConnection_ = JSONPConnection_; + var JSONPBackend = (function(_super) { + __extends(JSONPBackend, _super); + function JSONPBackend() { + _super.apply(this, arguments); + } + return JSONPBackend; + })(interfaces_1.ConnectionBackend); + exports.JSONPBackend = JSONPBackend; + var JSONPBackend_ = (function(_super) { + __extends(JSONPBackend_, _super); + function JSONPBackend_(_browserJSONP, _baseResponseOptions) { + _super.call(this); + this._browserJSONP = _browserJSONP; + this._baseResponseOptions = _baseResponseOptions; + } + JSONPBackend_.prototype.createConnection = function(request) { + return new JSONPConnection_(request, this._browserJSONP, this._baseResponseOptions); + }; + JSONPBackend_ = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_jsonp_1.BrowserJsonp, base_response_options_1.ResponseOptions])], JSONPBackend_); + return JSONPBackend_; + })(JSONPBackend); + exports.JSONPBackend_ = JSONPBackend_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_request", ["angular2/src/http/headers", "angular2/src/http/http_utils", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var headers_1 = require("angular2/src/http/headers"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var lang_1 = require("angular2/src/facade/lang"); + var Request = (function() { + function Request(requestOptions) { + var url = requestOptions.url; + this.url = requestOptions.url; + if (lang_1.isPresent(requestOptions.search)) { + var search = requestOptions.search.toString(); + if (search.length > 0) { + var prefix = '?'; + if (lang_1.StringWrapper.contains(this.url, '?')) { + prefix = (this.url[this.url.length - 1] == '&') ? '' : '&'; + } + this.url = url + prefix + search; + } + } + this._body = requestOptions.body; + this.method = http_utils_1.normalizeMethodName(requestOptions.method); + this.headers = new headers_1.Headers(requestOptions.headers); + } + Request.prototype.text = function() { + return lang_1.isPresent(this._body) ? this._body.toString() : ''; + }; + return Request; + })(); + exports.Request = Request; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/http/interfaces", "angular2/src/http/static_request", "angular2/src/http/base_request_options", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var interfaces_1 = require("angular2/src/http/interfaces"); + var static_request_1 = require("angular2/src/http/static_request"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var enums_1 = require("angular2/src/http/enums"); + function httpRequest(backend, request) { + return backend.createConnection(request).response; + } + function mergeOptions(defaultOpts, providedOpts, method, url) { + var newOptions = defaultOpts; + if (lang_1.isPresent(providedOpts)) { + newOptions = newOptions.merge(new base_request_options_1.RequestOptions({ + method: providedOpts.method, + url: providedOpts.url, + search: providedOpts.search, + headers: providedOpts.headers, + body: providedOpts.body + })); + } + if (lang_1.isPresent(method)) { + return newOptions.merge(new base_request_options_1.RequestOptions({ + method: method, + url: url + })); + } else { + return newOptions.merge(new base_request_options_1.RequestOptions({url: url})); + } + } + var Http = (function() { + function Http(_backend, _defaultOptions) { + this._backend = _backend; + this._defaultOptions = _defaultOptions; + } + Http.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + responseObservable = httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + } else if (url instanceof static_request_1.Request) { + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Http.prototype.get = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + }; + Http.prototype.post = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Post, url))); + }; + Http.prototype.put = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Put, url))); + }; + Http.prototype.delete = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Delete, url))); + }; + Http.prototype.patch = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Patch, url))); + }; + Http.prototype.head = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Head, url))); + }; + Http = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Http); + return Http; + })(); + exports.Http = Http; + var Jsonp = (function(_super) { + __extends(Jsonp, _super); + function Jsonp(backend, defaultOptions) { + _super.call(this, backend, defaultOptions); + } + Jsonp.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + url = new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url)); + } + if (url instanceof static_request_1.Request) { + if (url.method !== enums_1.RequestMethods.Get) { + exceptions_1.makeTypeError('JSONP requests must use GET request method.'); + } + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Jsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Jsonp); + return Jsonp; + })(Http); + exports.Jsonp = Jsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/http", ["angular2/angular2", "angular2/src/http/http", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/backends/browser_xhr", "angular2/src/http/backends/browser_jsonp", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/mock_backend", "angular2/src/http/static_request", "angular2/src/http/static_response", "angular2/src/http/interfaces", "angular2/src/http/backends/browser_xhr", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/http", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/src/http/url_search_params"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var http_1 = require("angular2/src/http/http"); + var xhr_backend_1 = require("angular2/src/http/backends/xhr_backend"); + var jsonp_backend_1 = require("angular2/src/http/backends/jsonp_backend"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var mock_backend_1 = require("angular2/src/http/backends/mock_backend"); + exports.MockConnection = mock_backend_1.MockConnection; + exports.MockBackend = mock_backend_1.MockBackend; + var static_request_1 = require("angular2/src/http/static_request"); + exports.Request = static_request_1.Request; + var static_response_1 = require("angular2/src/http/static_response"); + exports.Response = static_response_1.Response; + var interfaces_1 = require("angular2/src/http/interfaces"); + exports.Connection = interfaces_1.Connection; + exports.ConnectionBackend = interfaces_1.ConnectionBackend; + var browser_xhr_2 = require("angular2/src/http/backends/browser_xhr"); + exports.BrowserXhr = browser_xhr_2.BrowserXhr; + var base_request_options_2 = require("angular2/src/http/base_request_options"); + exports.BaseRequestOptions = base_request_options_2.BaseRequestOptions; + exports.RequestOptions = base_request_options_2.RequestOptions; + var base_response_options_2 = require("angular2/src/http/base_response_options"); + exports.BaseResponseOptions = base_response_options_2.BaseResponseOptions; + exports.ResponseOptions = base_response_options_2.ResponseOptions; + var xhr_backend_2 = require("angular2/src/http/backends/xhr_backend"); + exports.XHRBackend = xhr_backend_2.XHRBackend; + exports.XHRConnection = xhr_backend_2.XHRConnection; + var jsonp_backend_2 = require("angular2/src/http/backends/jsonp_backend"); + exports.JSONPBackend = jsonp_backend_2.JSONPBackend; + exports.JSONPConnection = jsonp_backend_2.JSONPConnection; + var http_2 = require("angular2/src/http/http"); + exports.Http = http_2.Http; + exports.Jsonp = http_2.Jsonp; + var headers_1 = require("angular2/src/http/headers"); + exports.Headers = headers_1.Headers; + var enums_1 = require("angular2/src/http/enums"); + exports.ResponseTypes = enums_1.ResponseTypes; + exports.ReadyStates = enums_1.ReadyStates; + exports.RequestMethods = enums_1.RequestMethods; + var url_search_params_1 = require("angular2/src/http/url_search_params"); + exports.URLSearchParams = url_search_params_1.URLSearchParams; + exports.HTTP_PROVIDERS = [angular2_1.provide(http_1.Http, { + useFactory: function(xhrBackend, requestOptions) { + return new http_1.Http(xhrBackend, requestOptions); + }, + deps: [xhr_backend_1.XHRBackend, base_request_options_1.RequestOptions] + }), browser_xhr_1.BrowserXhr, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), xhr_backend_1.XHRBackend]; + exports.HTTP_BINDINGS = exports.HTTP_PROVIDERS; + exports.JSONP_PROVIDERS = [angular2_1.provide(http_1.Jsonp, { + useFactory: function(jsonpBackend, requestOptions) { + return new http_1.Jsonp(jsonpBackend, requestOptions); + }, + deps: [jsonp_backend_1.JSONPBackend, base_request_options_1.RequestOptions] + }), browser_jsonp_1.BrowserJsonp, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), angular2_1.provide(jsonp_backend_1.JSONPBackend, {useClass: jsonp_backend_1.JSONPBackend_})]; + exports.JSON_BINDINGS = exports.JSONP_PROVIDERS; + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=http.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/http.js b/2.0.0-alpha.46/http.js new file mode 100644 index 0000000000..803dd1e5ea --- /dev/null +++ b/2.0.0-alpha.46/http.js @@ -0,0 +1,1179 @@ +"format register"; +System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ConnectionBackend = (function() { + function ConnectionBackend() {} + return ConnectionBackend; + })(); + exports.ConnectionBackend = ConnectionBackend; + var Connection = (function() { + function Connection() {} + return Connection; + })(); + exports.Connection = Connection; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/headers", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Headers = (function() { + function Headers(headers) { + var _this = this; + if (headers instanceof Headers) { + this._headersMap = headers._headersMap; + return ; + } + this._headersMap = new collection_1.Map(); + if (lang_1.isBlank(headers)) { + return ; + } + collection_1.StringMapWrapper.forEach(headers, function(v, k) { + _this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]); + }); + } + Headers.prototype.append = function(name, value) { + var mapName = this._headersMap.get(name); + var list = collection_1.isListLikeIterable(mapName) ? mapName : []; + list.push(value); + this._headersMap.set(name, list); + }; + Headers.prototype.delete = function(name) { + this._headersMap.delete(name); + }; + Headers.prototype.forEach = function(fn) { + this._headersMap.forEach(fn); + }; + Headers.prototype.get = function(header) { + return collection_1.ListWrapper.first(this._headersMap.get(header)); + }; + Headers.prototype.has = function(header) { + return this._headersMap.has(header); + }; + Headers.prototype.keys = function() { + return collection_1.MapWrapper.keys(this._headersMap); + }; + Headers.prototype.set = function(header, value) { + var list = []; + if (collection_1.isListLikeIterable(value)) { + var pushValue = value.join(','); + list.push(pushValue); + } else { + list.push(value); + } + this._headersMap.set(header, list); + }; + Headers.prototype.values = function() { + return collection_1.MapWrapper.values(this._headersMap); + }; + Headers.prototype.getAll = function(header) { + var headers = this._headersMap.get(header); + return collection_1.isListLikeIterable(headers) ? headers : []; + }; + Headers.prototype.entries = function() { + throw new exceptions_1.BaseException('"entries" method is not implemented on Headers class'); + }; + return Headers; + })(); + exports.Headers = Headers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/enums", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RequestMethods) { + RequestMethods[RequestMethods["Get"] = 0] = "Get"; + RequestMethods[RequestMethods["Post"] = 1] = "Post"; + RequestMethods[RequestMethods["Put"] = 2] = "Put"; + RequestMethods[RequestMethods["Delete"] = 3] = "Delete"; + RequestMethods[RequestMethods["Options"] = 4] = "Options"; + RequestMethods[RequestMethods["Head"] = 5] = "Head"; + RequestMethods[RequestMethods["Patch"] = 6] = "Patch"; + })(exports.RequestMethods || (exports.RequestMethods = {})); + var RequestMethods = exports.RequestMethods; + (function(ReadyStates) { + ReadyStates[ReadyStates["Unsent"] = 0] = "Unsent"; + ReadyStates[ReadyStates["Open"] = 1] = "Open"; + ReadyStates[ReadyStates["HeadersReceived"] = 2] = "HeadersReceived"; + ReadyStates[ReadyStates["Loading"] = 3] = "Loading"; + ReadyStates[ReadyStates["Done"] = 4] = "Done"; + ReadyStates[ReadyStates["Cancelled"] = 5] = "Cancelled"; + })(exports.ReadyStates || (exports.ReadyStates = {})); + var ReadyStates = exports.ReadyStates; + (function(ResponseTypes) { + ResponseTypes[ResponseTypes["Basic"] = 0] = "Basic"; + ResponseTypes[ResponseTypes["Cors"] = 1] = "Cors"; + ResponseTypes[ResponseTypes["Default"] = 2] = "Default"; + ResponseTypes[ResponseTypes["Error"] = 3] = "Error"; + ResponseTypes[ResponseTypes["Opaque"] = 4] = "Opaque"; + })(exports.ResponseTypes || (exports.ResponseTypes = {})); + var ResponseTypes = exports.ResponseTypes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/url_search_params", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + function paramParser(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + var map = new collection_1.Map(); + if (rawParams.length > 0) { + var params = rawParams.split('&'); + params.forEach(function(param) { + var split = param.split('='); + var key = split[0]; + var val = split[1]; + var list = lang_1.isPresent(map.get(key)) ? map.get(key) : []; + list.push(val); + map.set(key, list); + }); + } + return map; + } + var URLSearchParams = (function() { + function URLSearchParams(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + this.rawParams = rawParams; + this.paramsMap = paramParser(rawParams); + } + URLSearchParams.prototype.clone = function() { + var clone = new URLSearchParams(); + clone.appendAll(this); + return clone; + }; + URLSearchParams.prototype.has = function(param) { + return this.paramsMap.has(param); + }; + URLSearchParams.prototype.get = function(param) { + var storedParam = this.paramsMap.get(param); + if (collection_1.isListLikeIterable(storedParam)) { + return collection_1.ListWrapper.first(storedParam); + } else { + return null; + } + }; + URLSearchParams.prototype.getAll = function(param) { + var mapParam = this.paramsMap.get(param); + return lang_1.isPresent(mapParam) ? mapParam : []; + }; + URLSearchParams.prototype.set = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.setAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(value[0]); + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.append = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.appendAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.replaceAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.toString = function() { + var paramsList = []; + this.paramsMap.forEach(function(values, k) { + values.forEach(function(v) { + return paramsList.push(k + '=' + v); + }); + }); + return paramsList.join('&'); + }; + URLSearchParams.prototype.delete = function(param) { + this.paramsMap.delete(param); + }; + return URLSearchParams; + })(); + exports.URLSearchParams = URLSearchParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_response", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var Response = (function() { + function Response(responseOptions) { + this._body = responseOptions.body; + this.status = responseOptions.status; + this.statusText = responseOptions.statusText; + this.headers = responseOptions.headers; + this.type = responseOptions.type; + this.url = responseOptions.url; + } + Response.prototype.blob = function() { + throw new exceptions_1.BaseException('"blob()" method not implemented on Response superclass'); + }; + Response.prototype.json = function() { + var jsonResponse; + if (http_utils_1.isJsObject(this._body)) { + jsonResponse = this._body; + } else if (lang_1.isString(this._body)) { + jsonResponse = lang_1.Json.parse(this._body); + } + return jsonResponse; + }; + Response.prototype.text = function() { + return this._body.toString(); + }; + Response.prototype.arrayBuffer = function() { + throw new exceptions_1.BaseException('"arrayBuffer()" method not implemented on Response superclass'); + }; + return Response; + })(); + exports.Response = Response; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_response_options", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var ResponseOptions = (function() { + function ResponseOptions(_a) { + var _b = _a === void 0 ? {} : _a, + body = _b.body, + status = _b.status, + headers = _b.headers, + statusText = _b.statusText, + type = _b.type, + url = _b.url; + this.body = lang_1.isPresent(body) ? body : null; + this.status = lang_1.isPresent(status) ? status : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.statusText = lang_1.isPresent(statusText) ? statusText : null; + this.type = lang_1.isPresent(type) ? type : null; + this.url = lang_1.isPresent(url) ? url : null; + } + ResponseOptions.prototype.merge = function(options) { + return new ResponseOptions({ + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + status: lang_1.isPresent(options) && lang_1.isPresent(options.status) ? options.status : this.status, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + statusText: lang_1.isPresent(options) && lang_1.isPresent(options.statusText) ? options.statusText : this.statusText, + type: lang_1.isPresent(options) && lang_1.isPresent(options.type) ? options.type : this.type, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url + }); + }; + return ResponseOptions; + })(); + exports.ResponseOptions = ResponseOptions; + var BaseResponseOptions = (function(_super) { + __extends(BaseResponseOptions, _super); + function BaseResponseOptions() { + _super.call(this, { + status: 200, + statusText: 'Ok', + type: enums_1.ResponseTypes.Default, + headers: new headers_1.Headers() + }); + } + BaseResponseOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseResponseOptions); + return BaseResponseOptions; + })(ResponseOptions); + exports.BaseResponseOptions = BaseResponseOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_xhr", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var BrowserXhr = (function() { + function BrowserXhr() {} + BrowserXhr.prototype.build = function() { + return (new XMLHttpRequest()); + }; + BrowserXhr = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserXhr); + return BrowserXhr; + })(); + exports.BrowserXhr = BrowserXhr; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_jsonp", ["angular2/angular2", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var _nextRequestId = 0; + exports.JSONP_HOME = '__ng_jsonp__'; + var _jsonpConnections = null; + function _getJsonpConnections() { + if (_jsonpConnections === null) { + _jsonpConnections = lang_1.global[exports.JSONP_HOME] = {}; + } + return _jsonpConnections; + } + var BrowserJsonp = (function() { + function BrowserJsonp() {} + BrowserJsonp.prototype.build = function(url) { + var node = document.createElement('script'); + node.src = url; + return node; + }; + BrowserJsonp.prototype.nextRequestID = function() { + return "__req" + _nextRequestId++; + }; + BrowserJsonp.prototype.requestCallback = function(id) { + return exports.JSONP_HOME + "." + id + ".finished"; + }; + BrowserJsonp.prototype.exposeConnection = function(id, connection) { + var connections = _getJsonpConnections(); + connections[id] = connection; + }; + BrowserJsonp.prototype.removeConnection = function(id) { + var connections = _getJsonpConnections(); + connections[id] = null; + }; + BrowserJsonp.prototype.send = function(node) { + document.body.appendChild((node)); + }; + BrowserJsonp.prototype.cleanup = function(node) { + if (node.parentNode) { + node.parentNode.removeChild((node)); + } + }; + BrowserJsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserJsonp); + return BrowserJsonp; + })(); + exports.BrowserJsonp = BrowserJsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/mock_backend", ["angular2/angular2", "angular2/src/http/static_request", "angular2/src/http/enums", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var static_request_1 = require("angular2/src/http/static_request"); + var enums_1 = require("angular2/src/http/enums"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Rx = require("@reactivex/rxjs/dist/cjs/Rx"); + var Subject = Rx.Subject, + ReplaySubject = Rx.ReplaySubject; + var MockConnection = (function() { + function MockConnection(req) { + this.response = new ReplaySubject(1).take(1); + this.readyState = enums_1.ReadyStates.Open; + this.request = req; + } + MockConnection.prototype.mockRespond = function(res) { + if (this.readyState === enums_1.ReadyStates.Done || this.readyState === enums_1.ReadyStates.Cancelled) { + throw new exceptions_1.BaseException('Connection has already been resolved'); + } + this.readyState = enums_1.ReadyStates.Done; + this.response.next(res); + this.response.complete(); + }; + MockConnection.prototype.mockDownload = function(res) {}; + MockConnection.prototype.mockError = function(err) { + this.readyState = enums_1.ReadyStates.Done; + this.response.error(err); + }; + return MockConnection; + })(); + exports.MockConnection = MockConnection; + var MockBackend = (function() { + function MockBackend() { + var _this = this; + this.connectionsArray = []; + this.connections = new Subject(); + this.connections.subscribe(function(connection) { + return _this.connectionsArray.push(connection); + }); + this.pendingConnections = new Subject(); + } + MockBackend.prototype.verifyNoPendingRequests = function() { + var pending = 0; + this.pendingConnections.subscribe(function(c) { + return pending++; + }); + if (pending > 0) + throw new exceptions_1.BaseException(pending + " pending connections to be resolved"); + }; + MockBackend.prototype.resolveAllConnections = function() { + this.connections.subscribe(function(c) { + return c.readyState = 4; + }); + }; + MockBackend.prototype.createConnection = function(req) { + if (!lang_1.isPresent(req) || !(req instanceof static_request_1.Request)) { + throw new exceptions_1.BaseException("createConnection requires an instance of Request, got " + req); + } + var connection = new MockConnection(req); + this.connections.next(connection); + return connection; + }; + MockBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], MockBackend); + return MockBackend; + })(); + exports.MockBackend = MockBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http_utils", ["angular2/src/facade/lang", "angular2/src/http/enums", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var enums_1 = require("angular2/src/http/enums"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeMethodName(method) { + if (lang_1.isString(method)) { + var originalMethod = method; + method = method.replace(/(\w)(\w*)/g, function(g0, g1, g2) { + return g1.toUpperCase() + g2.toLowerCase(); + }); + method = enums_1.RequestMethods[method]; + if (typeof method !== 'number') + throw exceptions_1.makeTypeError("Invalid request method. The method \"" + originalMethod + "\" is not supported."); + } + return method; + } + exports.normalizeMethodName = normalizeMethodName; + var lang_2 = require("angular2/src/facade/lang"); + exports.isJsObject = lang_2.isJsObject; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_request_options", ["angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/angular2", "angular2/src/http/url_search_params", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var angular2_1 = require("angular2/angular2"); + var url_search_params_1 = require("angular2/src/http/url_search_params"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var RequestOptions = (function() { + function RequestOptions(_a) { + var _b = _a === void 0 ? {} : _a, + method = _b.method, + headers = _b.headers, + body = _b.body, + url = _b.url, + search = _b.search; + this.method = lang_1.isPresent(method) ? http_utils_1.normalizeMethodName(method) : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.body = lang_1.isPresent(body) ? body : null; + this.url = lang_1.isPresent(url) ? url : null; + this.search = lang_1.isPresent(search) ? (lang_1.isString(search) ? new url_search_params_1.URLSearchParams((search)) : (search)) : null; + } + RequestOptions.prototype.merge = function(options) { + return new RequestOptions({ + method: lang_1.isPresent(options) && lang_1.isPresent(options.method) ? options.method : this.method, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url, + search: lang_1.isPresent(options) && lang_1.isPresent(options.search) ? (lang_1.isString(options.search) ? new url_search_params_1.URLSearchParams((options.search)) : (options.search).clone()) : this.search + }); + }; + return RequestOptions; + })(); + exports.RequestOptions = RequestOptions; + var BaseRequestOptions = (function(_super) { + __extends(BaseRequestOptions, _super); + function BaseRequestOptions() { + _super.call(this, { + method: enums_1.RequestMethods.Get, + headers: new headers_1.Headers() + }); + } + BaseRequestOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseRequestOptions); + return BaseRequestOptions; + })(RequestOptions); + exports.BaseRequestOptions = BaseRequestOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/xhr_backend", ["angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_xhr", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var XHRConnection = (function() { + function XHRConnection(req, browserXHR, baseResponseOptions) { + var _this = this; + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + var _xhr = browserXHR.build(); + _xhr.open(enums_1.RequestMethods[req.method].toUpperCase(), req.url); + var onLoad = function() { + var response = lang_1.isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; + var status = _xhr.status === 1223 ? 204 : _xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + var responseOptions = new base_response_options_1.ResponseOptions({ + body: response, + status: status + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(err) { + var responseOptions = new base_response_options_1.ResponseOptions({ + body: err, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + if (lang_1.isPresent(req.headers)) { + req.headers.forEach(function(values, name) { + return _xhr.setRequestHeader(name, values.join(',')); + }); + } + _xhr.addEventListener('load', onLoad); + _xhr.addEventListener('error', onError); + _xhr.send(_this.request.text()); + return function() { + _xhr.removeEventListener('load', onLoad); + _xhr.removeEventListener('error', onError); + _xhr.abort(); + }; + }); + } + return XHRConnection; + })(); + exports.XHRConnection = XHRConnection; + var XHRBackend = (function() { + function XHRBackend(_browserXHR, _baseResponseOptions) { + this._browserXHR = _browserXHR; + this._baseResponseOptions = _baseResponseOptions; + } + XHRBackend.prototype.createConnection = function(request) { + return new XHRConnection(request, this._browserXHR, this._baseResponseOptions); + }; + XHRBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_xhr_1.BrowserXhr, base_response_options_1.ResponseOptions])], XHRBackend); + return XHRBackend; + })(); + exports.XHRBackend = XHRBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/jsonp_backend", ["angular2/src/http/interfaces", "angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_jsonp", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var interfaces_1 = require("angular2/src/http/interfaces"); + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; + var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.'; + var JSONPConnection = (function() { + function JSONPConnection() {} + return JSONPConnection; + })(); + exports.JSONPConnection = JSONPConnection; + var JSONPConnection_ = (function(_super) { + __extends(JSONPConnection_, _super); + function JSONPConnection_(req, _dom, baseResponseOptions) { + var _this = this; + _super.call(this); + this._dom = _dom; + this.baseResponseOptions = baseResponseOptions; + this._finished = false; + if (req.method !== enums_1.RequestMethods.Get) { + throw exceptions_1.makeTypeError(JSONP_ERR_WRONG_METHOD); + } + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + _this.readyState = enums_1.ReadyStates.Loading; + var id = _this._id = _dom.nextRequestID(); + _dom.exposeConnection(id, _this); + var callback = _dom.requestCallback(_this._id); + var url = req.url; + if (url.indexOf('=JSONP_CALLBACK&') > -1) { + url = lang_1.StringWrapper.replace(url, '=JSONP_CALLBACK&', "=" + callback + "&"); + } else if (url.lastIndexOf('=JSONP_CALLBACK') === url.length - '=JSONP_CALLBACK'.length) { + url = url.substring(0, url.length - '=JSONP_CALLBACK'.length) + ("=" + callback); + } + var script = _this._script = _dom.build(url); + var onLoad = function(event) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + if (!_this._finished) { + var responseOptions_1 = new base_response_options_1.ResponseOptions({ + body: JSONP_ERR_NO_CALLBACK, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions_1 = baseResponseOptions.merge(responseOptions_1); + } + responseObserver.error(new static_response_1.Response(responseOptions_1)); + return ; + } + var responseOptions = new base_response_options_1.ResponseOptions({body: _this._responseData}); + if (lang_1.isPresent(_this.baseResponseOptions)) { + responseOptions = _this.baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(error) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + var responseOptions = new base_response_options_1.ResponseOptions({ + body: error.message, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + script.addEventListener('load', onLoad); + script.addEventListener('error', onError); + _dom.send(script); + return function() { + _this.readyState = enums_1.ReadyStates.Cancelled; + script.removeEventListener('load', onLoad); + script.removeEventListener('error', onError); + if (lang_1.isPresent(script)) { + _this._dom.cleanup(script); + } + }; + }); + } + JSONPConnection_.prototype.finished = function(data) { + this._finished = true; + this._dom.removeConnection(this._id); + if (this.readyState === enums_1.ReadyStates.Cancelled) + return ; + this._responseData = data; + }; + return JSONPConnection_; + })(JSONPConnection); + exports.JSONPConnection_ = JSONPConnection_; + var JSONPBackend = (function(_super) { + __extends(JSONPBackend, _super); + function JSONPBackend() { + _super.apply(this, arguments); + } + return JSONPBackend; + })(interfaces_1.ConnectionBackend); + exports.JSONPBackend = JSONPBackend; + var JSONPBackend_ = (function(_super) { + __extends(JSONPBackend_, _super); + function JSONPBackend_(_browserJSONP, _baseResponseOptions) { + _super.call(this); + this._browserJSONP = _browserJSONP; + this._baseResponseOptions = _baseResponseOptions; + } + JSONPBackend_.prototype.createConnection = function(request) { + return new JSONPConnection_(request, this._browserJSONP, this._baseResponseOptions); + }; + JSONPBackend_ = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_jsonp_1.BrowserJsonp, base_response_options_1.ResponseOptions])], JSONPBackend_); + return JSONPBackend_; + })(JSONPBackend); + exports.JSONPBackend_ = JSONPBackend_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_request", ["angular2/src/http/headers", "angular2/src/http/http_utils", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var headers_1 = require("angular2/src/http/headers"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var lang_1 = require("angular2/src/facade/lang"); + var Request = (function() { + function Request(requestOptions) { + var url = requestOptions.url; + this.url = requestOptions.url; + if (lang_1.isPresent(requestOptions.search)) { + var search = requestOptions.search.toString(); + if (search.length > 0) { + var prefix = '?'; + if (lang_1.StringWrapper.contains(this.url, '?')) { + prefix = (this.url[this.url.length - 1] == '&') ? '' : '&'; + } + this.url = url + prefix + search; + } + } + this._body = requestOptions.body; + this.method = http_utils_1.normalizeMethodName(requestOptions.method); + this.headers = new headers_1.Headers(requestOptions.headers); + } + Request.prototype.text = function() { + return lang_1.isPresent(this._body) ? this._body.toString() : ''; + }; + return Request; + })(); + exports.Request = Request; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/http/interfaces", "angular2/src/http/static_request", "angular2/src/http/base_request_options", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var interfaces_1 = require("angular2/src/http/interfaces"); + var static_request_1 = require("angular2/src/http/static_request"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var enums_1 = require("angular2/src/http/enums"); + function httpRequest(backend, request) { + return backend.createConnection(request).response; + } + function mergeOptions(defaultOpts, providedOpts, method, url) { + var newOptions = defaultOpts; + if (lang_1.isPresent(providedOpts)) { + newOptions = newOptions.merge(new base_request_options_1.RequestOptions({ + method: providedOpts.method, + url: providedOpts.url, + search: providedOpts.search, + headers: providedOpts.headers, + body: providedOpts.body + })); + } + if (lang_1.isPresent(method)) { + return newOptions.merge(new base_request_options_1.RequestOptions({ + method: method, + url: url + })); + } else { + return newOptions.merge(new base_request_options_1.RequestOptions({url: url})); + } + } + var Http = (function() { + function Http(_backend, _defaultOptions) { + this._backend = _backend; + this._defaultOptions = _defaultOptions; + } + Http.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + responseObservable = httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + } else if (url instanceof static_request_1.Request) { + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Http.prototype.get = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + }; + Http.prototype.post = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Post, url))); + }; + Http.prototype.put = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Put, url))); + }; + Http.prototype.delete = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Delete, url))); + }; + Http.prototype.patch = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Patch, url))); + }; + Http.prototype.head = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Head, url))); + }; + Http = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Http); + return Http; + })(); + exports.Http = Http; + var Jsonp = (function(_super) { + __extends(Jsonp, _super); + function Jsonp(backend, defaultOptions) { + _super.call(this, backend, defaultOptions); + } + Jsonp.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + url = new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url)); + } + if (url instanceof static_request_1.Request) { + if (url.method !== enums_1.RequestMethods.Get) { + exceptions_1.makeTypeError('JSONP requests must use GET request method.'); + } + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Jsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Jsonp); + return Jsonp; + })(Http); + exports.Jsonp = Jsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/http", ["angular2/angular2", "angular2/src/http/http", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/backends/browser_xhr", "angular2/src/http/backends/browser_jsonp", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/mock_backend", "angular2/src/http/static_request", "angular2/src/http/static_response", "angular2/src/http/interfaces", "angular2/src/http/backends/browser_xhr", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/http", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/src/http/url_search_params"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var http_1 = require("angular2/src/http/http"); + var xhr_backend_1 = require("angular2/src/http/backends/xhr_backend"); + var jsonp_backend_1 = require("angular2/src/http/backends/jsonp_backend"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var mock_backend_1 = require("angular2/src/http/backends/mock_backend"); + exports.MockConnection = mock_backend_1.MockConnection; + exports.MockBackend = mock_backend_1.MockBackend; + var static_request_1 = require("angular2/src/http/static_request"); + exports.Request = static_request_1.Request; + var static_response_1 = require("angular2/src/http/static_response"); + exports.Response = static_response_1.Response; + var interfaces_1 = require("angular2/src/http/interfaces"); + exports.Connection = interfaces_1.Connection; + exports.ConnectionBackend = interfaces_1.ConnectionBackend; + var browser_xhr_2 = require("angular2/src/http/backends/browser_xhr"); + exports.BrowserXhr = browser_xhr_2.BrowserXhr; + var base_request_options_2 = require("angular2/src/http/base_request_options"); + exports.BaseRequestOptions = base_request_options_2.BaseRequestOptions; + exports.RequestOptions = base_request_options_2.RequestOptions; + var base_response_options_2 = require("angular2/src/http/base_response_options"); + exports.BaseResponseOptions = base_response_options_2.BaseResponseOptions; + exports.ResponseOptions = base_response_options_2.ResponseOptions; + var xhr_backend_2 = require("angular2/src/http/backends/xhr_backend"); + exports.XHRBackend = xhr_backend_2.XHRBackend; + exports.XHRConnection = xhr_backend_2.XHRConnection; + var jsonp_backend_2 = require("angular2/src/http/backends/jsonp_backend"); + exports.JSONPBackend = jsonp_backend_2.JSONPBackend; + exports.JSONPConnection = jsonp_backend_2.JSONPConnection; + var http_2 = require("angular2/src/http/http"); + exports.Http = http_2.Http; + exports.Jsonp = http_2.Jsonp; + var headers_1 = require("angular2/src/http/headers"); + exports.Headers = headers_1.Headers; + var enums_1 = require("angular2/src/http/enums"); + exports.ResponseTypes = enums_1.ResponseTypes; + exports.ReadyStates = enums_1.ReadyStates; + exports.RequestMethods = enums_1.RequestMethods; + var url_search_params_1 = require("angular2/src/http/url_search_params"); + exports.URLSearchParams = url_search_params_1.URLSearchParams; + exports.HTTP_PROVIDERS = [angular2_1.provide(http_1.Http, { + useFactory: function(xhrBackend, requestOptions) { + return new http_1.Http(xhrBackend, requestOptions); + }, + deps: [xhr_backend_1.XHRBackend, base_request_options_1.RequestOptions] + }), browser_xhr_1.BrowserXhr, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), xhr_backend_1.XHRBackend]; + exports.HTTP_BINDINGS = exports.HTTP_PROVIDERS; + exports.JSONP_PROVIDERS = [angular2_1.provide(http_1.Jsonp, { + useFactory: function(jsonpBackend, requestOptions) { + return new http_1.Jsonp(jsonpBackend, requestOptions); + }, + deps: [jsonp_backend_1.JSONPBackend, base_request_options_1.RequestOptions] + }), browser_jsonp_1.BrowserJsonp, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), angular2_1.provide(jsonp_backend_1.JSONPBackend, {useClass: jsonp_backend_1.JSONPBackend_})]; + exports.JSON_BINDINGS = exports.JSONP_PROVIDERS; + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=http.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/http.min.js b/2.0.0-alpha.46/http.min.js new file mode 100644 index 0000000000..fa78840a6a --- /dev/null +++ b/2.0.0-alpha.46/http.min.js @@ -0,0 +1 @@ +"format register";System.register("angular2/src/http/interfaces",[],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=function(){function e(){}return e}();t.ConnectionBackend=a;var o=function(){function e(){}return e}();return t.Connection=o,r.define=s,n.exports}),System.register("angular2/src/http/headers",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=e("angular2/src/facade/lang"),o=e("angular2/src/facade/exceptions"),i=e("angular2/src/facade/collection"),c=function(){function e(t){var n=this;return t instanceof e?void(this._headersMap=t._headersMap):(this._headersMap=new i.Map,void(a.isBlank(t)||i.StringMapWrapper.forEach(t,function(e,t){n._headersMap.set(t,i.isListLikeIterable(e)?e:[e])})))}return e.prototype.append=function(e,t){var n=this._headersMap.get(e),r=i.isListLikeIterable(n)?n:[];r.push(t),this._headersMap.set(e,r)},e.prototype["delete"]=function(e){this._headersMap["delete"](e)},e.prototype.forEach=function(e){this._headersMap.forEach(e)},e.prototype.get=function(e){return i.ListWrapper.first(this._headersMap.get(e))},e.prototype.has=function(e){return this._headersMap.has(e)},e.prototype.keys=function(){return i.MapWrapper.keys(this._headersMap)},e.prototype.set=function(e,t){var n=[];if(i.isListLikeIterable(t)){var r=t.join(",");n.push(r)}else n.push(t);this._headersMap.set(e,n)},e.prototype.values=function(){return i.MapWrapper.values(this._headersMap)},e.prototype.getAll=function(e){var t=this._headersMap.get(e);return i.isListLikeIterable(t)?t:[]},e.prototype.entries=function(){throw new o.BaseException('"entries" method is not implemented on Headers class')},e}();return t.Headers=c,r.define=s,n.exports}),System.register("angular2/src/http/enums",[],!0,function(e,t,n){var r=System.global,s=r.define;return r.define=void 0,function(e){e[e.Get=0]="Get",e[e.Post=1]="Post",e[e.Put=2]="Put",e[e.Delete=3]="Delete",e[e.Options=4]="Options",e[e.Head=5]="Head",e[e.Patch=6]="Patch"}(t.RequestMethods||(t.RequestMethods={})),t.RequestMethods,!function(e){e[e.Unsent=0]="Unsent",e[e.Open=1]="Open",e[e.HeadersReceived=2]="HeadersReceived",e[e.Loading=3]="Loading",e[e.Done=4]="Done",e[e.Cancelled=5]="Cancelled"}(t.ReadyStates||(t.ReadyStates={})),t.ReadyStates,!function(e){e[e.Basic=0]="Basic",e[e.Cors=1]="Cors",e[e.Default=2]="Default",e[e.Error=3]="Error",e[e.Opaque=4]="Opaque"}(t.ResponseTypes||(t.ResponseTypes={})),t.ResponseTypes,r.define=s,n.exports}),System.register("angular2/src/http/url_search_params",["angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(e,t,n){function r(e){void 0===e&&(e="");var t=new i.Map;if(e.length>0){var n=e.split("&");n.forEach(function(e){var n=e.split("="),r=n[0],s=n[1],a=o.isPresent(t.get(r))?t.get(r):[];a.push(s),t.set(r,a)})}return t}var s=System.global,a=s.define;s.define=void 0;var o=e("angular2/src/facade/lang"),i=e("angular2/src/facade/collection"),c=function(){function e(e){void 0===e&&(e=""),this.rawParams=e,this.paramsMap=r(e)}return e.prototype.clone=function(){var t=new e;return t.appendAll(this),t},e.prototype.has=function(e){return this.paramsMap.has(e)},e.prototype.get=function(e){var t=this.paramsMap.get(e);return i.isListLikeIterable(t)?i.ListWrapper.first(t):null},e.prototype.getAll=function(e){var t=this.paramsMap.get(e);return o.isPresent(t)?t:[]},e.prototype.set=function(e,t){var n=this.paramsMap.get(e),r=o.isPresent(n)?n:[];i.ListWrapper.clear(r),r.push(t),this.paramsMap.set(e,r)},e.prototype.setAll=function(e){var t=this;e.paramsMap.forEach(function(e,n){var r=t.paramsMap.get(n),s=o.isPresent(r)?r:[];i.ListWrapper.clear(s),s.push(e[0]),t.paramsMap.set(n,s)})},e.prototype.append=function(e,t){var n=this.paramsMap.get(e),r=o.isPresent(n)?n:[];r.push(t),this.paramsMap.set(e,r)},e.prototype.appendAll=function(e){var t=this;e.paramsMap.forEach(function(e,n){for(var r=t.paramsMap.get(n),s=o.isPresent(r)?r:[],a=0;a0)throw new d.BaseException(e+" pending connections to be resolved")},e.prototype.resolveAllConnections=function(){this.connections.subscribe(function(e){return e.readyState=4})},e.prototype.createConnection=function(e){if(!(p.isPresent(e)&&e instanceof c.Request))throw new d.BaseException("createConnection requires an instance of Request, got "+e);var t=new g(e);return this.connections.next(t),t},e=a([i.Injectable(),o("design:paramtypes",[])],e)}();return t.MockBackend=y,r.define=s,n.exports}),System.register("angular2/src/http/http_utils",["angular2/src/facade/lang","angular2/src/http/enums","angular2/src/facade/exceptions","angular2/src/facade/lang"],!0,function(e,t,n){function r(e){if(o.isString(e)){var t=e;if(e=e.replace(/(\w)(\w*)/g,function(e,t,n){return t.toUpperCase()+n.toLowerCase()}),e=i.RequestMethods[e],"number"!=typeof e)throw c.makeTypeError('Invalid request method. The method "'+t+'" is not supported.')}return e}var s=System.global,a=s.define;s.define=void 0;var o=e("angular2/src/facade/lang"),i=e("angular2/src/http/enums"),c=e("angular2/src/facade/exceptions");t.normalizeMethodName=r;var u=e("angular2/src/facade/lang");return t.isJsObject=u.isJsObject,s.define=a,n.exports}),System.register("angular2/src/http/base_request_options",["angular2/src/facade/lang","angular2/src/http/headers","angular2/src/http/enums","angular2/angular2","angular2/src/http/url_search_params","angular2/src/http/http_utils"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=this&&this.__decorate||function(e,t,n,r){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,r);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,r){return void(r&&r(t,n))},void 0);case 4:return e.reduceRight(function(e,r){return r&&r(t,n,e)||e},r)}},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/facade/lang"),u=e("angular2/src/http/headers"),p=e("angular2/src/http/enums"),d=e("angular2/angular2"),l=e("angular2/src/http/url_search_params"),h=e("angular2/src/http/http_utils"),f=function(){function e(e){var t=void 0===e?{}:e,n=t.method,r=t.headers,s=t.body,a=t.url,o=t.search;this.method=c.isPresent(n)?h.normalizeMethodName(n):null,this.headers=c.isPresent(r)?r:null,this.body=c.isPresent(s)?s:null,this.url=c.isPresent(a)?a:null,this.search=c.isPresent(o)?c.isString(o)?new l.URLSearchParams(o):o:null}return e.prototype.merge=function(t){return new e({method:c.isPresent(t)&&c.isPresent(t.method)?t.method:this.method,headers:c.isPresent(t)&&c.isPresent(t.headers)?t.headers:this.headers,body:c.isPresent(t)&&c.isPresent(t.body)?t.body:this.body,url:c.isPresent(t)&&c.isPresent(t.url)?t.url:this.url,search:c.isPresent(t)&&c.isPresent(t.search)?c.isString(t.search)?new l.URLSearchParams(t.search):t.search.clone():this.search})},e}();t.RequestOptions=f;var g=function(e){function t(){e.call(this,{method:p.RequestMethods.Get,headers:new u.Headers})}return a(t,e),t=o([d.Injectable(),i("design:paramtypes",[])],t)}(f);return t.BaseRequestOptions=g,r.define=s,n.exports}),System.register("angular2/src/http/backends/xhr_backend",["angular2/src/http/enums","angular2/src/http/static_response","angular2/src/http/base_response_options","angular2/angular2","angular2/src/http/backends/browser_xhr","angular2/src/facade/lang","angular2/angular2"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=this&&this.__decorate||function(e,t,n,r){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,r);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,r){return void(r&&r(t,n))},void 0);case 4:return e.reduceRight(function(e,r){return r&&r(t,n,e)||e},r)}},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},i=e("angular2/src/http/enums"),c=e("angular2/src/http/static_response"),u=e("angular2/src/http/base_response_options"),p=e("angular2/angular2"),d=e("angular2/src/http/backends/browser_xhr"),l=e("angular2/src/facade/lang"),h=e("angular2/angular2"),f=function(){function e(e,t,n){var r=this;this.request=e,this.response=new h.Observable(function(s){var a=t.build();a.open(i.RequestMethods[e.method].toUpperCase(),e.url);var o=function(){var e=l.isPresent(a.response)?a.response:a.responseText,t=1223===a.status?204:a.status;0===t&&(t=e?200:0);var r=new u.ResponseOptions({body:e,status:t});l.isPresent(n)&&(r=n.merge(r)),s.next(new c.Response(r)),s.complete()},p=function(e){var t=new u.ResponseOptions({body:e,type:i.ResponseTypes.Error});l.isPresent(n)&&(t=n.merge(t)),s.error(new c.Response(t))};return l.isPresent(e.headers)&&e.headers.forEach(function(e,t){return a.setRequestHeader(t,e.join(","))}),a.addEventListener("load",o),a.addEventListener("error",p),a.send(r.request.text()),function(){a.removeEventListener("load",o),a.removeEventListener("error",p),a.abort()}})}return e}();t.XHRConnection=f;var g=function(){function e(e,t){this._browserXHR=e,this._baseResponseOptions=t}return e.prototype.createConnection=function(e){return new f(e,this._browserXHR,this._baseResponseOptions)},e=a([p.Injectable(),o("design:paramtypes",[d.BrowserXhr,u.ResponseOptions])],e)}();return t.XHRBackend=g,r.define=s,n.exports}),System.register("angular2/src/http/backends/jsonp_backend",["angular2/src/http/interfaces","angular2/src/http/enums","angular2/src/http/static_response","angular2/src/http/base_response_options","angular2/angular2","angular2/src/http/backends/browser_jsonp","angular2/src/facade/exceptions","angular2/src/facade/lang","angular2/angular2"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=this&&this.__decorate||function(e,t,n,r){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,r);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,r){return void(r&&r(t,n))},void 0);case 4:return e.reduceRight(function(e,r){return r&&r(t,n,e)||e},r)}},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/http/interfaces"),u=e("angular2/src/http/enums"),p=e("angular2/src/http/static_response"),d=e("angular2/src/http/base_response_options"),l=e("angular2/angular2"),h=e("angular2/src/http/backends/browser_jsonp"),f=e("angular2/src/facade/exceptions"),g=e("angular2/src/facade/lang"),y=e("angular2/angular2"),R="JSONP injected script did not invoke callback.",_="JSONP requests must use GET request method.",b=function(){function e(){}return e}();t.JSONPConnection=b;var m=function(e){function t(t,n,r){var s=this;if(e.call(this),this._dom=n,this.baseResponseOptions=r,this._finished=!1,t.method!==u.RequestMethods.Get)throw f.makeTypeError(_);this.request=t,this.response=new y.Observable(function(e){s.readyState=u.ReadyStates.Loading;var a=s._id=n.nextRequestID();n.exposeConnection(a,s);var o=n.requestCallback(s._id),i=t.url;i.indexOf("=JSONP_CALLBACK&")>-1?i=g.StringWrapper.replace(i,"=JSONP_CALLBACK&","="+o+"&"):i.lastIndexOf("=JSONP_CALLBACK")===i.length-"=JSONP_CALLBACK".length&&(i=i.substring(0,i.length-"=JSONP_CALLBACK".length)+("="+o));var c=s._script=n.build(i),l=function(t){if(s.readyState!==u.ReadyStates.Cancelled){if(s.readyState=u.ReadyStates.Done,n.cleanup(c),!s._finished){var a=new d.ResponseOptions({body:R,type:u.ResponseTypes.Error});return g.isPresent(r)&&(a=r.merge(a)),void e.error(new p.Response(a))}var o=new d.ResponseOptions({body:s._responseData});g.isPresent(s.baseResponseOptions)&&(o=s.baseResponseOptions.merge(o)),e.next(new p.Response(o)),e.complete()}},h=function(t){if(s.readyState!==u.ReadyStates.Cancelled){s.readyState=u.ReadyStates.Done,n.cleanup(c);var a=new d.ResponseOptions({body:t.message,type:u.ResponseTypes.Error});g.isPresent(r)&&(a=r.merge(a)),e.error(new p.Response(a))}};return c.addEventListener("load",l),c.addEventListener("error",h),n.send(c),function(){s.readyState=u.ReadyStates.Cancelled,c.removeEventListener("load",l),c.removeEventListener("error",h),g.isPresent(c)&&s._dom.cleanup(c)}})}return a(t,e),t.prototype.finished=function(e){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==u.ReadyStates.Cancelled&&(this._responseData=e)},t}(b);t.JSONPConnection_=m;var v=function(e){function t(){e.apply(this,arguments)}return a(t,e),t}(c.ConnectionBackend);t.JSONPBackend=v;var S=function(e){function t(t,n){e.call(this),this._browserJSONP=t,this._baseResponseOptions=n}return a(t,e),t.prototype.createConnection=function(e){return new m(e,this._browserJSONP,this._baseResponseOptions)},t=o([l.Injectable(),i("design:paramtypes",[h.BrowserJsonp,d.ResponseOptions])],t)}(v);return t.JSONPBackend_=S,r.define=s,n.exports}),System.register("angular2/src/http/static_request",["angular2/src/http/headers","angular2/src/http/http_utils","angular2/src/facade/lang"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=e("angular2/src/http/headers"),o=e("angular2/src/http/http_utils"),i=e("angular2/src/facade/lang"),c=function(){function e(e){var t=e.url;if(this.url=e.url,i.isPresent(e.search)){var n=e.search.toString();if(n.length>0){var r="?";i.StringWrapper.contains(this.url,"?")&&(r="&"==this.url[this.url.length-1]?"":"&"),this.url=t+r+n}}this._body=e.body,this.method=o.normalizeMethodName(e.method),this.headers=new a.Headers(e.headers)}return e.prototype.text=function(){return i.isPresent(this._body)?this._body.toString():""},e}();return t.Request=c,r.define=s,n.exports}),System.register("angular2/src/http/http",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/angular2","angular2/src/http/interfaces","angular2/src/http/static_request","angular2/src/http/base_request_options","angular2/src/http/enums"],!0,function(e,t,n){function r(e,t){return e.createConnection(t).response}function s(e,t,n,r){var s=e;return p.isPresent(t)&&(s=s.merge(new g.RequestOptions({method:t.method,url:t.url,search:t.search,headers:t.headers,body:t.body}))),p.isPresent(n)?s.merge(new g.RequestOptions({method:n,url:r})):s.merge(new g.RequestOptions({url:r}))}var a=System.global,o=a.define;a.define=void 0;var i=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},c=this&&this.__decorate||function(e,t,n,r){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,r);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,r){return void(r&&r(t,n))},void 0);case 4:return e.reduceRight(function(e,r){return r&&r(t,n,e)||e},r)}},u=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},p=e("angular2/src/facade/lang"),d=e("angular2/src/facade/exceptions"),l=e("angular2/angular2"),h=e("angular2/src/http/interfaces"),f=e("angular2/src/http/static_request"),g=e("angular2/src/http/base_request_options"),y=e("angular2/src/http/enums"),R=function(){function e(e,t){this._backend=e,this._defaultOptions=t}return e.prototype.request=function(e,t){var n;if(p.isString(e))n=r(this._backend,new f.Request(s(this._defaultOptions,t,y.RequestMethods.Get,e)));else{if(!(e instanceof f.Request))throw d.makeTypeError("First argument must be a url string or Request instance.");n=r(this._backend,e)}return n},e.prototype.get=function(e,t){return r(this._backend,new f.Request(s(this._defaultOptions,t,y.RequestMethods.Get,e)))},e.prototype.post=function(e,t,n){return r(this._backend,new f.Request(s(this._defaultOptions.merge(new g.RequestOptions({body:t})),n,y.RequestMethods.Post,e)))},e.prototype.put=function(e,t,n){return r(this._backend,new f.Request(s(this._defaultOptions.merge(new g.RequestOptions({body:t})),n,y.RequestMethods.Put,e)))},e.prototype["delete"]=function(e,t){return r(this._backend,new f.Request(s(this._defaultOptions,t,y.RequestMethods.Delete,e)))},e.prototype.patch=function(e,t,n){return r(this._backend,new f.Request(s(this._defaultOptions.merge(new g.RequestOptions({body:t})),n,y.RequestMethods.Patch,e)))},e.prototype.head=function(e,t){return r(this._backend,new f.Request(s(this._defaultOptions,t,y.RequestMethods.Head,e)))},e=c([l.Injectable(),u("design:paramtypes",[h.ConnectionBackend,g.RequestOptions])],e)}();t.Http=R;var _=function(e){function t(t,n){e.call(this,t,n)}return i(t,e),t.prototype.request=function(e,t){var n;if(p.isString(e)&&(e=new f.Request(s(this._defaultOptions,t,y.RequestMethods.Get,e))),!(e instanceof f.Request))throw d.makeTypeError("First argument must be a url string or Request instance.");return e.method!==y.RequestMethods.Get&&d.makeTypeError("JSONP requests must use GET request method."),n=r(this._backend,e)},t=c([l.Injectable(),u("design:paramtypes",[h.ConnectionBackend,g.RequestOptions])],t)}(R);return t.Jsonp=_,a.define=o,n.exports}),System.register("angular2/http",["angular2/angular2","angular2/src/http/http","angular2/src/http/backends/xhr_backend","angular2/src/http/backends/jsonp_backend","angular2/src/http/backends/browser_xhr","angular2/src/http/backends/browser_jsonp","angular2/src/http/base_request_options","angular2/src/http/base_response_options","angular2/src/http/backends/mock_backend","angular2/src/http/static_request","angular2/src/http/static_response","angular2/src/http/interfaces","angular2/src/http/backends/browser_xhr","angular2/src/http/base_request_options","angular2/src/http/base_response_options","angular2/src/http/backends/xhr_backend","angular2/src/http/backends/jsonp_backend","angular2/src/http/http","angular2/src/http/headers","angular2/src/http/enums","angular2/src/http/url_search_params"],!0,function(e,t,n){var r=System.global,s=r.define;r.define=void 0;var a=e("angular2/angular2"),o=e("angular2/src/http/http"),i=e("angular2/src/http/backends/xhr_backend"),c=e("angular2/src/http/backends/jsonp_backend"),u=e("angular2/src/http/backends/browser_xhr"),p=e("angular2/src/http/backends/browser_jsonp"),d=e("angular2/src/http/base_request_options"),l=e("angular2/src/http/base_response_options"),h=e("angular2/src/http/backends/mock_backend");t.MockConnection=h.MockConnection,t.MockBackend=h.MockBackend;var f=e("angular2/src/http/static_request");t.Request=f.Request;var g=e("angular2/src/http/static_response");t.Response=g.Response;var y=e("angular2/src/http/interfaces");t.Connection=y.Connection,t.ConnectionBackend=y.ConnectionBackend;var R=e("angular2/src/http/backends/browser_xhr");t.BrowserXhr=R.BrowserXhr;var _=e("angular2/src/http/base_request_options");t.BaseRequestOptions=_.BaseRequestOptions,t.RequestOptions=_.RequestOptions;var b=e("angular2/src/http/base_response_options");t.BaseResponseOptions=b.BaseResponseOptions,t.ResponseOptions=b.ResponseOptions;var m=e("angular2/src/http/backends/xhr_backend");t.XHRBackend=m.XHRBackend,t.XHRConnection=m.XHRConnection;var v=e("angular2/src/http/backends/jsonp_backend");t.JSONPBackend=v.JSONPBackend,t.JSONPConnection=v.JSONPConnection;var S=e("angular2/src/http/http");t.Http=S.Http,t.Jsonp=S.Jsonp;var O=e("angular2/src/http/headers");t.Headers=O.Headers;var w=e("angular2/src/http/enums");t.ResponseTypes=w.ResponseTypes,t.ReadyStates=w.ReadyStates,t.RequestMethods=w.RequestMethods;var P=e("angular2/src/http/url_search_params");return t.URLSearchParams=P.URLSearchParams,t.HTTP_PROVIDERS=[a.provide(o.Http,{useFactory:function(e,t){return new o.Http(e,t)},deps:[i.XHRBackend,d.RequestOptions]}),u.BrowserXhr,a.provide(d.RequestOptions,{useClass:d.BaseRequestOptions}),a.provide(l.ResponseOptions,{useClass:l.BaseResponseOptions}),i.XHRBackend],t.HTTP_BINDINGS=t.HTTP_PROVIDERS,t.JSONP_PROVIDERS=[a.provide(o.Jsonp,{useFactory:function(e,t){return new o.Jsonp(e,t)},deps:[c.JSONPBackend,d.RequestOptions]}),p.BrowserJsonp,a.provide(d.RequestOptions,{useClass:d.BaseRequestOptions}),a.provide(l.ResponseOptions,{useClass:l.BaseResponseOptions}),a.provide(c.JSONPBackend,{useClass:c.JSONPBackend_})],t.JSON_BINDINGS=t.JSONP_PROVIDERS,r.define=s,n.exports}); \ No newline at end of file diff --git a/2.0.0-alpha.46/http.sfx.dev.js b/2.0.0-alpha.46/http.sfx.dev.js new file mode 100644 index 0000000000..f43fc1ebad --- /dev/null +++ b/2.0.0-alpha.46/http.sfx.dev.js @@ -0,0 +1,36931 @@ +(function(global) { + + var defined = {}; + + // indexOf polyfill for IE8 + var indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) + if (this[i] === item) + return i; + return -1; + } + + function dedupe(deps) { + var newDeps = []; + for (var i = 0, l = deps.length; i < l; i++) + if (indexOf.call(newDeps, deps[i]) == -1) + newDeps.push(deps[i]) + return newDeps; + } + + function register(name, deps, declare, execute) { + if (typeof name != 'string') + throw "System.register provided no module name"; + + var entry; + + // dynamic + if (typeof declare == 'boolean') { + entry = { + declarative: false, + deps: deps, + execute: execute, + executingRequire: declare + }; + } + else { + // ES6 declarative + entry = { + declarative: true, + deps: deps, + declare: declare + }; + } + + entry.name = name; + + // we never overwrite an existing define + if (!(name in defined)) + defined[name] = entry; + + entry.deps = dedupe(entry.deps); + + // we have to normalize dependencies + // (assume dependencies are normalized for now) + // entry.normalizedDeps = entry.deps.map(normalize); + entry.normalizedDeps = entry.deps; + } + + function buildGroups(entry, groups) { + groups[entry.groupIndex] = groups[entry.groupIndex] || []; + + if (indexOf.call(groups[entry.groupIndex], entry) != -1) + return; + + groups[entry.groupIndex].push(entry); + + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + + // not in the registry means already linked / ES6 + if (!depEntry || depEntry.evaluated) + continue; + + // now we know the entry is in our unlinked linkage group + var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative); + + // the group index of an entry is always the maximum + if (depEntry.groupIndex === undefined || depEntry.groupIndex < depGroupIndex) { + + // if already in a group, remove from the old group + if (depEntry.groupIndex !== undefined) { + groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1); + + // if the old group is empty, then we have a mixed depndency cycle + if (groups[depEntry.groupIndex].length == 0) + throw new TypeError("Mixed dependency cycle detected"); + } + + depEntry.groupIndex = depGroupIndex; + } + + buildGroups(depEntry, groups); + } + } + + function link(name) { + var startEntry = defined[name]; + + startEntry.groupIndex = 0; + + var groups = []; + + buildGroups(startEntry, groups); + + var curGroupDeclarative = !!startEntry.declarative == groups.length % 2; + for (var i = groups.length - 1; i >= 0; i--) { + var group = groups[i]; + for (var j = 0; j < group.length; j++) { + var entry = group[j]; + + // link each group + if (curGroupDeclarative) + linkDeclarativeModule(entry); + else + linkDynamicModule(entry); + } + curGroupDeclarative = !curGroupDeclarative; + } + } + + // module binding records + var moduleRecords = {}; + function getOrCreateModuleRecord(name) { + return moduleRecords[name] || (moduleRecords[name] = { + name: name, + dependencies: [], + exports: {}, // start from an empty module and extend + importers: [] + }) + } + + function linkDeclarativeModule(entry) { + // only link if already not already started linking (stops at circular) + if (entry.module) + return; + + var module = entry.module = getOrCreateModuleRecord(entry.name); + var exports = entry.module.exports; + + var declaration = entry.declare.call(global, function(name, value) { + module.locked = true; + exports[name] = value; + + for (var i = 0, l = module.importers.length; i < l; i++) { + var importerModule = module.importers[i]; + if (!importerModule.locked) { + var importerIndex = indexOf.call(importerModule.dependencies, module); + importerModule.setters[importerIndex](exports); + } + } + + module.locked = false; + return value; + }); + + module.setters = declaration.setters; + module.execute = declaration.execute; + + if (!module.setters || !module.execute) + throw new TypeError("Invalid System.register form for " + entry.name); + + // now link all the module dependencies + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + var depModule = moduleRecords[depName]; + + // work out how to set depExports based on scenarios... + var depExports; + + if (depModule) { + depExports = depModule.exports; + } + else if (depEntry && !depEntry.declarative) { + if (depEntry.module.exports && depEntry.module.exports.__esModule) + depExports = depEntry.module.exports; + else + depExports = { 'default': depEntry.module.exports, __useDefault: true }; + } + // in the module registry + else if (!depEntry) { + depExports = load(depName); + } + // we have an entry -> link + else { + linkDeclarativeModule(depEntry); + depModule = depEntry.module; + depExports = depModule.exports; + } + + // only declarative modules have dynamic bindings + if (depModule && depModule.importers) { + depModule.importers.push(module); + module.dependencies.push(depModule); + } + else + module.dependencies.push(null); + + // run the setter for this dependency + if (module.setters[i]) + module.setters[i](depExports); + } + } + + // An analog to loader.get covering execution of all three layers (real declarative, simulated declarative, simulated dynamic) + function getModule(name) { + var exports; + var entry = defined[name]; + + if (!entry) { + exports = load(name); + if (!exports) + throw new Error("Unable to load dependency " + name + "."); + } + + else { + if (entry.declarative) + ensureEvaluated(name, []); + + else if (!entry.evaluated) + linkDynamicModule(entry); + + exports = entry.module.exports; + } + + if ((!entry || entry.declarative) && exports && exports.__useDefault) + return exports['default']; + + return exports; + } + + function linkDynamicModule(entry) { + if (entry.module) + return; + + var exports = {}; + + var module = entry.module = { exports: exports, id: entry.name }; + + // AMD requires execute the tree first + if (!entry.executingRequire) { + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + var depEntry = defined[depName]; + if (depEntry) + linkDynamicModule(depEntry); + } + } + + // now execute + entry.evaluated = true; + var output = entry.execute.call(global, function(name) { + for (var i = 0, l = entry.deps.length; i < l; i++) { + if (entry.deps[i] != name) + continue; + return getModule(entry.normalizedDeps[i]); + } + throw new TypeError('Module ' + name + ' not declared as a dependency.'); + }, exports, module); + + if (output) + module.exports = output; + } + + /* + * Given a module, and the list of modules for this current branch, + * ensure that each of the dependencies of this module is evaluated + * (unless one is a circular dependency already in the list of seen + * modules, in which case we execute it) + * + * Then we evaluate the module itself depth-first left to right + * execution to match ES6 modules + */ + function ensureEvaluated(moduleName, seen) { + var entry = defined[moduleName]; + + // if already seen, that means it's an already-evaluated non circular dependency + if (!entry || entry.evaluated || !entry.declarative) + return; + + // this only applies to declarative modules which late-execute + + seen.push(moduleName); + + for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) { + var depName = entry.normalizedDeps[i]; + if (indexOf.call(seen, depName) == -1) { + if (!defined[depName]) + load(depName); + else + ensureEvaluated(depName, seen); + } + } + + if (entry.evaluated) + return; + + entry.evaluated = true; + entry.module.execute.call(global); + } + + // magical execution function + var modules = {}; + function load(name) { + if (modules[name]) + return modules[name]; + + var entry = defined[name]; + + // first we check if this module has already been defined in the registry + if (!entry) + throw "Module " + name + " not present."; + + // recursively ensure that the module and all its + // dependencies are linked (with dependency group handling) + link(name); + + // now handle dependency execution in correct order + ensureEvaluated(name, []); + + // remove from the registry + defined[name] = undefined; + + var module = entry.module.exports; + + if (!module || !entry.declarative && module.__esModule !== true) + module = { 'default': module, __useDefault: true }; + + // return the defined module object + return modules[name] = module; + }; + + return function(mains, declare) { + + var System; + var System = { + register: register, + get: load, + set: function(name, module) { + modules[name] = module; + }, + newModule: function(module) { + return module; + }, + global: global + }; + System.set('@empty', {}); + + declare(System); + + for (var i = 0; i < mains.length; i++) + load(mains[i]); + } + +})(typeof window != 'undefined' ? window : global) +/* (['mainModule'], function(System) { + System.register(...); +}); */ + +(['angular2/http'], function(System) { + +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Class = decorators_1.Class; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var _EMPTY_ATTR_VALUE = ''; + var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); + var CssSelector = (function() { + function CssSelector() { + this.element = null; + this.classNames = []; + this.attrs = []; + this.notSelectors = []; + } + CssSelector.parse = function(selector) { + var results = []; + var _addResult = function(res, cssSel) { + if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { + cssSel.element = "*"; + } + res.push(cssSel); + }; + var cssSelector = new CssSelector(); + var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); + var match; + var current = cssSelector; + var inNot = false; + while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { + if (lang_1.isPresent(match[1])) { + if (inNot) { + throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); + } + inNot = true; + current = new CssSelector(); + cssSelector.notSelectors.push(current); + } + if (lang_1.isPresent(match[2])) { + current.setElement(match[2]); + } + if (lang_1.isPresent(match[3])) { + current.addClassName(match[3]); + } + if (lang_1.isPresent(match[4])) { + current.addAttribute(match[4], match[5]); + } + if (lang_1.isPresent(match[6])) { + inNot = false; + current = cssSelector; + } + if (lang_1.isPresent(match[7])) { + if (inNot) { + throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); + } + _addResult(results, cssSelector); + cssSelector = current = new CssSelector(); + } + } + _addResult(results, cssSelector); + return results; + }; + CssSelector.prototype.isElementSelector = function() { + return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; + }; + CssSelector.prototype.setElement = function(element) { + if (element === void 0) { + element = null; + } + if (lang_1.isPresent(element)) { + element = element.toLowerCase(); + } + this.element = element; + }; + CssSelector.prototype.getMatchingElementTemplate = function() { + var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; + var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; + var attrs = ''; + for (var i = 0; i < this.attrs.length; i += 2) { + var attrName = this.attrs[i]; + var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; + attrs += " " + attrName + attrValue; + } + return "<" + tagName + classAttr + attrs + ">"; + }; + CssSelector.prototype.addAttribute = function(name, value) { + if (value === void 0) { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(name.toLowerCase()); + if (lang_1.isPresent(value)) { + value = value.toLowerCase(); + } else { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(value); + }; + CssSelector.prototype.addClassName = function(name) { + this.classNames.push(name.toLowerCase()); + }; + CssSelector.prototype.toString = function() { + var res = ''; + if (lang_1.isPresent(this.element)) { + res += this.element; + } + if (lang_1.isPresent(this.classNames)) { + for (var i = 0; i < this.classNames.length; i++) { + res += '.' + this.classNames[i]; + } + } + if (lang_1.isPresent(this.attrs)) { + for (var i = 0; i < this.attrs.length; ) { + var attrName = this.attrs[i++]; + var attrValue = this.attrs[i++]; + res += '[' + attrName; + if (attrValue.length > 0) { + res += '=' + attrValue; + } + res += ']'; + } + } + this.notSelectors.forEach(function(notSelector) { + return res += ":not(" + notSelector + ")"; + }); + return res; + }; + return CssSelector; + })(); + exports.CssSelector = CssSelector; + var SelectorMatcher = (function() { + function SelectorMatcher() { + this._elementMap = new collection_1.Map(); + this._elementPartialMap = new collection_1.Map(); + this._classMap = new collection_1.Map(); + this._classPartialMap = new collection_1.Map(); + this._attrValueMap = new collection_1.Map(); + this._attrValuePartialMap = new collection_1.Map(); + this._listContexts = []; + } + SelectorMatcher.createNotMatcher = function(notSelectors) { + var notMatcher = new SelectorMatcher(); + notMatcher.addSelectables(notSelectors, null); + return notMatcher; + }; + SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { + var listContext = null; + if (cssSelectors.length > 1) { + listContext = new SelectorListContext(cssSelectors); + this._listContexts.push(listContext); + } + for (var i = 0; i < cssSelectors.length; i++) { + this._addSelectable(cssSelectors[i], callbackCtxt, listContext); + } + }; + SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { + var matcher = this; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); + if (lang_1.isPresent(element)) { + var isTerminal = attrs.length === 0 && classNames.length === 0; + if (isTerminal) { + this._addTerminal(matcher._elementMap, element, selectable); + } else { + matcher = this._addPartial(matcher._elementPartialMap, element); + } + } + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var isTerminal = attrs.length === 0 && index === classNames.length - 1; + var className = classNames[index]; + if (isTerminal) { + this._addTerminal(matcher._classMap, className, selectable); + } else { + matcher = this._addPartial(matcher._classPartialMap, className); + } + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var isTerminal = index === attrs.length - 2; + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + if (isTerminal) { + var terminalMap = matcher._attrValueMap; + var terminalValuesMap = terminalMap.get(attrName); + if (lang_1.isBlank(terminalValuesMap)) { + terminalValuesMap = new collection_1.Map(); + terminalMap.set(attrName, terminalValuesMap); + } + this._addTerminal(terminalValuesMap, attrValue, selectable); + } else { + var parttialMap = matcher._attrValuePartialMap; + var partialValuesMap = parttialMap.get(attrName); + if (lang_1.isBlank(partialValuesMap)) { + partialValuesMap = new collection_1.Map(); + parttialMap.set(attrName, partialValuesMap); + } + matcher = this._addPartial(partialValuesMap, attrValue); + } + } + } + }; + SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { + var terminalList = map.get(name); + if (lang_1.isBlank(terminalList)) { + terminalList = []; + map.set(name, terminalList); + } + terminalList.push(selectable); + }; + SelectorMatcher.prototype._addPartial = function(map, name) { + var matcher = map.get(name); + if (lang_1.isBlank(matcher)) { + matcher = new SelectorMatcher(); + map.set(name, matcher); + } + return matcher; + }; + SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { + var result = false; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + for (var i = 0; i < this._listContexts.length; i++) { + this._listContexts[i].alreadyMatched = false; + } + result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var className = classNames[index]; + result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + var terminalValuesMap = this._attrValueMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; + var partialValuesMap = this._attrValuePartialMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; + } + } + return result; + }; + SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var selectables = map.get(name); + var starSelectables = map.get("*"); + if (lang_1.isPresent(starSelectables)) { + selectables = selectables.concat(starSelectables); + } + if (lang_1.isBlank(selectables)) { + return false; + } + var selectable; + var result = false; + for (var index = 0; index < selectables.length; index++) { + selectable = selectables[index]; + result = selectable.finalize(cssSelector, matchedCallback) || result; + } + return result; + }; + SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var nestedSelector = map.get(name); + if (lang_1.isBlank(nestedSelector)) { + return false; + } + return nestedSelector.match(cssSelector, matchedCallback); + }; + return SelectorMatcher; + })(); + exports.SelectorMatcher = SelectorMatcher; + var SelectorListContext = (function() { + function SelectorListContext(selectors) { + this.selectors = selectors; + this.alreadyMatched = false; + } + return SelectorListContext; + })(); + exports.SelectorListContext = SelectorListContext; + var SelectorContext = (function() { + function SelectorContext(selector, cbContext, listContext) { + this.selector = selector; + this.cbContext = cbContext; + this.listContext = listContext; + this.notSelectors = selector.notSelectors; + } + SelectorContext.prototype.finalize = function(cssSelector, callback) { + var result = true; + if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); + result = !notMatcher.match(cssSelector, null); + } + if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + if (lang_1.isPresent(this.listContext)) { + this.listContext.alreadyMatched = true; + } + callback(this.selector, this.cbContext); + } + return result; + }; + return SelectorContext; + })(); + exports.SelectorContext = SelectorContext; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\$/g; + var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\$/g; + exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + function escapeSingleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; + } + exports.escapeSingleQuoteString = escapeSingleQuoteString; + function escapeDoubleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; + } + exports.escapeDoubleQuoteString = escapeDoubleQuoteString; + function escapeString(input, re) { + return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { + if (match[0] == '$') { + return lang_1.IS_DART ? '\\$' : '$'; + } else if (match[0] == '\n') { + return '\\n'; + } else { + return "\\" + match[0]; + } + }); + } + function codeGenExportVariable(name) { + if (lang_1.IS_DART) { + return "const " + name + " = "; + } else { + return "var " + name + " = exports['" + name + "'] = "; + } + } + exports.codeGenExportVariable = codeGenExportVariable; + function codeGenConstConstructorCall(name) { + if (lang_1.IS_DART) { + return "const " + name; + } else { + return "new " + name; + } + } + exports.codeGenConstConstructorCall = codeGenConstConstructorCall; + function codeGenValueFn(params, value, fnName) { + if (fnName === void 0) { + fnName = ''; + } + if (lang_1.IS_DART) { + return fnName + "(" + params.join(',') + ") => " + value; + } else { + return "function " + fnName + "(" + params.join(',') + ") { return " + value + "; }"; + } + } + exports.codeGenValueFn = codeGenValueFn; + function codeGenToString(expr) { + if (lang_1.IS_DART) { + return "'${" + expr + "}'"; + } else { + return expr; + } + } + exports.codeGenToString = codeGenToString; + function splitAtColon(input, defaultValues) { + var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); + if (parts.length > 1) { + return parts; + } else { + return defaultValues; + } + } + exports.splitAtColon = splitAtColon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; + function moduleRef(moduleUrl) { + return "#MODULE[" + moduleUrl + "]"; + } + exports.moduleRef = moduleRef; + var SourceModule = (function() { + function SourceModule(moduleUrl, sourceWithModuleRefs) { + this.moduleUrl = moduleUrl; + this.sourceWithModuleRefs = sourceWithModuleRefs; + } + SourceModule.prototype.getSourceWithImports = function() { + var _this = this; + var moduleAliases = {}; + var imports = []; + var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { + var moduleUrl = match[1]; + var alias = moduleAliases[moduleUrl]; + if (lang_1.isBlank(alias)) { + if (moduleUrl == _this.moduleUrl) { + alias = ''; + } else { + alias = "import" + imports.length; + imports.push([moduleUrl, alias]); + } + moduleAliases[moduleUrl] = alias; + } + return alias.length > 0 ? alias + "." : ''; + }); + return new SourceWithImports(newSource, imports); + }; + return SourceModule; + })(); + exports.SourceModule = SourceModule; + var SourceExpression = (function() { + function SourceExpression(declarations, expression) { + this.declarations = declarations; + this.expression = expression; + } + return SourceExpression; + })(); + exports.SourceExpression = SourceExpression; + var SourceExpressions = (function() { + function SourceExpressions(declarations, expressions) { + this.declarations = declarations; + this.expressions = expressions; + } + return SourceExpressions; + })(); + exports.SourceExpressions = SourceExpressions; + var SourceWithImports = (function() { + function SourceWithImports(source, imports) { + this.source = source; + this.imports = imports; + } + return SourceWithImports; + })(); + exports.SourceWithImports = SourceWithImports; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var TextAst = (function() { + function TextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + TextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return TextAst; + })(); + exports.TextAst = TextAst; + var BoundTextAst = (function() { + function BoundTextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + BoundTextAst.prototype.visit = function(visitor, context) { + return visitor.visitBoundText(this, context); + }; + return BoundTextAst; + })(); + exports.BoundTextAst = BoundTextAst; + var AttrAst = (function() { + function AttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + AttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return AttrAst; + })(); + exports.AttrAst = AttrAst; + var BoundElementPropertyAst = (function() { + function BoundElementPropertyAst(name, type, value, unit, sourceInfo) { + this.name = name; + this.type = type; + this.value = value; + this.unit = unit; + this.sourceInfo = sourceInfo; + } + BoundElementPropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitElementProperty(this, context); + }; + return BoundElementPropertyAst; + })(); + exports.BoundElementPropertyAst = BoundElementPropertyAst; + var BoundEventAst = (function() { + function BoundEventAst(name, target, handler, sourceInfo) { + this.name = name; + this.target = target; + this.handler = handler; + this.sourceInfo = sourceInfo; + } + BoundEventAst.prototype.visit = function(visitor, context) { + return visitor.visitEvent(this, context); + }; + Object.defineProperty(BoundEventAst.prototype, "fullName", { + get: function() { + if (lang_1.isPresent(this.target)) { + return this.target + ":" + this.name; + } else { + return this.name; + } + }, + enumerable: true, + configurable: true + }); + return BoundEventAst; + })(); + exports.BoundEventAst = BoundEventAst; + var VariableAst = (function() { + function VariableAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + VariableAst.prototype.visit = function(visitor, context) { + return visitor.visitVariable(this, context); + }; + return VariableAst; + })(); + exports.VariableAst = VariableAst; + var ElementAst = (function() { + function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.inputs = inputs; + this.outputs = outputs; + this.exportAsVars = exportAsVars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + ElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + ElementAst.prototype.isBound = function() { + return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); + }; + ElementAst.prototype.getComponent = function() { + return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; + }; + return ElementAst; + })(); + exports.ElementAst = ElementAst; + var EmbeddedTemplateAst = (function() { + function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceInfo) { + this.attrs = attrs; + this.outputs = outputs; + this.vars = vars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + EmbeddedTemplateAst.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return EmbeddedTemplateAst; + })(); + exports.EmbeddedTemplateAst = EmbeddedTemplateAst; + var BoundDirectivePropertyAst = (function() { + function BoundDirectivePropertyAst(directiveName, templateName, value, sourceInfo) { + this.directiveName = directiveName; + this.templateName = templateName; + this.value = value; + this.sourceInfo = sourceInfo; + } + BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitDirectiveProperty(this, context); + }; + return BoundDirectivePropertyAst; + })(); + exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; + var DirectiveAst = (function() { + function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceInfo) { + this.directive = directive; + this.inputs = inputs; + this.hostProperties = hostProperties; + this.hostEvents = hostEvents; + this.exportAsVars = exportAsVars; + this.sourceInfo = sourceInfo; + } + DirectiveAst.prototype.visit = function(visitor, context) { + return visitor.visitDirective(this, context); + }; + return DirectiveAst; + })(); + exports.DirectiveAst = DirectiveAst; + var NgContentAst = (function() { + function NgContentAst(index, ngContentIndex, sourceInfo) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + NgContentAst.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return NgContentAst; + })(); + exports.NgContentAst = NgContentAst; + (function(PropertyBindingType) { + PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; + PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; + PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; + PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; + })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); + var PropertyBindingType = exports.PropertyBindingType; + function templateVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.templateVisitAll = templateVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Codegen = (function() { + function Codegen(moduleAlias) {} + Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { + throw "Not implemented in JS"; + }; + Codegen.prototype.toString = function() { + throw "Not implemented in JS"; + }; + return Codegen; + })(); + exports.Codegen = Codegen; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var ShadowCss = (function() { + function ShadowCss() { + this.strictStyling = true; + } + ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { + if (hostSelector === void 0) { + hostSelector = ''; + } + cssText = stripComments(cssText); + cssText = this._insertDirectives(cssText); + return this._scopeCssText(cssText, selector, hostSelector); + }; + ShadowCss.prototype._insertDirectives = function(cssText) { + cssText = this._insertPolyfillDirectivesInCssText(cssText); + return this._insertPolyfillRulesInCssText(cssText); + }; + ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { + return m[1] + '{'; + }); + }; + ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[1], ''); + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + return m[3] + rule; + }); + }; + ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { + var unscoped = this._extractUnscopedRulesFromCssText(cssText); + cssText = this._insertPolyfillHostInCssText(cssText); + cssText = this._convertColonHost(cssText); + cssText = this._convertColonHostContext(cssText); + cssText = this._convertShadowDOMSelectors(cssText); + if (lang_1.isPresent(scopeSelector)) { + cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); + } + cssText = cssText + '\n' + unscoped; + return cssText.trim(); + }; + ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { + var r = '', + m; + var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); + while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); + r += rule + '\n\n'; + } + return r; + }; + ShadowCss.prototype._convertColonHost = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); + }; + ShadowCss.prototype._convertColonHostContext = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); + }; + ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { + return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { + if (lang_1.isPresent(m[2])) { + var parts = m[2].split(','), + r = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + if (lang_1.isBlank(p)) + break; + p = p.trim(); + r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); + } + return r.join(','); + } else { + return _polyfillHostNoCombinator + m[3]; + } + }); + }; + ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { + if (lang_1.StringWrapper.contains(part, _polyfillHost)) { + return this._colonHostPartReplacer(host, part, suffix); + } else { + return host + part + suffix + ', ' + part + ' ' + host + suffix; + } + }; + ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { + return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; + }; + ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { + for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { + cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); + } + return cssText; + }; + ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { + var _this = this; + return processRules(cssText, function(rule) { + var selector = rule.selector; + var content = rule.content; + if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { + selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); + } else if (rule.selector.startsWith('@media')) { + content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); + } + return new CssRule(selector, content); + }); + }; + ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { + var r = [], + parts = selector.split(','); + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + p = p.trim(); + if (this._selectorNeedsScoping(p, scopeSelector)) { + p = strict && !lang_1.StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector); + } + r.push(p); + } + return r.join(', '); + }; + ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { + var re = this._makeScopeMatcher(scopeSelector); + return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); + }; + ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { + var lre = /\[/g; + var rre = /\]/g; + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); + return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); + }; + ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { + return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); + }; + ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { + if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { + var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; + selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); + return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); + } else { + return scopeSelector + ' ' + selector; + } + }; + ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { + var isRe = /\[is=([^\]]*)\]/g; + scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { + return m[1]; + }); + var splits = [' ', '>', '+', '~'], + scoped = selector, + attrName = '[' + scopeSelector + ']'; + for (var i = 0; i < splits.length; i++) { + var sep = splits[i]; + var parts = scoped.split(sep); + scoped = parts.map(function(p) { + var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); + if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { + var re = /([^:]*)(:*)(.*)/g; + var m = lang_1.RegExpWrapper.firstMatch(re, t); + if (lang_1.isPresent(m)) { + p = m[1] + attrName + m[2] + m[3]; + } + } + return p; + }).join(sep); + } + return scoped; + }; + ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); + return selector; + }; + return ShadowCss; + })(); + exports.ShadowCss = ShadowCss; + var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; + var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _polyfillHost = '-shadowcsshost'; + var _polyfillHostContext = '-shadowcsscontext'; + var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; + var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); + var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); + var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; + var _shadowDOMSelectorsRe = [/>>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow-deep\//g, /\/shadow\//g]; + var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; + var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); + var _colonHostRe = /:host/gim; + var _colonHostContextRe = /:host-context/gim; + var _commentRe = /\/\*[\s\S]*?\*\//g; + function stripComments(input) { + return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { + return ''; + }); + } + var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; + var _curlyRe = /([{}])/g; + var OPEN_CURLY = '{'; + var CLOSE_CURLY = '}'; + var BLOCK_PLACEHOLDER = '%BLOCK%'; + var CssRule = (function() { + function CssRule(selector, content) { + this.selector = selector; + this.content = content; + } + return CssRule; + })(); + exports.CssRule = CssRule; + function processRules(input, ruleCallback) { + var inputWithEscapedBlocks = escapeBlocks(input); + var nextBlockIndex = 0; + return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { + var selector = m[2]; + var content = ''; + var suffix = m[4]; + var contentPrefix = ''; + if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { + content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; + suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); + contentPrefix = '{'; + } + var rule = ruleCallback(new CssRule(selector, content)); + return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; + }); + } + exports.processRules = processRules; + var StringWithEscapedBlocks = (function() { + function StringWithEscapedBlocks(escapedString, blocks) { + this.escapedString = escapedString; + this.blocks = blocks; + } + return StringWithEscapedBlocks; + })(); + function escapeBlocks(input) { + var inputParts = lang_1.StringWrapper.split(input, _curlyRe); + var resultParts = []; + var escapedBlocks = []; + var bracketCount = 0; + var currentBlockParts = []; + for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { + var part = inputParts[partIndex]; + if (part == CLOSE_CURLY) { + bracketCount--; + } + if (bracketCount > 0) { + currentBlockParts.push(part); + } else { + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + currentBlockParts = []; + } + resultParts.push(part); + } + if (part == OPEN_CURLY) { + bracketCount++; + } + } + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + } + return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var StyleWithImports = (function() { + function StyleWithImports(style, styleUrls) { + this.style = style; + this.styleUrls = styleUrls; + } + return StyleWithImports; + })(); + exports.StyleWithImports = StyleWithImports; + function isStyleUrlResolvable(url) { + if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') + return false; + var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); + return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; + } + exports.isStyleUrlResolvable = isStyleUrlResolvable; + function extractStyleUrls(resolver, baseUrl, cssText) { + var foundUrls = []; + var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { + var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; + if (!isStyleUrlResolvable(url)) { + return m[0]; + } + foundUrls.push(resolver.resolve(baseUrl, url)); + return ''; + }); + return new StyleWithImports(modifiedCssText, foundUrls); + } + exports.extractStyleUrls = extractStyleUrls; + var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; + var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/command_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/template_commands", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + exports.TEMPLATE_COMMANDS_MODULE_REF = source_module_1.moduleRef("package:angular2/src/core/linker/template_commands" + util_1.MODULE_SUFFIX); + var IMPLICIT_TEMPLATE_VAR = '\$implicit'; + var CLASS_ATTR = 'class'; + var STYLE_ATTR = 'style'; + var CommandCompiler = (function() { + function CommandCompiler() {} + CommandCompiler.prototype.compileComponentRuntime = function(component, template, changeDetectorFactories, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories), 0); + template_ast_1.templateVisitAll(visitor, template); + return visitor.result; + }; + CommandCompiler.prototype.compileComponentCodeGen = function(component, template, changeDetectorFactoryExpressions, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions), 0); + template_ast_1.templateVisitAll(visitor, template); + return new source_module_1.SourceExpression([], codeGenArray(visitor.result)); + }; + CommandCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], CommandCompiler); + return CommandCompiler; + })(); + exports.CommandCompiler = CommandCompiler; + var RuntimeCommandFactory = (function() { + function RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactories = changeDetectorFactories; + } + RuntimeCommandFactory.prototype._mapDirectives = function(directives) { + return directives.map(function(directive) { + return directive.type.runtime; + }); + }; + RuntimeCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new template_commands_1.TextCmd(value, isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new template_commands_1.NgContentCmd(index, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + return new template_commands_1.BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createEndElement = function() { + return new template_commands_1.EndElementCmd(); + }; + RuntimeCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var nestedTemplateAccessor = this.componentTemplateFactory(directives[0]); + return new template_commands_1.BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), encapsulation, ngContentIndex, nestedTemplateAccessor); + }; + RuntimeCommandFactory.prototype.createEndComponent = function() { + return new template_commands_1.EndComponentCmd(); + }; + RuntimeCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new template_commands_1.EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, this._mapDirectives(directives), isMerged, ngContentIndex, this.changeDetectorFactories[embeddedTemplateIndex], children); + }; + return RuntimeCommandFactory; + })(); + var CodegenCommandFactory = (function() { + function CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactoryExpressions = changeDetectorFactoryExpressions; + } + CodegenCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'TextCmd') + "(" + util_1.escapeSingleQuoteString(value) + ", " + isBound + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'NgContentCmd') + "(" + index + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginElementCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + isBound + ", " + ngContentIndex + ")")); + }; + CodegenCommandFactory.prototype.createEndElement = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndElementCmd') + "()"); + }; + CodegenCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginComponentCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + codeGenViewEncapsulation(encapsulation) + ", " + ngContentIndex + ", " + this.componentTemplateFactory(directives[0]) + ")")); + }; + CodegenCommandFactory.prototype.createEndComponent = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndComponentCmd') + "()"); + }; + CodegenCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EmbeddedTemplateCmd') + "(" + codeGenArray(attrNameAndValues) + ", " + codeGenArray(variableNameAndValues) + ", ") + (codeGenDirectivesArray(directives) + ", " + isMerged + ", " + ngContentIndex + ", " + this.changeDetectorFactoryExpressions[embeddedTemplateIndex] + ", " + codeGenArray(children) + ")")); + }; + return CodegenCommandFactory; + })(); + function visitAndReturnContext(visitor, asts, context) { + template_ast_1.templateVisitAll(visitor, asts, context); + return context; + } + var CommandBuilderVisitor = (function() { + function CommandBuilderVisitor(commandFactory, embeddedTemplateIndex) { + this.commandFactory = commandFactory; + this.embeddedTemplateIndex = embeddedTemplateIndex; + this.result = []; + this.transitiveNgContentCount = 0; + } + CommandBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { + var attrs = keyValueArrayToMap(visitAndReturnContext(this, attrAsts, [])); + directives.forEach(function(directiveMeta) { + collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { + var prevValue = attrs[name]; + attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; + }); + }); + return mapToKeyValueArray(attrs); + }; + CommandBuilderVisitor.prototype.visitNgContent = function(ast, context) { + this.transitiveNgContentCount++; + this.result.push(this.commandFactory.createNgContent(ast.index, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + var _this = this; + this.embeddedTemplateIndex++; + var childVisitor = new CommandBuilderVisitor(this.commandFactory, this.embeddedTemplateIndex); + template_ast_1.templateVisitAll(childVisitor, ast.children); + var isMerged = childVisitor.transitiveNgContentCount > 0; + var variableNameAndValues = []; + ast.vars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR); + }); + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, [], [], directives)); + }); + this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex, this._readAttrNameAndValues(directives, ast.attrs), variableNameAndValues, directives, isMerged, ast.ngContentIndex, childVisitor.result)); + this.transitiveNgContentCount += childVisitor.transitiveNgContentCount; + this.embeddedTemplateIndex = childVisitor.embeddedTemplateIndex; + return null; + }; + CommandBuilderVisitor.prototype.visitElement = function(ast, context) { + var _this = this; + var component = ast.getComponent(); + var eventTargetAndNames = visitAndReturnContext(this, ast.outputs, []); + var variableNameAndValues = []; + if (lang_1.isBlank(component)) { + ast.exportAsVars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(null); + }); + } + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, eventTargetAndNames, variableNameAndValues, directives)); + }); + eventTargetAndNames = removeKeyValueArrayDuplicates(eventTargetAndNames); + var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); + if (lang_1.isPresent(component)) { + this.result.push(this.commandFactory.createBeginComponent(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, component.template.encapsulation, ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndComponent()); + } else { + this.result.push(this.commandFactory.createBeginElement(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, ast.isBound(), ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndElement()); + } + return null; + }; + CommandBuilderVisitor.prototype.visitVariable = function(ast, ctx) { + return null; + }; + CommandBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { + attrNameAndValues.push(ast.name); + attrNameAndValues.push(ast.value); + return null; + }; + CommandBuilderVisitor.prototype.visitBoundText = function(ast, context) { + this.result.push(this.commandFactory.createText(null, true, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitText = function(ast, context) { + this.result.push(this.commandFactory.createText(ast.value, false, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitDirective = function(ast, ctx) { + ctx.targetDirectives.push(ast.directive); + template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.eventTargetAndNames); + ast.exportAsVars.forEach(function(varAst) { + ctx.targetVariableNameAndValues.push(varAst.name); + ctx.targetVariableNameAndValues.push(ctx.index); + }); + return null; + }; + CommandBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { + eventTargetAndNames.push(ast.target); + eventTargetAndNames.push(ast.name); + return null; + }; + CommandBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { + return null; + }; + CommandBuilderVisitor.prototype.visitElementProperty = function(ast, context) { + return null; + }; + return CommandBuilderVisitor; + })(); + function removeKeyValueArrayDuplicates(keyValueArray) { + var knownPairs = new Set(); + var resultKeyValueArray = []; + for (var i = 0; i < keyValueArray.length; i += 2) { + var key = keyValueArray[i]; + var value = keyValueArray[i + 1]; + var pairId = key + ":" + value; + if (!collection_1.SetWrapper.has(knownPairs, pairId)) { + resultKeyValueArray.push(key); + resultKeyValueArray.push(value); + knownPairs.add(pairId); + } + } + return resultKeyValueArray; + } + function keyValueArrayToMap(keyValueArr) { + var data = {}; + for (var i = 0; i < keyValueArr.length; i += 2) { + data[keyValueArr[i]] = keyValueArr[i + 1]; + } + return data; + } + function mapToKeyValueArray(data) { + var entryArray = []; + collection_1.StringMapWrapper.forEach(data, function(value, name) { + entryArray.push([name, value]); + }); + collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + var keyValueArray = []; + entryArray.forEach(function(entry) { + keyValueArray.push(entry[0]); + keyValueArray.push(entry[1]); + }); + return keyValueArray; + } + function mergeAttributeValue(attrName, attrValue1, attrValue2) { + if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { + return attrValue1 + " " + attrValue2; + } else { + return attrValue2; + } + } + var DirectiveContext = (function() { + function DirectiveContext(index, eventTargetAndNames, targetVariableNameAndValues, targetDirectives) { + this.index = index; + this.eventTargetAndNames = eventTargetAndNames; + this.targetVariableNameAndValues = targetVariableNameAndValues; + this.targetDirectives = targetDirectives; + } + return DirectiveContext; + })(); + var Expression = (function() { + function Expression(value) { + this.value = value; + } + return Expression; + })(); + function escapeValue(value) { + if (value instanceof Expression) { + return value.value; + } else if (lang_1.isString(value)) { + return util_1.escapeSingleQuoteString(value); + } else if (lang_1.isBlank(value)) { + return 'null'; + } else { + return "" + value; + } + } + function codeGenArray(data) { + var base = "[" + data.map(escapeValue).join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenDirectivesArray(directives) { + var expressions = directives.map(function(directiveType) { + return ("" + source_module_1.moduleRef(directiveType.type.moduleUrl) + directiveType.type.name); + }); + var base = "[" + expressions.join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenViewEncapsulation(value) { + if (lang_1.IS_DART) { + return "" + exports.TEMPLATE_COMMANDS_MODULE_REF + value; + } else { + return "" + value; + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var HtmlTextAst = (function() { + function HtmlTextAst(value, sourceInfo) { + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlTextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return HtmlTextAst; + })(); + exports.HtmlTextAst = HtmlTextAst; + var HtmlAttrAst = (function() { + function HtmlAttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlAttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return HtmlAttrAst; + })(); + exports.HtmlAttrAst = HtmlAttrAst; + var HtmlElementAst = (function() { + function HtmlElementAst(name, attrs, children, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.children = children; + this.sourceInfo = sourceInfo; + } + HtmlElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + return HtmlElementAst; + })(); + exports.HtmlElementAst = HtmlElementAst; + function htmlVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.htmlVisitAll = htmlVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var NG_CONTENT_SELECT_ATTR = 'select'; + var NG_CONTENT_ELEMENT = 'ng-content'; + var LINK_ELEMENT = 'link'; + var LINK_STYLE_REL_ATTR = 'rel'; + var LINK_STYLE_HREF_ATTR = 'href'; + var LINK_STYLE_REL_VALUE = 'stylesheet'; + var STYLE_ELEMENT = 'style'; + var SCRIPT_ELEMENT = 'script'; + var NG_NON_BINDABLE_ATTR = 'ng-non-bindable'; + function preparseElement(ast) { + var selectAttr = null; + var hrefAttr = null; + var relAttr = null; + var nonBindable = false; + ast.attrs.forEach(function(attr) { + if (attr.name == NG_CONTENT_SELECT_ATTR) { + selectAttr = attr.value; + } else if (attr.name == LINK_STYLE_HREF_ATTR) { + hrefAttr = attr.value; + } else if (attr.name == LINK_STYLE_REL_ATTR) { + relAttr = attr.value; + } else if (attr.name == NG_NON_BINDABLE_ATTR) { + nonBindable = true; + } + }); + selectAttr = normalizeNgContentSelect(selectAttr); + var nodeName = ast.name; + var type = PreparsedElementType.OTHER; + if (nodeName == NG_CONTENT_ELEMENT) { + type = PreparsedElementType.NG_CONTENT; + } else if (nodeName == STYLE_ELEMENT) { + type = PreparsedElementType.STYLE; + } else if (nodeName == SCRIPT_ELEMENT) { + type = PreparsedElementType.SCRIPT; + } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { + type = PreparsedElementType.STYLESHEET; + } + return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable); + } + exports.preparseElement = preparseElement; + (function(PreparsedElementType) { + PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; + PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; + PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; + PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; + PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; + })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); + var PreparsedElementType = exports.PreparsedElementType; + var PreparsedElement = (function() { + function PreparsedElement(type, selectAttr, hrefAttr, nonBindable) { + this.type = type; + this.selectAttr = selectAttr; + this.hrefAttr = hrefAttr; + this.nonBindable = nonBindable; + } + return PreparsedElement; + })(); + exports.PreparsedElement = PreparsedElement; + function normalizeNgContentSelect(selectAttr) { + if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { + return '*'; + } + return selectAttr; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var TemplateNormalizer = (function() { + function TemplateNormalizer(_xhr, _urlResolver, _domParser) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._domParser = _domParser; + } + TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { + var _this = this; + if (lang_1.isPresent(template.template)) { + return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); + } else if (lang_1.isPresent(template.templateUrl)) { + var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); + return this._xhr.get(sourceAbsUrl).then(function(templateContent) { + return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); + }); + } else { + throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); + } + }; + TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { + var _this = this; + var domNodes = this._domParser.parse(template, directiveType.name); + var visitor = new TemplatePreparseVisitor(); + html_ast_1.htmlVisitAll(visitor, domNodes); + var allStyles = templateMeta.styles.concat(visitor.styles); + var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(templateAbsUrl, url); + }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(directiveType.moduleUrl, url); + })); + var allResolvedStyles = allStyles.map(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); + styleWithImports.styleUrls.forEach(function(styleUrl) { + return allStyleAbsUrls.push(styleUrl); + }); + return styleWithImports.style; + }); + var encapsulation = templateMeta.encapsulation; + if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { + encapsulation = view_1.ViewEncapsulation.None; + } + return new directive_metadata_1.CompileTemplateMetadata({ + encapsulation: encapsulation, + template: template, + templateUrl: templateAbsUrl, + styles: allResolvedStyles, + styleUrls: allStyleAbsUrls, + ngContentSelectors: visitor.ngContentSelectors + }); + }; + TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); + return TemplateNormalizer; + })(); + exports.TemplateNormalizer = TemplateNormalizer; + var TemplatePreparseVisitor = (function() { + function TemplatePreparseVisitor() { + this.ngContentSelectors = []; + this.styles = []; + this.styleUrls = []; + this.ngNonBindableStackCount = 0; + } + TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { + var preparsedElement = template_preparser_1.preparseElement(ast); + switch (preparsedElement.type) { + case template_preparser_1.PreparsedElementType.NG_CONTENT: + if (this.ngNonBindableStackCount === 0) { + this.ngContentSelectors.push(preparsedElement.selectAttr); + } + break; + case template_preparser_1.PreparsedElementType.STYLE: + var textContent = ''; + ast.children.forEach(function(child) { + if (child instanceof html_ast_1.HtmlTextAst) { + textContent += child.value; + } + }); + this.styles.push(textContent); + break; + case template_preparser_1.PreparsedElementType.STYLESHEET: + this.styleUrls.push(preparsedElement.hrefAttr); + break; + } + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount++; + } + html_ast_1.htmlVisitAll(this, ast.children); + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount--; + } + return null; + }; + TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + TemplatePreparseVisitor.prototype.visitText = function(ast, context) { + return null; + }; + return TemplatePreparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cpl = require("angular2/src/compiler/directive_metadata"); + var md = require("angular2/src/core/metadata/directives"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var di_2 = require("angular2/src/core/di"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var util_1 = require("angular2/src/compiler/util"); + var RuntimeMetadataResolver = (function() { + function RuntimeMetadataResolver(_directiveResolver, _viewResolver, _platformDirectives) { + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._platformDirectives = _platformDirectives; + this._cache = new Map(); + } + RuntimeMetadataResolver.prototype.getMetadata = function(directiveType) { + var meta = this._cache.get(directiveType); + if (lang_1.isBlank(meta)) { + var dirMeta = this._directiveResolver.resolve(directiveType); + var moduleUrl = calcModuleUrl(directiveType, dirMeta); + var templateMeta = null; + var changeDetectionStrategy = null; + if (dirMeta instanceof md.ComponentMetadata) { + var cmpMeta = dirMeta; + var viewMeta = this._viewResolver.resolve(directiveType); + templateMeta = new cpl.CompileTemplateMetadata({ + encapsulation: viewMeta.encapsulation, + template: viewMeta.template, + templateUrl: viewMeta.templateUrl, + styles: viewMeta.styles, + styleUrls: viewMeta.styleUrls + }); + changeDetectionStrategy = cmpMeta.changeDetection; + } + meta = cpl.CompileDirectiveMetadata.create({ + selector: dirMeta.selector, + exportAs: dirMeta.exportAs, + isComponent: lang_1.isPresent(templateMeta), + dynamicLoadable: true, + type: new cpl.CompileTypeMetadata({ + name: lang_1.stringify(directiveType), + moduleUrl: moduleUrl, + runtime: directiveType + }), + template: templateMeta, + changeDetection: changeDetectionStrategy, + inputs: dirMeta.inputs, + outputs: dirMeta.outputs, + host: dirMeta.host, + lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { + return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); + }) + }); + this._cache.set(directiveType, meta); + } + return meta; + }; + RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { + var _this = this; + var view = this._viewResolver.resolve(component); + var directives = flattenDirectives(view, this._platformDirectives); + for (var i = 0; i < directives.length; i++) { + if (!isValidDirective(directives[i])) { + throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); + } + } + return removeDuplicates(directives).map(function(type) { + return _this.getMetadata(type); + }); + }; + RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(2, di_2.Optional()), __param(2, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, Array])], RuntimeMetadataResolver); + return RuntimeMetadataResolver; + })(); + exports.RuntimeMetadataResolver = RuntimeMetadataResolver; + function removeDuplicates(items) { + var m = new Map(); + items.forEach(function(i) { + return m.set(i, null); + }); + return collection_1.MapWrapper.keys(m); + } + function flattenDirectives(view, platformDirectives) { + var directives = []; + if (lang_1.isPresent(platformDirectives)) { + flattenArray(platformDirectives, directives); + } + if (lang_1.isPresent(view.directives)) { + flattenArray(view.directives, directives); + } + return directives; + } + function flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + flattenArray(item, out); + } else { + out.push(item); + } + } + } + function isValidDirective(value) { + return lang_1.isPresent(value) && (value instanceof lang_1.Type); + } + function calcModuleUrl(type, dirMeta) { + if (lang_1.isPresent(dirMeta.moduleId)) { + return "package:" + dirMeta.moduleId + util_1.MODULE_SUFFIX; + } else { + return reflection_1.reflector.importUri(type); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var promise_1 = require("angular2/src/facade/promise"); + var lang_1 = require("angular2/src/facade/lang"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var XHRImpl = (function(_super) { + __extends(XHRImpl, _super); + function XHRImpl() { + _super.apply(this, arguments); + } + XHRImpl.prototype.get = function(url) { + var completer = promise_1.PromiseWrapper.completer(); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'text'; + xhr.onload = function() { + var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + if (200 <= status && status <= 300) { + completer.resolve(response); + } else { + completer.reject("Failed to load " + url, null); + } + }; + xhr.onerror = function() { + completer.reject("Failed to load " + url, null); + }; + xhr.send(); + return completer.promise; + }; + return XHRImpl; + })(xhr_1.XHR); + exports.XHRImpl = XHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/key_events", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var di_1 = require("angular2/src/core/di"); + var modifierKeys = ['alt', 'control', 'meta', 'shift']; + var modifierKeyGetters = { + 'alt': function(event) { + return event.altKey; + }, + 'control': function(event) { + return event.ctrlKey; + }, + 'meta': function(event) { + return event.metaKey; + }, + 'shift': function(event) { + return event.shiftKey; + } + }; + var KeyEventsPlugin = (function(_super) { + __extends(KeyEventsPlugin, _super); + function KeyEventsPlugin() { + _super.call(this); + } + KeyEventsPlugin.prototype.supports = function(eventName) { + return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); + }; + KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var parsedEvent = KeyEventsPlugin.parseEventName(eventName); + var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); + }); + }; + KeyEventsPlugin.parseEventName = function(eventName) { + var parts = eventName.toLowerCase().split('.'); + var domEventName = parts.shift(); + if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { + return null; + } + var key = KeyEventsPlugin._normalizeKey(parts.pop()); + var fullKey = ''; + modifierKeys.forEach(function(modifierName) { + if (collection_1.ListWrapper.contains(parts, modifierName)) { + collection_1.ListWrapper.remove(parts, modifierName); + fullKey += modifierName + '.'; + } + }); + fullKey += key; + if (parts.length != 0 || key.length === 0) { + return null; + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); + collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); + return result; + }; + KeyEventsPlugin.getEventFullKey = function(event) { + var fullKey = ''; + var key = dom_adapter_1.DOM.getEventKey(event); + key = key.toLowerCase(); + if (lang_1.StringWrapper.equals(key, ' ')) { + key = 'space'; + } else if (lang_1.StringWrapper.equals(key, '.')) { + key = 'dot'; + } + modifierKeys.forEach(function(modifierName) { + if (modifierName != key) { + var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); + if (modifierGetter(event)) { + fullKey += modifierName + '.'; + } + } + }); + fullKey += key; + return fullKey; + }; + KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { + return function(event) { + if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { + zone.run(function() { + return handler(event); + }); + } + }; + }; + KeyEventsPlugin._normalizeKey = function(keyName) { + switch (keyName) { + case 'esc': + return 'escape'; + default: + return keyName; + } + }; + KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); + return KeyEventsPlugin; + })(event_manager_1.EventManagerPlugin); + exports.KeyEventsPlugin = KeyEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_common", ["angular2/src/core/render/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var collection_1 = require("angular2/src/facade/collection"); + var _eventNames = { + 'pan': true, + 'panstart': true, + 'panmove': true, + 'panend': true, + 'pancancel': true, + 'panleft': true, + 'panright': true, + 'panup': true, + 'pandown': true, + 'pinch': true, + 'pinchstart': true, + 'pinchmove': true, + 'pinchend': true, + 'pinchcancel': true, + 'pinchin': true, + 'pinchout': true, + 'press': true, + 'pressup': true, + 'rotate': true, + 'rotatestart': true, + 'rotatemove': true, + 'rotateend': true, + 'rotatecancel': true, + 'swipe': true, + 'swipeleft': true, + 'swiperight': true, + 'swipeup': true, + 'swipedown': true, + 'tap': true + }; + var HammerGesturesPluginCommon = (function(_super) { + __extends(HammerGesturesPluginCommon, _super); + function HammerGesturesPluginCommon() { + _super.call(this); + } + HammerGesturesPluginCommon.prototype.supports = function(eventName) { + eventName = eventName.toLowerCase(); + return collection_1.StringMapWrapper.contains(_eventNames, eventName); + }; + return HammerGesturesPluginCommon; + })(event_manager_1.EventManagerPlugin); + exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_bindings", ["angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + exports.EXCEPTION_PROVIDER = di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(dom_adapter_1.DOM, false); + }, + deps: [] + }); + exports.EXCEPTION_BINDING = exports.EXCEPTION_PROVIDER; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function wtfInit() {} + exports.wtfInit = wtfInit; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/bootstrap", ["angular2/src/core/application"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var application_1 = require("angular2/src/core/application"); + exports.bootstrap = application_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services/title", ["angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Title = (function() { + function Title() {} + Title.prototype.getTitle = function() { + return dom_adapter_1.DOM.getTitle(); + }; + Title.prototype.setTitle = function(newTitle) { + dom_adapter_1.DOM.setTitle(newTitle); + }; + return Title; + })(); + exports.Title = Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_1 = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var DebugElement = (function() { + function DebugElement() {} + Object.defineProperty(DebugElement.prototype, "componentInstance", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "elementRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "componentViewChildren", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + DebugElement.prototype.query = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var results = this.queryAll(predicate, scope); + return results.length > 0 ? results[0] : null; + }; + DebugElement.prototype.queryAll = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var elementsInScope = scope(this); + return elementsInScope.filter(predicate); + }; + return DebugElement; + })(); + exports.DebugElement = DebugElement; + var DebugElement_ = (function(_super) { + __extends(DebugElement_, _super); + function DebugElement_(_parentView, _boundElementIndex) { + _super.call(this); + this._parentView = _parentView; + this._boundElementIndex = _boundElementIndex; + this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex]; + } + Object.defineProperty(DebugElement_.prototype, "componentInstance", { + get: function() { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.getComponent(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "nativeElement", { + get: function() { + return this.elementRef.nativeElement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "elementRef", { + get: function() { + return this._parentView.elementRefs[this._boundElementIndex]; + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.getDirectiveInstance = function(directiveIndex) { + return this._elementInjector.getDirectiveAtIndex(directiveIndex); + }; + Object.defineProperty(DebugElement_.prototype, "children", { + get: function() { + return this._getChildElements(this._parentView, this._boundElementIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "componentViewChildren", { + get: function() { + var shadowView = this._parentView.getNestedView(this._boundElementIndex); + if (!lang_1.isPresent(shadowView) || shadowView.proto.type !== view_1.ViewType.COMPONENT) { + return []; + } + return this._getChildElements(shadowView, null); + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.triggerEventHandler = function(eventName, eventObj) { + this._parentView.triggerEventHandlers(eventName, eventObj, this._boundElementIndex); + }; + DebugElement_.prototype.hasDirective = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return false; + } + return this._elementInjector.hasDirective(type); + }; + DebugElement_.prototype.inject = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.get(type); + }; + DebugElement_.prototype.getLocal = function(name) { + return this._parentView.locals.get(name); + }; + DebugElement_.prototype._getChildElements = function(view, parentBoundElementIndex) { + var _this = this; + var els = []; + var parentElementBinder = null; + if (lang_1.isPresent(parentBoundElementIndex)) { + parentElementBinder = view.proto.elementBinders[parentBoundElementIndex - view.elementOffset]; + } + for (var i = 0; i < view.proto.elementBinders.length; ++i) { + var binder = view.proto.elementBinders[i]; + if (binder.parent == parentElementBinder) { + els.push(new DebugElement_(view, view.elementOffset + i)); + var views = view.viewContainers[view.elementOffset + i]; + if (lang_1.isPresent(views)) { + views.views.forEach(function(nextView) { + els = els.concat(_this._getChildElements(nextView, null)); + }); + } + } + } + return els; + }; + return DebugElement_; + })(DebugElement); + exports.DebugElement_ = DebugElement_; + function inspectElement(elementRef) { + return new DebugElement_(view_ref_1.internalView(elementRef.parentView), elementRef.boundElementIndex); + } + exports.inspectElement = inspectElement; + function asNativeElements(arr) { + return arr.map(function(debugEl) { + return debugEl.nativeElement; + }); + } + exports.asNativeElements = asNativeElements; + var Scope = (function() { + function Scope() {} + Scope.all = function(debugElement) { + var scope = []; + scope.push(debugElement); + debugElement.children.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + debugElement.componentViewChildren.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + return scope; + }; + Scope.light = function(debugElement) { + var scope = []; + debugElement.children.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + Scope.view = function(debugElement) { + var scope = []; + debugElement.componentViewChildren.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + return Scope; + })(); + exports.Scope = Scope; + var By = (function() { + function By() {} + By.all = function() { + return function(debugElement) { + return true; + }; + }; + By.css = function(selector) { + return function(debugElement) { + return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; + }; + }; + By.directive = function(type) { + return function(debugElement) { + return debugElement.hasDirective(type); + }; + }; + return By; + })(); + exports.By = By; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element_view_listener", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/linker/view_listener", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/api", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var api_1 = require("angular2/src/core/render/api"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var NG_ID_PROPERTY = 'ngid'; + var INSPECT_GLOBAL_NAME = 'ng.probe'; + var NG_ID_SEPARATOR = '#'; + var _allIdsByView = new collection_1.Map(); + var _allViewsById = new collection_1.Map(); + var _nextId = 0; + function _setElementId(element, indices) { + if (lang_1.isPresent(element)) { + dom_adapter_1.DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); + } + } + function _getElementId(element) { + var elId = dom_adapter_1.DOM.getData(element, NG_ID_PROPERTY); + if (lang_1.isPresent(elId)) { + return elId.split(NG_ID_SEPARATOR).map(function(partStr) { + return lang_1.NumberWrapper.parseInt(partStr, 10); + }); + } else { + return null; + } + } + function inspectNativeElement(element) { + var elId = _getElementId(element); + if (lang_1.isPresent(elId)) { + var view = _allViewsById.get(elId[0]); + if (lang_1.isPresent(view)) { + return new debug_element_1.DebugElement_(view, elId[1]); + } + } + return null; + } + exports.inspectNativeElement = inspectNativeElement; + var DebugElementViewListener = (function() { + function DebugElementViewListener(_renderer) { + this._renderer = _renderer; + dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); + } + DebugElementViewListener.prototype.onViewCreated = function(view) { + var viewId = _nextId++; + _allViewsById.set(viewId, view); + _allIdsByView.set(view, viewId); + for (var i = 0; i < view.elementRefs.length; i++) { + var el = view.elementRefs[i]; + _setElementId(this._renderer.getNativeElementSync(el), [viewId, i]); + } + }; + DebugElementViewListener.prototype.onViewDestroyed = function(view) { + var viewId = _allIdsByView.get(view); + _allIdsByView.delete(view); + _allViewsById.delete(viewId); + }; + DebugElementViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [api_1.Renderer])], DebugElementViewListener); + return DebugElementViewListener; + })(); + exports.DebugElementViewListener = DebugElementViewListener; + exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([DebugElementViewListener, lang_1.CONST_EXPR(new di_1.Provider(view_listener_1.AppViewListener, {useExisting: DebugElementViewListener}))]); + exports.ELEMENT_PROBE_BINDINGS = exports.ELEMENT_PROBE_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.enableDevMode = lang_1.enableDevMode; + global.define = __define; + return module.exports; +}); + +System.register("angular2/profile", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var profile_1 = require("angular2/src/core/profile/profile"); + exports.wtfCreateScope = profile_1.wtfCreateScope; + exports.wtfLeave = profile_1.wtfLeave; + exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; + exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/lifecycle_hooks", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/bootstrap", ["angular2/src/core/bootstrap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var bootstrap_1 = require("angular2/src/core/bootstrap"); + exports.bootstrap = bootstrap_1.bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/metadata", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var COMPONENT_SELECTOR = /^[\w|-]*$/; + var SKEWER_CASE = /-(\w)/g; + var directiveResolver = new angular2_1.DirectiveResolver(); + function getComponentInfo(type) { + var resolvedMetadata = directiveResolver.resolve(type); + var selector = resolvedMetadata.selector; + if (!selector.match(COMPONENT_SELECTOR)) { + throw new Error('Only selectors matching element names are supported, got: ' + selector); + } + var selector = selector.replace(SKEWER_CASE, function(all, letter) { + return letter.toUpperCase(); + }); + return { + type: type, + selector: selector, + inputs: parseFields(resolvedMetadata.inputs), + outputs: parseFields(resolvedMetadata.outputs) + }; + } + exports.getComponentInfo = getComponentInfo; + function parseFields(names) { + var attrProps = []; + if (names) { + for (var i = 0; i < names.length; i++) { + var parts = names[i].split(':'); + var prop = parts[0].trim(); + var attr = (parts[1] || parts[0]).trim(); + var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1); + attrProps.push({ + prop: prop, + attr: attr, + bracketAttr: "[" + attr + "]", + parenAttr: "(" + attr + ")", + bracketParenAttr: "[(" + attr + ")]", + onAttr: "on" + capitalAttr, + bindAttr: "bind" + capitalAttr, + bindonAttr: "bindon" + capitalAttr + }); + } + } + return attrProps; + } + exports.parseFields = parseFields; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function stringify(obj) { + if (typeof obj == 'function') + return obj.name || obj.toString(); + return '' + obj; + } + exports.stringify = stringify; + function onError(e) { + console.log(e, e.stack); + throw e; + } + exports.onError = onError; + function controllerKey(name) { + return '$' + name + 'Controller'; + } + exports.controllerKey = controllerKey; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager'; + exports.NG2_COMPILER = 'ng2.Compiler'; + exports.NG2_INJECTOR = 'ng2.Injector'; + exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap'; + exports.NG2_ZONE = 'ng2.NgZone'; + exports.NG1_CONTROLLER = '$controller'; + exports.NG1_SCOPE = '$scope'; + exports.NG1_ROOT_SCOPE = '$rootScope'; + exports.NG1_COMPILE = '$compile'; + exports.NG1_HTTP_BACKEND = '$httpBackend'; + exports.NG1_INJECTOR = '$injector'; + exports.NG1_PARSE = '$parse'; + exports.NG1_TEMPLATE_CACHE = '$templateCache'; + exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/angular2", "angular2/src/upgrade/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var DowngradeNg2ComponentAdapter = (function() { + function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) { + this.id = id; + this.info = info; + this.element = element; + this.attrs = attrs; + this.scope = scope; + this.parentInjector = parentInjector; + this.parse = parse; + this.viewManager = viewManager; + this.protoView = protoView; + this.component = null; + this.inputChangeCount = 0; + this.inputChanges = null; + this.hostViewRef = null; + this.changeDetector = null; + this.contentInserctionPoint = null; + this.element[0].id = id; + this.componentScope = scope.$new(); + this.childNodes = element.contents(); + } + DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() { + var childInjector = this.parentInjector.resolveAndCreateChild([angular2_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]); + this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector); + var renderer = this.hostViewRef.render; + var hostElement = this.viewManager.getHostElement(this.hostViewRef); + this.changeDetector = this.hostViewRef.changeDetectorRef; + this.component = this.viewManager.getComponent(hostElement); + this.contentInserctionPoint = renderer.rootContentInsertionPoints[0]; + }; + DowngradeNg2ComponentAdapter.prototype.setupInputs = function() { + var _this = this; + var attrs = this.attrs; + var inputs = this.info.inputs; + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + var expr = null; + if (attrs.hasOwnProperty(input.attr)) { + var observeFn = (function(prop) { + var prevValue = INITIAL_VALUE; + return function(value) { + if (_this.inputChanges !== null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue); + prevValue = value; + } + _this.component[prop] = value; + }; + })(input.prop); + attrs.$observe(input.attr, observeFn); + } else if (attrs.hasOwnProperty(input.bindAttr)) { + expr = attrs[input.bindAttr]; + } else if (attrs.hasOwnProperty(input.bracketAttr)) { + expr = attrs[input.bracketAttr]; + } else if (attrs.hasOwnProperty(input.bindonAttr)) { + expr = attrs[input.bindonAttr]; + } else if (attrs.hasOwnProperty(input.bracketParenAttr)) { + expr = attrs[input.bracketParenAttr]; + } + if (expr != null) { + var watchFn = (function(prop) { + return function(value, prevValue) { + if (_this.inputChanges != null) { + _this.inputChangeCount++; + _this.inputChanges[prop] = new Ng1Change(prevValue, value); + } + _this.component[prop] = value; + }; + })(input.prop); + this.componentScope.$watch(expr, watchFn); + } + } + var prototype = this.info.type.prototype; + if (prototype && prototype.onChanges) { + this.inputChanges = {}; + this.componentScope.$watch(function() { + return _this.inputChangeCount; + }, function() { + var inputChanges = _this.inputChanges; + _this.inputChanges = {}; + _this.component.onChanges(inputChanges); + }); + } + this.componentScope.$watch(function() { + return _this.changeDetector && _this.changeDetector.detectChanges(); + }); + }; + DowngradeNg2ComponentAdapter.prototype.projectContent = function() { + var childNodes = this.childNodes; + if (this.contentInserctionPoint) { + var parent = this.contentInserctionPoint.parentNode; + for (var i = 0, + ii = childNodes.length; i < ii; i++) { + parent.insertBefore(childNodes[i], this.contentInserctionPoint); + } + } + }; + DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() { + var _this = this; + var attrs = this.attrs; + var outputs = this.info.outputs; + for (var j = 0; j < outputs.length; j++) { + var output = outputs[j]; + var expr = null; + var assignExpr = false; + var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null; + var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null; + if (attrs.hasOwnProperty(output.onAttr)) { + expr = attrs[output.onAttr]; + } else if (attrs.hasOwnProperty(output.parenAttr)) { + expr = attrs[output.parenAttr]; + } else if (attrs.hasOwnProperty(bindonAttr)) { + expr = attrs[bindonAttr]; + assignExpr = true; + } else if (attrs.hasOwnProperty(bracketParenAttr)) { + expr = attrs[bracketParenAttr]; + assignExpr = true; + } + if (expr != null && assignExpr != null) { + var getter = this.parse(expr); + var setter = getter.assign; + if (assignExpr && !setter) { + throw new Error("Expression '" + expr + "' is not assignable!"); + } + var emitter = this.component[output.prop]; + if (emitter) { + emitter.subscribe({next: assignExpr ? (function(setter) { + return function(value) { + return setter(_this.scope, value); + }; + })(setter) : (function(getter) { + return function(value) { + return getter(_this.scope, {$event: value}); + }; + })(getter)}); + } else { + throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!"); + } + } + } + }; + DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() { + var _this = this; + this.element.bind('$remove', function() { + return _this.viewManager.destroyRootHostView(_this.hostViewRef); + }); + }; + return DowngradeNg2ComponentAdapter; + })(); + exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter; + var Ng1Change = (function() { + function Ng1Change(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + Ng1Change.prototype.isFirstChange = function() { + return this.previousValue === this.currentValue; + }; + return Ng1Change; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function noNg() { + throw new Error('AngularJS v1.x is not loaded!'); + } + var angular = { + bootstrap: noNg, + module: noNg, + element: noNg, + version: noNg + }; + try { + if (window.hasOwnProperty('angular')) { + angular = window.angular; + } + } catch (e) {} + exports.bootstrap = angular.bootstrap; + exports.module = angular.module; + exports.element = angular.element; + exports.version = angular.version; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ConnectionBackend = (function() { + function ConnectionBackend() {} + return ConnectionBackend; + })(); + exports.ConnectionBackend = ConnectionBackend; + var Connection = (function() { + function Connection() {} + return Connection; + })(); + exports.Connection = Connection; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/headers", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Headers = (function() { + function Headers(headers) { + var _this = this; + if (headers instanceof Headers) { + this._headersMap = headers._headersMap; + return ; + } + this._headersMap = new collection_1.Map(); + if (lang_1.isBlank(headers)) { + return ; + } + collection_1.StringMapWrapper.forEach(headers, function(v, k) { + _this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]); + }); + } + Headers.prototype.append = function(name, value) { + var mapName = this._headersMap.get(name); + var list = collection_1.isListLikeIterable(mapName) ? mapName : []; + list.push(value); + this._headersMap.set(name, list); + }; + Headers.prototype.delete = function(name) { + this._headersMap.delete(name); + }; + Headers.prototype.forEach = function(fn) { + this._headersMap.forEach(fn); + }; + Headers.prototype.get = function(header) { + return collection_1.ListWrapper.first(this._headersMap.get(header)); + }; + Headers.prototype.has = function(header) { + return this._headersMap.has(header); + }; + Headers.prototype.keys = function() { + return collection_1.MapWrapper.keys(this._headersMap); + }; + Headers.prototype.set = function(header, value) { + var list = []; + if (collection_1.isListLikeIterable(value)) { + var pushValue = value.join(','); + list.push(pushValue); + } else { + list.push(value); + } + this._headersMap.set(header, list); + }; + Headers.prototype.values = function() { + return collection_1.MapWrapper.values(this._headersMap); + }; + Headers.prototype.getAll = function(header) { + var headers = this._headersMap.get(header); + return collection_1.isListLikeIterable(headers) ? headers : []; + }; + Headers.prototype.entries = function() { + throw new exceptions_1.BaseException('"entries" method is not implemented on Headers class'); + }; + return Headers; + })(); + exports.Headers = Headers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/enums", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RequestMethods) { + RequestMethods[RequestMethods["Get"] = 0] = "Get"; + RequestMethods[RequestMethods["Post"] = 1] = "Post"; + RequestMethods[RequestMethods["Put"] = 2] = "Put"; + RequestMethods[RequestMethods["Delete"] = 3] = "Delete"; + RequestMethods[RequestMethods["Options"] = 4] = "Options"; + RequestMethods[RequestMethods["Head"] = 5] = "Head"; + RequestMethods[RequestMethods["Patch"] = 6] = "Patch"; + })(exports.RequestMethods || (exports.RequestMethods = {})); + var RequestMethods = exports.RequestMethods; + (function(ReadyStates) { + ReadyStates[ReadyStates["Unsent"] = 0] = "Unsent"; + ReadyStates[ReadyStates["Open"] = 1] = "Open"; + ReadyStates[ReadyStates["HeadersReceived"] = 2] = "HeadersReceived"; + ReadyStates[ReadyStates["Loading"] = 3] = "Loading"; + ReadyStates[ReadyStates["Done"] = 4] = "Done"; + ReadyStates[ReadyStates["Cancelled"] = 5] = "Cancelled"; + })(exports.ReadyStates || (exports.ReadyStates = {})); + var ReadyStates = exports.ReadyStates; + (function(ResponseTypes) { + ResponseTypes[ResponseTypes["Basic"] = 0] = "Basic"; + ResponseTypes[ResponseTypes["Cors"] = 1] = "Cors"; + ResponseTypes[ResponseTypes["Default"] = 2] = "Default"; + ResponseTypes[ResponseTypes["Error"] = 3] = "Error"; + ResponseTypes[ResponseTypes["Opaque"] = 4] = "Opaque"; + })(exports.ResponseTypes || (exports.ResponseTypes = {})); + var ResponseTypes = exports.ResponseTypes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/url_search_params", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + function paramParser(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + var map = new collection_1.Map(); + if (rawParams.length > 0) { + var params = rawParams.split('&'); + params.forEach(function(param) { + var split = param.split('='); + var key = split[0]; + var val = split[1]; + var list = lang_1.isPresent(map.get(key)) ? map.get(key) : []; + list.push(val); + map.set(key, list); + }); + } + return map; + } + var URLSearchParams = (function() { + function URLSearchParams(rawParams) { + if (rawParams === void 0) { + rawParams = ''; + } + this.rawParams = rawParams; + this.paramsMap = paramParser(rawParams); + } + URLSearchParams.prototype.clone = function() { + var clone = new URLSearchParams(); + clone.appendAll(this); + return clone; + }; + URLSearchParams.prototype.has = function(param) { + return this.paramsMap.has(param); + }; + URLSearchParams.prototype.get = function(param) { + var storedParam = this.paramsMap.get(param); + if (collection_1.isListLikeIterable(storedParam)) { + return collection_1.ListWrapper.first(storedParam); + } else { + return null; + } + }; + URLSearchParams.prototype.getAll = function(param) { + var mapParam = this.paramsMap.get(param); + return lang_1.isPresent(mapParam) ? mapParam : []; + }; + URLSearchParams.prototype.set = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.setAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + list.push(value[0]); + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.append = function(param, val) { + var mapParam = this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + list.push(val); + this.paramsMap.set(param, list); + }; + URLSearchParams.prototype.appendAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.replaceAll = function(searchParams) { + var _this = this; + searchParams.paramsMap.forEach(function(value, param) { + var mapParam = _this.paramsMap.get(param); + var list = lang_1.isPresent(mapParam) ? mapParam : []; + collection_1.ListWrapper.clear(list); + for (var i = 0; i < value.length; ++i) { + list.push(value[i]); + } + _this.paramsMap.set(param, list); + }); + }; + URLSearchParams.prototype.toString = function() { + var paramsList = []; + this.paramsMap.forEach(function(values, k) { + values.forEach(function(v) { + return paramsList.push(k + '=' + v); + }); + }); + return paramsList.join('&'); + }; + URLSearchParams.prototype.delete = function(param) { + this.paramsMap.delete(param); + }; + return URLSearchParams; + })(); + exports.URLSearchParams = URLSearchParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_response", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var Response = (function() { + function Response(responseOptions) { + this._body = responseOptions.body; + this.status = responseOptions.status; + this.statusText = responseOptions.statusText; + this.headers = responseOptions.headers; + this.type = responseOptions.type; + this.url = responseOptions.url; + } + Response.prototype.blob = function() { + throw new exceptions_1.BaseException('"blob()" method not implemented on Response superclass'); + }; + Response.prototype.json = function() { + var jsonResponse; + if (http_utils_1.isJsObject(this._body)) { + jsonResponse = this._body; + } else if (lang_1.isString(this._body)) { + jsonResponse = lang_1.Json.parse(this._body); + } + return jsonResponse; + }; + Response.prototype.text = function() { + return this._body.toString(); + }; + Response.prototype.arrayBuffer = function() { + throw new exceptions_1.BaseException('"arrayBuffer()" method not implemented on Response superclass'); + }; + return Response; + })(); + exports.Response = Response; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_response_options", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var ResponseOptions = (function() { + function ResponseOptions(_a) { + var _b = _a === void 0 ? {} : _a, + body = _b.body, + status = _b.status, + headers = _b.headers, + statusText = _b.statusText, + type = _b.type, + url = _b.url; + this.body = lang_1.isPresent(body) ? body : null; + this.status = lang_1.isPresent(status) ? status : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.statusText = lang_1.isPresent(statusText) ? statusText : null; + this.type = lang_1.isPresent(type) ? type : null; + this.url = lang_1.isPresent(url) ? url : null; + } + ResponseOptions.prototype.merge = function(options) { + return new ResponseOptions({ + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + status: lang_1.isPresent(options) && lang_1.isPresent(options.status) ? options.status : this.status, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + statusText: lang_1.isPresent(options) && lang_1.isPresent(options.statusText) ? options.statusText : this.statusText, + type: lang_1.isPresent(options) && lang_1.isPresent(options.type) ? options.type : this.type, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url + }); + }; + return ResponseOptions; + })(); + exports.ResponseOptions = ResponseOptions; + var BaseResponseOptions = (function(_super) { + __extends(BaseResponseOptions, _super); + function BaseResponseOptions() { + _super.call(this, { + status: 200, + statusText: 'Ok', + type: enums_1.ResponseTypes.Default, + headers: new headers_1.Headers() + }); + } + BaseResponseOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseResponseOptions); + return BaseResponseOptions; + })(ResponseOptions); + exports.BaseResponseOptions = BaseResponseOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_xhr", ["angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var BrowserXhr = (function() { + function BrowserXhr() {} + BrowserXhr.prototype.build = function() { + return (new XMLHttpRequest()); + }; + BrowserXhr = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserXhr); + return BrowserXhr; + })(); + exports.BrowserXhr = BrowserXhr; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/browser_jsonp", ["angular2/angular2", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var _nextRequestId = 0; + exports.JSONP_HOME = '__ng_jsonp__'; + var _jsonpConnections = null; + function _getJsonpConnections() { + if (_jsonpConnections === null) { + _jsonpConnections = lang_1.global[exports.JSONP_HOME] = {}; + } + return _jsonpConnections; + } + var BrowserJsonp = (function() { + function BrowserJsonp() {} + BrowserJsonp.prototype.build = function(url) { + var node = document.createElement('script'); + node.src = url; + return node; + }; + BrowserJsonp.prototype.nextRequestID = function() { + return "__req" + _nextRequestId++; + }; + BrowserJsonp.prototype.requestCallback = function(id) { + return exports.JSONP_HOME + "." + id + ".finished"; + }; + BrowserJsonp.prototype.exposeConnection = function(id, connection) { + var connections = _getJsonpConnections(); + connections[id] = connection; + }; + BrowserJsonp.prototype.removeConnection = function(id) { + var connections = _getJsonpConnections(); + connections[id] = null; + }; + BrowserJsonp.prototype.send = function(node) { + document.body.appendChild((node)); + }; + BrowserJsonp.prototype.cleanup = function(node) { + if (node.parentNode) { + node.parentNode.removeChild((node)); + } + }; + BrowserJsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BrowserJsonp); + return BrowserJsonp; + })(); + exports.BrowserJsonp = BrowserJsonp; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/mock_backend", ["angular2/angular2", "angular2/src/http/static_request", "angular2/src/http/enums", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var static_request_1 = require("angular2/src/http/static_request"); + var enums_1 = require("angular2/src/http/enums"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Rx = require("@reactivex/rxjs/dist/cjs/Rx"); + var Subject = Rx.Subject, + ReplaySubject = Rx.ReplaySubject; + var MockConnection = (function() { + function MockConnection(req) { + this.response = new ReplaySubject(1).take(1); + this.readyState = enums_1.ReadyStates.Open; + this.request = req; + } + MockConnection.prototype.mockRespond = function(res) { + if (this.readyState === enums_1.ReadyStates.Done || this.readyState === enums_1.ReadyStates.Cancelled) { + throw new exceptions_1.BaseException('Connection has already been resolved'); + } + this.readyState = enums_1.ReadyStates.Done; + this.response.next(res); + this.response.complete(); + }; + MockConnection.prototype.mockDownload = function(res) {}; + MockConnection.prototype.mockError = function(err) { + this.readyState = enums_1.ReadyStates.Done; + this.response.error(err); + }; + return MockConnection; + })(); + exports.MockConnection = MockConnection; + var MockBackend = (function() { + function MockBackend() { + var _this = this; + this.connectionsArray = []; + this.connections = new Subject(); + this.connections.subscribe(function(connection) { + return _this.connectionsArray.push(connection); + }); + this.pendingConnections = new Subject(); + } + MockBackend.prototype.verifyNoPendingRequests = function() { + var pending = 0; + this.pendingConnections.subscribe(function(c) { + return pending++; + }); + if (pending > 0) + throw new exceptions_1.BaseException(pending + " pending connections to be resolved"); + }; + MockBackend.prototype.resolveAllConnections = function() { + this.connections.subscribe(function(c) { + return c.readyState = 4; + }); + }; + MockBackend.prototype.createConnection = function(req) { + if (!lang_1.isPresent(req) || !(req instanceof static_request_1.Request)) { + throw new exceptions_1.BaseException("createConnection requires an instance of Request, got " + req); + } + var connection = new MockConnection(req); + this.connections.next(connection); + return connection; + }; + MockBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], MockBackend); + return MockBackend; + })(); + exports.MockBackend = MockBackend; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_1 = require("angular2/src/core/metadata/view"); + var selector_1 = require("angular2/src/compiler/selector"); + var util_1 = require("angular2/src/compiler/util"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; + var CompileTypeMetadata = (function() { + function CompileTypeMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + runtime = _b.runtime, + name = _b.name, + moduleUrl = _b.moduleUrl, + isHost = _b.isHost; + this.runtime = runtime; + this.name = name; + this.moduleUrl = moduleUrl; + this.isHost = lang_1.normalizeBool(isHost); + } + CompileTypeMetadata.fromJson = function(data) { + return new CompileTypeMetadata({ + name: data['name'], + moduleUrl: data['moduleUrl'], + isHost: data['isHost'] + }); + }; + CompileTypeMetadata.prototype.toJson = function() { + return { + 'name': this.name, + 'moduleUrl': this.moduleUrl, + 'isHost': this.isHost + }; + }; + return CompileTypeMetadata; + })(); + exports.CompileTypeMetadata = CompileTypeMetadata; + var CompileTemplateMetadata = (function() { + function CompileTemplateMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + encapsulation = _b.encapsulation, + template = _b.template, + templateUrl = _b.templateUrl, + styles = _b.styles, + styleUrls = _b.styleUrls, + ngContentSelectors = _b.ngContentSelectors; + this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; + this.template = template; + this.templateUrl = templateUrl; + this.styles = lang_1.isPresent(styles) ? styles : []; + this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; + this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; + } + CompileTemplateMetadata.fromJson = function(data) { + return new CompileTemplateMetadata({ + encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], + template: data['template'], + templateUrl: data['templateUrl'], + styles: data['styles'], + styleUrls: data['styleUrls'], + ngContentSelectors: data['ngContentSelectors'] + }); + }; + CompileTemplateMetadata.prototype.toJson = function() { + return { + 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, + 'template': this.template, + 'templateUrl': this.templateUrl, + 'styles': this.styles, + 'styleUrls': this.styleUrls, + 'ngContentSelectors': this.ngContentSelectors + }; + }; + return CompileTemplateMetadata; + })(); + exports.CompileTemplateMetadata = CompileTemplateMetadata; + var CompileDirectiveMetadata = (function() { + function CompileDirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + hostListeners = _b.hostListeners, + hostProperties = _b.hostProperties, + hostAttributes = _b.hostAttributes, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + this.type = type; + this.isComponent = isComponent; + this.dynamicLoadable = dynamicLoadable; + this.selector = selector; + this.exportAs = exportAs; + this.changeDetection = changeDetection; + this.inputs = inputs; + this.outputs = outputs; + this.hostListeners = hostListeners; + this.hostProperties = hostProperties; + this.hostAttributes = hostAttributes; + this.lifecycleHooks = lifecycleHooks; + this.template = template; + } + CompileDirectiveMetadata.create = function(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + host = _b.host, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + var hostListeners = {}; + var hostProperties = {}; + var hostAttributes = {}; + if (lang_1.isPresent(host)) { + collection_1.StringMapWrapper.forEach(host, function(value, key) { + var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); + if (lang_1.isBlank(matches)) { + hostAttributes[key] = value; + } else if (lang_1.isPresent(matches[1])) { + hostProperties[matches[1]] = value; + } else if (lang_1.isPresent(matches[2])) { + hostListeners[matches[2]] = value; + } + }); + } + var inputsMap = {}; + if (lang_1.isPresent(inputs)) { + inputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + inputsMap[parts[0]] = parts[1]; + }); + } + var outputsMap = {}; + if (lang_1.isPresent(outputs)) { + outputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + outputsMap[parts[0]] = parts[1]; + }); + } + return new CompileDirectiveMetadata({ + type: type, + isComponent: lang_1.normalizeBool(isComponent), + dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), + selector: selector, + exportAs: exportAs, + changeDetection: changeDetection, + inputs: inputsMap, + outputs: outputsMap, + hostListeners: hostListeners, + hostProperties: hostProperties, + hostAttributes: hostAttributes, + lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], + template: template + }); + }; + CompileDirectiveMetadata.fromJson = function(data) { + return new CompileDirectiveMetadata({ + isComponent: data['isComponent'], + dynamicLoadable: data['dynamicLoadable'], + selector: data['selector'], + exportAs: data['exportAs'], + type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], + changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], + inputs: data['inputs'], + outputs: data['outputs'], + hostListeners: data['hostListeners'], + hostProperties: data['hostProperties'], + hostAttributes: data['hostAttributes'], + lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { + return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; + }), + template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'] + }); + }; + CompileDirectiveMetadata.prototype.toJson = function() { + return { + 'isComponent': this.isComponent, + 'dynamicLoadable': this.dynamicLoadable, + 'selector': this.selector, + 'exportAs': this.exportAs, + 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, + 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, + 'inputs': this.inputs, + 'outputs': this.outputs, + 'hostListeners': this.hostListeners, + 'hostProperties': this.hostProperties, + 'hostAttributes': this.hostAttributes, + 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { + return lang_1.serializeEnum(hook); + }), + 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template + }; + }; + return CompileDirectiveMetadata; + })(); + exports.CompileDirectiveMetadata = CompileDirectiveMetadata; + function createHostComponentMeta(componentType, componentSelector) { + var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); + return CompileDirectiveMetadata.create({ + type: new CompileTypeMetadata({ + runtime: Object, + name: "Host" + componentType.name, + moduleUrl: componentType.moduleUrl, + isHost: true + }), + template: new CompileTemplateMetadata({ + template: template, + templateUrl: '', + styles: [], + styleUrls: [], + ngContentSelectors: [] + }), + changeDetection: change_detection_1.ChangeDetectionStrategy.Default, + inputs: [], + outputs: [], + host: {}, + lifecycleHooks: [], + isComponent: true, + dynamicLoadable: false, + selector: '*' + }); + } + exports.createHostComponentMeta = createHostComponentMeta; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { + var pvVisitors = []; + var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); + template_ast_1.templateVisitAll(visitor, parsedTemplate); + return createChangeDefinitions(pvVisitors, componentType, genConfig); + } + exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; + var ProtoViewVisitor = (function() { + function ProtoViewVisitor(parent, allVisitors, strategy) { + this.parent = parent; + this.allVisitors = allVisitors; + this.strategy = strategy; + this.boundTextCount = 0; + this.boundElementCount = 0; + this.variableNames = []; + this.bindingRecords = []; + this.eventRecords = []; + this.directiveRecords = []; + this.viewIndex = allVisitors.length; + allVisitors.push(this); + } + ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + this.boundElementCount++; + template_ast_1.templateVisitAll(this, ast.outputs); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); + template_ast_1.templateVisitAll(childVisitor, ast.vars); + template_ast_1.templateVisitAll(childVisitor, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitElement = function(ast, context) { + if (ast.isBound()) { + this.boundElementCount++; + } + template_ast_1.templateVisitAll(this, ast.inputs, null); + template_ast_1.templateVisitAll(this, ast.outputs); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + template_ast_1.templateVisitAll(this, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitVariable = function(ast, context) { + this.variableNames.push(ast.name); + return null; + }; + ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { + var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); + this.eventRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { + var boundElementIndex = this.boundElementCount - 1; + var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; + var bindingRecord; + if (ast.type === template_ast_1.PropertyBindingType.Property) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Class) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Style) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); + } + this.bindingRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { + var boundTextIndex = this.boundTextCount++; + this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, boundTextIndex)); + return null; + }; + ProtoViewVisitor.prototype.visitText = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { + var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); + var directiveMetadata = ast.directive; + var directiveRecord = new change_detection_1.DirectiveRecord({ + directiveIndex: directiveIndex, + callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, + callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, + callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, + callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, + callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, + callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, + callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, + changeDetection: directiveMetadata.changeDetection + }); + this.directiveRecords.push(directiveRecord); + template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); + var bindingRecords = this.bindingRecords; + if (directiveRecord.callOnChanges) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); + } + if (directiveRecord.callOnInit) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); + } + if (directiveRecord.callDoCheck) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); + } + template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); + template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + return null; + }; + ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { + var setter = reflection_1.reflector.setter(ast.directiveName); + this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); + return null; + }; + return ProtoViewVisitor; + })(); + function createChangeDefinitions(pvVisitors, componentType, genConfig) { + var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); + return pvVisitors.map(function(pvVisitor) { + var id = componentType.name + "_" + pvVisitor.viewIndex; + return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); + }); + } + function _collectNestedProtoViewsVariableNames(pvVisitors) { + var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); + pvVisitors.forEach(function(pv) { + var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; + nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); + }); + return nestedPvVariableNames; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/core/render/view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var view_1 = require("angular2/src/core/metadata/view"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var shadow_css_1 = require("angular2/src/compiler/shadow_css"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var StyleCompiler = (function() { + function StyleCompiler(_xhr, _urlResolver) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._styleCache = new Map(); + this._shadowCss = new shadow_css_1.ShadowCss(); + } + StyleCompiler.prototype.compileComponentRuntime = function(template) { + var styles = template.styles; + var styleAbsUrls = template.styleUrls; + return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); + }; + StyleCompiler.prototype.compileComponentCodeGen = function(template) { + var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; + return this._styleCodeGen(template.styles, template.styleUrls, shim); + }; + StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); + return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; + }; + StyleCompiler.prototype.clearCache = function() { + this._styleCache.clear(); + }; + StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { + var _this = this; + var promises = absUrls.map(function(absUrl) { + var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); + var result = _this._styleCache.get(cacheKey); + if (lang_1.isBlank(result)) { + result = _this._xhr.get(absUrl).then(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); + return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); + }); + _this._styleCache.set(cacheKey, result); + } + return result; + }); + return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { + var result = plainStyles.map(function(plainStyle) { + return _this._shimIfNeeded(plainStyle, encapsulate); + }); + nestedStyles.forEach(function(styles) { + return result.push(styles); + }); + return result; + }); + }; + StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { + var _this = this; + var arrayPrefix = lang_1.IS_DART ? "const" : ''; + var styleExpressions = plainStyles.map(function(plainStyle) { + return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); + }); + for (var i = 0; i < absUrls.length; i++) { + var moduleUrl = this._createModuleUrl(absUrls[i], shim); + styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); + } + var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; + return new source_module_1.SourceExpression([], expressionSource); + }; + StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { + var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; + return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); + }; + StyleCompiler.prototype._shimIfNeeded = function(style, shim) { + return shim ? this._shadowCss.shimCssText(style, view_factory_1.CONTENT_ATTR, view_factory_1.HOST_ATTR) : style; + }; + StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { + return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + }; + StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); + return StyleCompiler; + })(); + exports.StyleCompiler = StyleCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/html_ast", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var HtmlParser = (function() { + function HtmlParser() {} + HtmlParser.prototype.parse = function(template, sourceInfo) { + var root = dom_adapter_1.DOM.createTemplate(template); + return parseChildNodes(root, sourceInfo); + }; + HtmlParser.prototype.unparse = function(nodes) { + var visitor = new UnparseVisitor(); + var parts = []; + html_ast_1.htmlVisitAll(visitor, nodes, parts); + return parts.join(''); + }; + HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); + return HtmlParser; + })(); + exports.HtmlParser = HtmlParser; + function parseText(text, indexInParent, parentSourceInfo) { + var value = dom_adapter_1.DOM.getText(text); + return new html_ast_1.HtmlTextAst(value, parentSourceInfo + " > #text(" + value + "):nth-child(" + indexInParent + ")"); + } + function parseAttr(element, parentSourceInfo, attrName, attrValue) { + return new html_ast_1.HtmlAttrAst(attrName, attrValue, parentSourceInfo + "[" + attrName + "=" + attrValue + "]"); + } + function parseElement(element, indexInParent, parentSourceInfo) { + var nodeName = dom_adapter_1.DOM.nodeName(element).toLowerCase(); + var sourceInfo = parentSourceInfo + " > " + nodeName + ":nth-child(" + indexInParent + ")"; + var attrs = parseAttrs(element, sourceInfo); + var childNodes = parseChildNodes(element, sourceInfo); + return new html_ast_1.HtmlElementAst(nodeName, attrs, childNodes, sourceInfo); + } + function parseAttrs(element, elementSourceInfo) { + var attrMap = dom_adapter_1.DOM.attributeMap(element); + var attrList = []; + attrMap.forEach(function(value, name) { + return attrList.push([name, value]); + }); + attrList.sort(function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + return attrList.map(function(entry) { + return parseAttr(element, elementSourceInfo, entry[0], entry[1]); + }); + } + function parseChildNodes(element, parentSourceInfo) { + var root = dom_adapter_1.DOM.templateAwareRoot(element); + var childNodes = dom_adapter_1.DOM.childNodesAsList(root); + var result = []; + var index = 0; + childNodes.forEach(function(childNode) { + var childResult = null; + if (dom_adapter_1.DOM.isTextNode(childNode)) { + var text = childNode; + childResult = parseText(text, index, parentSourceInfo); + } else if (dom_adapter_1.DOM.isElementNode(childNode)) { + var el = childNode; + childResult = parseElement(el, index, parentSourceInfo); + } + if (lang_1.isPresent(childResult)) { + result.push(childResult); + } + index++; + }); + return result; + } + var UnparseVisitor = (function() { + function UnparseVisitor() {} + UnparseVisitor.prototype.visitElement = function(ast, parts) { + parts.push("<" + ast.name); + var attrs = []; + html_ast_1.htmlVisitAll(this, ast.attrs, attrs); + if (ast.attrs.length > 0) { + parts.push(' '); + parts.push(attrs.join(' ')); + } + parts.push(">"); + html_ast_1.htmlVisitAll(this, ast.children, parts); + parts.push(""); + return null; + }; + UnparseVisitor.prototype.visitAttr = function(ast, parts) { + parts.push(ast.name + "=" + util_1.escapeDoubleQuoteString(ast.value)); + return null; + }; + UnparseVisitor.prototype.visitText = function(ast, parts) { + parts.push(ast.value); + return null; + }; + return UnparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var GenericBrowserDomAdapter = (function(_super) { + __extends(GenericBrowserDomAdapter, _super); + function GenericBrowserDomAdapter() { + var _this = this; + _super.call(this); + this._animationPrefix = null; + this._transitionEnd = null; + try { + var element = this.createElement('div', this.defaultDoc()); + if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { + this._animationPrefix = ''; + } else { + var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; + for (var i = 0; i < domPrefixes.length; i++) { + if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { + this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; + break; + } + } + } + var transEndEventNames = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { + if (lang_1.isPresent(_this.getStyle(element, key))) { + _this._transitionEnd = value; + } + }); + } catch (e) { + this._animationPrefix = null; + this._transitionEnd = null; + } + } + GenericBrowserDomAdapter.prototype.getXHR = function() { + return xhr_impl_1.XHRImpl; + }; + GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { + return el.getDistributedNodes(); + }; + GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + el.href = href == null ? baseUrl : baseUrl + '/../' + href; + }; + GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { + return true; + }; + GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { + return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); + }; + GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { + return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; + }; + GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { + return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; + }; + GenericBrowserDomAdapter.prototype.supportsAnimation = function() { + return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); + }; + return GenericBrowserDomAdapter; + })(dom_adapter_1.DomAdapter); + exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/browser_testability", ["angular2/src/core/testability/testability", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var testability_1 = require("angular2/src/core/testability/testability"); + var lang_1 = require("angular2/src/facade/lang"); + var PublicTestability = (function() { + function PublicTestability(testability) { + this._testability = testability; + } + PublicTestability.prototype.isStable = function() { + return this._testability.isStable(); + }; + PublicTestability.prototype.whenStable = function(callback) { + this._testability.whenStable(callback); + }; + PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { + return this.findProviders(using, provider, exactMatch); + }; + PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { + return this._testability.findBindings(using, provider, exactMatch); + }; + return PublicTestability; + })(); + var BrowserGetTestability = (function() { + function BrowserGetTestability() {} + BrowserGetTestability.init = function() { + testability_1.setTestabilityGetter(new BrowserGetTestability()); + }; + BrowserGetTestability.prototype.addToWindow = function(registry) { + lang_1.global.getAngularTestability = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + var testability = registry.findTestabilityInTree(elem, findInAncestors); + if (testability == null) { + throw new Error('Could not find testability for element.'); + } + return new PublicTestability(testability); + }; + lang_1.global.getAllAngularTestabilities = function() { + var testabilities = registry.getAllTestabilities(); + return testabilities.map(function(testability) { + return new PublicTestability(testability); + }); + }; + }; + return BrowserGetTestability; + })(); + exports.BrowserGetTestability = BrowserGetTestability; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_gestures", ["angular2/src/core/render/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var hammer_common_1 = require("angular2/src/core/render/dom/events/hammer_common"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var di_1 = require("angular2/src/core/di"); + var HammerGesturesPlugin = (function(_super) { + __extends(HammerGesturesPlugin, _super); + function HammerGesturesPlugin() { + _super.apply(this, arguments); + } + HammerGesturesPlugin.prototype.supports = function(eventName) { + if (!_super.prototype.supports.call(this, eventName)) + return false; + if (!lang_1.isPresent(window['Hammer'])) { + throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); + } + return true; + }; + HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + eventName = eventName.toLowerCase(); + zone.runOutsideAngular(function() { + var mc = new Hammer(element); + mc.get('pinch').set({enable: true}); + mc.get('rotate').set({enable: true}); + mc.on(eventName, function(eventObj) { + zone.run(function() { + handler(eventObj); + }); + }); + }); + }; + HammerGesturesPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HammerGesturesPlugin); + return HammerGesturesPlugin; + })(hammer_common_1.HammerGesturesPluginCommon); + exports.HammerGesturesPlugin = HammerGesturesPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services", ["angular2/src/compiler/app_root_url", "angular2/src/compiler/url_resolver", "angular2/src/core/services/title"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + exports.AppRootUrl = app_root_url_1.AppRootUrl; + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + exports.UrlResolver = url_resolver_1.UrlResolver; + var title_1 = require("angular2/src/core/services/title"); + exports.Title = title_1.Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug", ["angular2/src/core/debug/debug_element", "angular2/src/core/debug/debug_element_view_listener"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + exports.DebugElement = debug_element_1.DebugElement; + exports.asNativeElements = debug_element_1.asNativeElements; + exports.By = debug_element_1.By; + exports.Scope = debug_element_1.Scope; + exports.inspectElement = debug_element_1.inspectElement; + var debug_element_view_listener_1 = require("angular2/src/core/debug/debug_element_view_listener"); + exports.inspectNativeElement = debug_element_view_listener_1.inspectNativeElement; + exports.ELEMENT_PROBE_PROVIDERS = debug_element_view_listener_1.ELEMENT_PROBE_PROVIDERS; + exports.ELEMENT_PROBE_BINDINGS = debug_element_view_listener_1.ELEMENT_PROBE_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/angular2", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var constants_1 = require("angular2/src/upgrade/constants"); + var util_1 = require("angular2/src/upgrade/util"); + var angular = require("angular2/src/upgrade/angular_js"); + var CAMEL_CASE = /([A-Z])/g; + var INITIAL_VALUE = {__UNINITIALIZED__: true}; + var NOT_SUPPORTED = 'NOT_SUPPORTED'; + var UpgradeNg1ComponentAdapterBuilder = (function() { + function UpgradeNg1ComponentAdapterBuilder(name) { + this.name = name; + this.inputs = []; + this.inputsRename = []; + this.outputs = []; + this.outputsRename = []; + this.propertyOutputs = []; + this.checkProperties = []; + this.propertyMap = {}; + this.linkFn = null; + this.directive = null; + this.$controller = null; + var selector = name.replace(CAMEL_CASE, function(all, next) { + return '-' + next.toLowerCase(); + }); + var self = this; + this.type = angular2_1.Directive({ + selector: selector, + inputs: this.inputsRename, + outputs: this.outputsRename + }).Class({ + constructor: [new angular2_1.Inject(constants_1.NG1_SCOPE), angular2_1.ElementRef, function(scope, elementRef) { + return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap); + }], + onChanges: function() {}, + doCheck: function() {} + }); + } + UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) { + var directives = injector.get(this.name + 'Directive'); + if (directives.length > 1) { + throw new Error('Only support single directive definition for: ' + this.name); + } + var directive = directives[0]; + if (directive.replace) + this.notSupported('replace'); + if (directive.terminal) + this.notSupported('terminal'); + var link = directive.link; + if (typeof link == 'object') { + if (link.post) + this.notSupported('link.post'); + } + return directive; + }; + UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) { + throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'."); + }; + UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() { + var scope = this.directive.scope; + if (typeof scope == 'object') { + for (var name in scope) { + if (scope.hasOwnProperty(name)) { + var localName = scope[name]; + var type = localName.charAt(0); + localName = localName.substr(1) || name; + var outputName = 'output_' + name; + var outputNameRename = outputName + ': ' + name; + var outputNameRenameChange = outputName + ': ' + name + 'Change'; + var inputName = 'input_' + name; + var inputNameRename = inputName + ': ' + name; + switch (type) { + case '=': + this.propertyOutputs.push(outputName); + this.checkProperties.push(localName); + this.outputs.push(outputName); + this.outputsRename.push(outputNameRenameChange); + this.propertyMap[outputName] = localName; + case '@': + this.inputs.push(inputName); + this.inputsRename.push(inputNameRename); + this.propertyMap[inputName] = localName; + break; + case '&': + this.outputs.push(outputName); + this.outputsRename.push(outputNameRename); + this.propertyMap[outputName] = localName; + break; + default: + var json = JSON.stringify(scope); + throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive."); + } + } + } + } + }; + UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) { + var _this = this; + if (this.directive.template) { + this.linkFn = compileHtml(this.directive.template); + } else if (this.directive.templateUrl) { + var url = this.directive.templateUrl; + var html = templateCache.get(url); + if (html !== undefined) { + this.linkFn = compileHtml(html); + } else { + return new Promise(function(resolve, err) { + httpBackend('GET', url, null, function(status, response) { + if (status == 200) { + resolve(_this.linkFn = compileHtml(templateCache.put(url, response))); + } else { + err("GET " + url + " returned " + status + ": " + response); + } + }); + }); + } + } else { + throw new Error("Directive '" + this.name + "' is not a component, it is missing template."); + } + return null; + function compileHtml(html) { + var div = document.createElement('div'); + div.innerHTML = html; + return compile(div.childNodes); + } + }; + UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) { + var promises = []; + var compile = injector.get(constants_1.NG1_COMPILE); + var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE); + var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND); + var $controller = injector.get(constants_1.NG1_CONTROLLER); + for (var name in exportedComponents) { + if (exportedComponents.hasOwnProperty(name)) { + var exportedComponent = exportedComponents[name]; + exportedComponent.directive = exportedComponent.extractDirective(injector); + exportedComponent.$controller = $controller; + exportedComponent.extractBindings(); + var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend); + if (promise) + promises.push(promise); + } + } + return Promise.all(promises); + }; + return UpgradeNg1ComponentAdapterBuilder; + })(); + exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder; + var UpgradeNg1ComponentAdapter = (function() { + function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) { + this.directive = directive; + this.inputs = inputs; + this.outputs = outputs; + this.propOuts = propOuts; + this.checkProperties = checkProperties; + this.propertyMap = propertyMap; + this.destinationObj = null; + this.checkLastValues = []; + var element = elementRef.nativeElement; + var childNodes = []; + var childNode; + while (childNode = element.firstChild) { + element.removeChild(childNode); + childNodes.push(childNode); + } + var componentScope = scope.$new(!!directive.scope); + var $element = angular.element(element); + var controllerType = directive.controller; + var controller = null; + if (controllerType) { + var locals = { + $scope: componentScope, + $element: $element + }; + controller = $controller(controllerType, locals, null, directive.controllerAs); + $element.data(util_1.controllerKey(directive.name), controller); + } + var link = directive.link; + if (typeof link == 'object') + link = link.pre; + if (link) { + var attrs = NOT_SUPPORTED; + var transcludeFn = NOT_SUPPORTED; + var linkController = this.resolveRequired($element, directive.require); + directive.link(componentScope, $element, attrs, linkController, transcludeFn); + } + this.destinationObj = directive.bindToController && controller ? controller : componentScope; + linkFn(componentScope, function(clonedElement, scope) { + for (var i = 0, + ii = clonedElement.length; i < ii; i++) { + element.appendChild(clonedElement[i]); + } + }, {parentBoundTranscludeFn: function(scope, cloneAttach) { + cloneAttach(childNodes); + }}); + for (var i = 0; i < inputs.length; i++) { + this[inputs[i]] = null; + } + for (var j = 0; j < outputs.length; j++) { + var emitter = this[outputs[j]] = new angular2_1.EventEmitter(); + this.setComponentProperty(outputs[j], (function(emitter) { + return function(value) { + return emitter.next(value); + }; + })(emitter)); + } + for (var k = 0; k < propOuts.length; k++) { + this[propOuts[k]] = new angular2_1.EventEmitter(); + this.checkLastValues.push(INITIAL_VALUE); + } + } + UpgradeNg1ComponentAdapter.prototype.onChanges = function(changes) { + for (var name in changes) { + if (changes.hasOwnProperty(name)) { + var change = changes[name]; + this.setComponentProperty(name, change.currentValue); + } + } + }; + UpgradeNg1ComponentAdapter.prototype.doCheck = function() { + var count = 0; + var destinationObj = this.destinationObj; + var lastValues = this.checkLastValues; + var checkProperties = this.checkProperties; + for (var i = 0; i < checkProperties.length; i++) { + var value = destinationObj[checkProperties[i]]; + var last = lastValues[i]; + if (value !== last) { + if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else { + var eventEmitter = this[this.propOuts[i]]; + eventEmitter.next(lastValues[i] = value); + } + } + } + return count; + }; + UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) { + this.destinationObj[this.propertyMap[name]] = value; + }; + UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) { + if (!require) { + return undefined; + } else if (typeof require == 'string') { + var name = require; + var isOptional = false; + var startParent = false; + var searchParents = false; + var ch; + if (name.charAt(0) == '?') { + isOptional = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + searchParents = true; + name = name.substr(1); + } + if (name.charAt(0) == '^') { + startParent = true; + name = name.substr(1); + } + var key = util_1.controllerKey(name); + if (startParent) + $element = $element.parent(); + var dep = searchParents ? $element.inheritedData(key) : $element.data(key); + if (!dep && !isOptional) { + throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'."); + } + return dep; + } else if (require instanceof Array) { + var deps = []; + for (var i = 0; i < require.length; i++) { + deps.push(this.resolveRequired($element, require[i])); + } + return deps; + } + throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require); + }; + return UpgradeNg1ComponentAdapter; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http_utils", ["angular2/src/facade/lang", "angular2/src/http/enums", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var enums_1 = require("angular2/src/http/enums"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeMethodName(method) { + if (lang_1.isString(method)) { + var originalMethod = method; + method = method.replace(/(\w)(\w*)/g, function(g0, g1, g2) { + return g1.toUpperCase() + g2.toLowerCase(); + }); + method = enums_1.RequestMethods[method]; + if (typeof method !== 'number') + throw exceptions_1.makeTypeError("Invalid request method. The method \"" + originalMethod + "\" is not supported."); + } + return method; + } + exports.normalizeMethodName = normalizeMethodName; + var lang_2 = require("angular2/src/facade/lang"); + exports.isJsObject = lang_2.isJsObject; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/base_request_options", ["angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/angular2", "angular2/src/http/url_search_params", "angular2/src/http/http_utils"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var headers_1 = require("angular2/src/http/headers"); + var enums_1 = require("angular2/src/http/enums"); + var angular2_1 = require("angular2/angular2"); + var url_search_params_1 = require("angular2/src/http/url_search_params"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var RequestOptions = (function() { + function RequestOptions(_a) { + var _b = _a === void 0 ? {} : _a, + method = _b.method, + headers = _b.headers, + body = _b.body, + url = _b.url, + search = _b.search; + this.method = lang_1.isPresent(method) ? http_utils_1.normalizeMethodName(method) : null; + this.headers = lang_1.isPresent(headers) ? headers : null; + this.body = lang_1.isPresent(body) ? body : null; + this.url = lang_1.isPresent(url) ? url : null; + this.search = lang_1.isPresent(search) ? (lang_1.isString(search) ? new url_search_params_1.URLSearchParams((search)) : (search)) : null; + } + RequestOptions.prototype.merge = function(options) { + return new RequestOptions({ + method: lang_1.isPresent(options) && lang_1.isPresent(options.method) ? options.method : this.method, + headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, + body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, + url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url, + search: lang_1.isPresent(options) && lang_1.isPresent(options.search) ? (lang_1.isString(options.search) ? new url_search_params_1.URLSearchParams((options.search)) : (options.search).clone()) : this.search + }); + }; + return RequestOptions; + })(); + exports.RequestOptions = RequestOptions; + var BaseRequestOptions = (function(_super) { + __extends(BaseRequestOptions, _super); + function BaseRequestOptions() { + _super.call(this, { + method: enums_1.RequestMethods.Get, + headers: new headers_1.Headers() + }); + } + BaseRequestOptions = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], BaseRequestOptions); + return BaseRequestOptions; + })(RequestOptions); + exports.BaseRequestOptions = BaseRequestOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/xhr_backend", ["angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_xhr", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var XHRConnection = (function() { + function XHRConnection(req, browserXHR, baseResponseOptions) { + var _this = this; + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + var _xhr = browserXHR.build(); + _xhr.open(enums_1.RequestMethods[req.method].toUpperCase(), req.url); + var onLoad = function() { + var response = lang_1.isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; + var status = _xhr.status === 1223 ? 204 : _xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + var responseOptions = new base_response_options_1.ResponseOptions({ + body: response, + status: status + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(err) { + var responseOptions = new base_response_options_1.ResponseOptions({ + body: err, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + if (lang_1.isPresent(req.headers)) { + req.headers.forEach(function(values, name) { + return _xhr.setRequestHeader(name, values.join(',')); + }); + } + _xhr.addEventListener('load', onLoad); + _xhr.addEventListener('error', onError); + _xhr.send(_this.request.text()); + return function() { + _xhr.removeEventListener('load', onLoad); + _xhr.removeEventListener('error', onError); + _xhr.abort(); + }; + }); + } + return XHRConnection; + })(); + exports.XHRConnection = XHRConnection; + var XHRBackend = (function() { + function XHRBackend(_browserXHR, _baseResponseOptions) { + this._browserXHR = _browserXHR; + this._baseResponseOptions = _baseResponseOptions; + } + XHRBackend.prototype.createConnection = function(request) { + return new XHRConnection(request, this._browserXHR, this._baseResponseOptions); + }; + XHRBackend = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_xhr_1.BrowserXhr, base_response_options_1.ResponseOptions])], XHRBackend); + return XHRBackend; + })(); + exports.XHRBackend = XHRBackend; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/backends/jsonp_backend", ["angular2/src/http/interfaces", "angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/angular2", "angular2/src/http/backends/browser_jsonp", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var interfaces_1 = require("angular2/src/http/interfaces"); + var enums_1 = require("angular2/src/http/enums"); + var static_response_1 = require("angular2/src/http/static_response"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var angular2_1 = require("angular2/angular2"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var angular2_2 = require("angular2/angular2"); + var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; + var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.'; + var JSONPConnection = (function() { + function JSONPConnection() {} + return JSONPConnection; + })(); + exports.JSONPConnection = JSONPConnection; + var JSONPConnection_ = (function(_super) { + __extends(JSONPConnection_, _super); + function JSONPConnection_(req, _dom, baseResponseOptions) { + var _this = this; + _super.call(this); + this._dom = _dom; + this.baseResponseOptions = baseResponseOptions; + this._finished = false; + if (req.method !== enums_1.RequestMethods.Get) { + throw exceptions_1.makeTypeError(JSONP_ERR_WRONG_METHOD); + } + this.request = req; + this.response = new angular2_2.Observable(function(responseObserver) { + _this.readyState = enums_1.ReadyStates.Loading; + var id = _this._id = _dom.nextRequestID(); + _dom.exposeConnection(id, _this); + var callback = _dom.requestCallback(_this._id); + var url = req.url; + if (url.indexOf('=JSONP_CALLBACK&') > -1) { + url = lang_1.StringWrapper.replace(url, '=JSONP_CALLBACK&', "=" + callback + "&"); + } else if (url.lastIndexOf('=JSONP_CALLBACK') === url.length - '=JSONP_CALLBACK'.length) { + url = url.substring(0, url.length - '=JSONP_CALLBACK'.length) + ("=" + callback); + } + var script = _this._script = _dom.build(url); + var onLoad = function(event) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + if (!_this._finished) { + var responseOptions_1 = new base_response_options_1.ResponseOptions({ + body: JSONP_ERR_NO_CALLBACK, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions_1 = baseResponseOptions.merge(responseOptions_1); + } + responseObserver.error(new static_response_1.Response(responseOptions_1)); + return ; + } + var responseOptions = new base_response_options_1.ResponseOptions({body: _this._responseData}); + if (lang_1.isPresent(_this.baseResponseOptions)) { + responseOptions = _this.baseResponseOptions.merge(responseOptions); + } + responseObserver.next(new static_response_1.Response(responseOptions)); + responseObserver.complete(); + }; + var onError = function(error) { + if (_this.readyState === enums_1.ReadyStates.Cancelled) + return ; + _this.readyState = enums_1.ReadyStates.Done; + _dom.cleanup(script); + var responseOptions = new base_response_options_1.ResponseOptions({ + body: error.message, + type: enums_1.ResponseTypes.Error + }); + if (lang_1.isPresent(baseResponseOptions)) { + responseOptions = baseResponseOptions.merge(responseOptions); + } + responseObserver.error(new static_response_1.Response(responseOptions)); + }; + script.addEventListener('load', onLoad); + script.addEventListener('error', onError); + _dom.send(script); + return function() { + _this.readyState = enums_1.ReadyStates.Cancelled; + script.removeEventListener('load', onLoad); + script.removeEventListener('error', onError); + if (lang_1.isPresent(script)) { + _this._dom.cleanup(script); + } + }; + }); + } + JSONPConnection_.prototype.finished = function(data) { + this._finished = true; + this._dom.removeConnection(this._id); + if (this.readyState === enums_1.ReadyStates.Cancelled) + return ; + this._responseData = data; + }; + return JSONPConnection_; + })(JSONPConnection); + exports.JSONPConnection_ = JSONPConnection_; + var JSONPBackend = (function(_super) { + __extends(JSONPBackend, _super); + function JSONPBackend() { + _super.apply(this, arguments); + } + return JSONPBackend; + })(interfaces_1.ConnectionBackend); + exports.JSONPBackend = JSONPBackend; + var JSONPBackend_ = (function(_super) { + __extends(JSONPBackend_, _super); + function JSONPBackend_(_browserJSONP, _baseResponseOptions) { + _super.call(this); + this._browserJSONP = _browserJSONP; + this._baseResponseOptions = _baseResponseOptions; + } + JSONPBackend_.prototype.createConnection = function(request) { + return new JSONPConnection_(request, this._browserJSONP, this._baseResponseOptions); + }; + JSONPBackend_ = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [browser_jsonp_1.BrowserJsonp, base_response_options_1.ResponseOptions])], JSONPBackend_); + return JSONPBackend_; + })(JSONPBackend); + exports.JSONPBackend_ = JSONPBackend_; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); + var lang_1 = require("angular2/src/facade/lang"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; + var UTIL = "ChangeDetectionUtil"; + var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; + var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); + var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); + var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); + var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); + var ChangeDetectionCompiler = (function() { + function ChangeDetectionCompiler(_genConfig) { + this._genConfig = _genConfig; + } + ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { + var _this = this; + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + return changeDetectorDefinitions.map(function(definition) { + return _this._createChangeDetectorFactory(definition); + }); + }; + ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { + if (lang_1.IS_DART || !this._genConfig.useJit) { + var proto = new change_detection_1.DynamicProtoChangeDetector(definition); + return function(dispatcher) { + return proto.instantiate(dispatcher); + }; + } else { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR, CHANGE_DETECTOR_STATE).generate(); + } + }; + ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + var factories = []; + var index = 0; + var sourceParts = changeDetectorDefinitions.map(function(definition) { + var codegen; + var sourcePart; + if (lang_1.IS_DART) { + codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); + var className = "_" + definition.id; + var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; + codegen.generate(typeRef, className, definition); + factories.push(className + ".newChangeDetector"); + sourcePart = codegen.toString(); + } else { + codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); + factories.push("function(dispatcher) { return new " + codegen.typeName + "(dispatcher); }"); + sourcePart = codegen.generateSource(); + } + index++; + return sourcePart; + }); + return new source_module_1.SourceExpressions(sourceParts, factories); + }; + ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); + return ChangeDetectionCompiler; + })(); + exports.ChangeDetectionCompiler = ChangeDetectionCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var selector_1 = require("angular2/src/compiler/selector"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = new RegExp('\\.'); + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + } + TemplateParser.prototype.parse = function(template, directives, sourceInfo) { + var parseVisitor = new TemplateParseVisitor(directives, this._exprParser, this._schemaRegistry); + var result = html_ast_1.htmlVisitAll(parseVisitor, this._htmlParser.parse(template, sourceInfo), EMPTY_COMPONENT); + if (parseVisitor.errors.length > 0) { + var errorString = parseVisitor.errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result; + }; + TemplateParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser])], TemplateParser); + return TemplateParser; + })(); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(directives, _exprParser, _schemaRegistry) { + var _this = this; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + } + TemplateParseVisitor.prototype._reportError = function(message) { + this.errors.push(message); + }; + TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceInfo) { + try { + return this._exprParser.parseInterpolation(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseAction = function(value, sourceInfo) { + try { + return this._exprParser.parseAction(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseBinding = function(value, sourceInfo) { + try { + return this._exprParser.parseBinding(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceInfo) { + try { + return this._exprParser.parseTemplateBindings(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return []; + } + }; + TemplateParseVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + var expr = this._parseInterpolation(ast.value, ast.sourceInfo); + if (lang_1.isPresent(expr)) { + return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceInfo); + } else { + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + } + }; + TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + TemplateParseVisitor.prototype.visitElement = function(element, component) { + var _this = this; + var nodeName = element.name; + var preparsedElement = template_preparser_1.preparseElement(element); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { + return null; + } + if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { + return null; + } + var matchableAttrs = []; + var elementOrDirectiveProps = []; + var vars = []; + var events = []; + var templateElementOrDirectiveProps = []; + var templateVars = []; + var templateMatchableAttrs = []; + var hasInlineTemplates = false; + var attrs = []; + element.attrs.forEach(function(attr) { + matchableAttrs.push([attr.name, attr.value]); + var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); + var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); + if (!hasBinding && !hasTemplateBinding) { + attrs.push(_this.visitAttr(attr, null)); + } + if (hasTemplateBinding) { + hasInlineTemplates = true; + } + }); + var isTemplateElement = nodeName == TEMPLATE_ELEMENT; + var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); + var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceInfo); + var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); + var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); + var elementNgContentIndex = hasInlineTemplates ? null : component.findNgContentIndex(elementCssSelector); + var parsedElement; + if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { + parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, elementNgContentIndex, element.sourceInfo); + } else if (isTemplateElement) { + this._assertAllEventsPublishedByDirectives(directives, events, element.sourceInfo); + this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, elementNgContentIndex, element.sourceInfo); + } else { + this._assertOnlyOneComponent(directives, element.sourceInfo); + var elementExportAsVars = vars.filter(function(varAst) { + return varAst.value.length === 0; + }); + parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, elementNgContentIndex, element.sourceInfo); + } + if (hasInlineTemplates) { + var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); + var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceInfo); + var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); + this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], component.findNgContentIndex(templateCssSelector), element.sourceInfo); + } + return parsedElement; + }; + TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { + var templateBindingsSource = null; + if (attr.name == TEMPLATE_ATTR) { + templateBindingsSource = attr.value; + } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { + var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; + } + if (lang_1.isPresent(templateBindingsSource)) { + var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceInfo); + for (var i = 0; i < bindings.length; i++) { + var binding = bindings[i]; + var dashCaseKey = util_1.camelCaseToDashCase(binding.key); + if (binding.keyIsVar) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(binding.key), binding.name, attr.sourceInfo)); + targetMatchableAttrs.push([dashCaseKey, binding.name]); + } else if (lang_1.isPresent(binding.expression)) { + this._parsePropertyAst(dashCaseKey, binding.expression, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else { + targetMatchableAttrs.push([dashCaseKey, '']); + this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps); + } + } + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { + var attrName = this._normalizeAttributeName(attr.name); + var attrValue = attr.value; + var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); + var hasBinding = false; + if (lang_1.isPresent(bindParts)) { + hasBinding = true; + if (lang_1.isPresent(bindParts[1])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[2])) { + var identifier = bindParts[5]; + this._parseVariable(identifier, attrValue, attr.sourceInfo, targetVars); + } else if (lang_1.isPresent(bindParts[3])) { + this._parseEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[4])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[6])) { + this._parseProperty(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[7])) { + this._parseProperty(bindParts[7], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[8])) { + this._parseEvent(bindParts[8], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } + } else { + hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } + if (!hasBinding) { + this._parseLiteralAttr(attrName, attrValue, attr.sourceInfo, targetProps); + } + return hasBinding; + }; + TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { + return attrName.startsWith('data-') ? attrName.substring(5) : attrName; + }; + TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceInfo, targetVars) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(identifier), value, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceInfo, targetMatchableAttrs, targetProps) { + this._parsePropertyAst(name, this._parseBinding(expression, sourceInfo), sourceInfo, targetMatchableAttrs, targetProps); + }; + TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceInfo, targetMatchableAttrs, targetProps) { + var expr = this._parseInterpolation(value, sourceInfo); + if (lang_1.isPresent(expr)) { + this._parsePropertyAst(name, expr, sourceInfo, targetMatchableAttrs, targetProps); + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceInfo, targetMatchableAttrs, targetProps) { + targetMatchableAttrs.push([name, ast.source]); + targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + this._parseEvent(name + "-change", expression + "=$event", sourceInfo, targetMatchableAttrs, targetEvents); + }; + TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + var parts = util_1.splitAtColon(name, [null, name]); + var target = parts[0]; + var eventName = parts[1]; + targetEvents.push(new template_ast_1.BoundEventAst(util_1.dashCaseToCamelCase(eventName), target, this._parseAction(expression, sourceInfo), sourceInfo)); + }; + TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceInfo, targetProps) { + targetProps.push(new BoundElementOrDirectiveProperty(util_1.dashCaseToCamelCase(name), this._exprParser.wrapLiteralPrimitive(value, sourceInfo), true, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { + var _this = this; + var directives = []; + selectorMatcher.match(elementCssSelector, function(selector, directive) { + directives.push(directive); + }); + collection_1.ListWrapper.sort(directives, function(dir1, dir2) { + var dir1Comp = dir1.isComponent; + var dir2Comp = dir2.isComponent; + if (dir1Comp && !dir2Comp) { + return -1; + } else if (!dir1Comp && dir2Comp) { + return 1; + } else { + return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); + } + }); + return directives; + }; + TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceInfo) { + var _this = this; + var matchedVariables = new Set(); + var directiveAsts = directives.map(function(directive) { + var hostProperties = []; + var hostEvents = []; + var directiveProperties = []; + _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceInfo, hostProperties); + _this._createDirectiveHostEventAsts(directive.hostListeners, sourceInfo, hostEvents); + _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); + var exportAsVars = []; + possibleExportAsVars.forEach(function(varAst) { + if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { + exportAsVars.push(varAst); + matchedVariables.add(varAst.name); + } + }); + return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceInfo); + }); + possibleExportAsVars.forEach(function(varAst) { + if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { + _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\" at " + varAst.sourceInfo); + } + }); + return directiveAsts; + }; + TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceInfo, targetPropertyAsts) { + var _this = this; + if (lang_1.isPresent(hostProps)) { + collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { + var exprAst = _this._parseBinding(expression, sourceInfo); + targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceInfo)); + }); + } + }; + TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceInfo, targetEventAsts) { + var _this = this; + if (lang_1.isPresent(hostListeners)) { + collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { + _this._parseEvent(propName, expression, sourceInfo, [], targetEventAsts); + }); + } + }; + TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { + if (lang_1.isPresent(directiveProperties)) { + var boundPropsByName = new Map(); + boundProps.forEach(function(boundProp) { + var key = util_1.dashCaseToCamelCase(boundProp.name); + var prevValue = boundPropsByName.get(boundProp.name); + if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { + boundPropsByName.set(key, boundProp); + } + }); + collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { + elProp = util_1.dashCaseToCamelCase(elProp); + var boundProp = boundPropsByName.get(elProp); + if (lang_1.isPresent(boundProp)) { + targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceInfo)); + } + }); + } + }; + TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { + var _this = this; + var boundElementProps = []; + var boundDirectivePropsIndex = new Map(); + directives.forEach(function(directive) { + directive.inputs.forEach(function(prop) { + boundDirectivePropsIndex.set(prop.templateName, prop); + }); + }); + props.forEach(function(prop) { + if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { + boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceInfo)); + } + }); + return boundElementProps; + }; + TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceInfo) { + var unit = null; + var bindingType; + var boundPropertyName; + var parts = lang_1.StringWrapper.split(name, PROPERTY_PARTS_SEPARATOR); + if (parts.length === 1) { + boundPropertyName = this._schemaRegistry.getMappedPropName(util_1.dashCaseToCamelCase(parts[0])); + bindingType = template_ast_1.PropertyBindingType.Property; + if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { + this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property in " + sourceInfo); + } + } else if (parts[0] == ATTRIBUTE_PREFIX) { + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Attribute; + } else if (parts[0] == CLASS_PREFIX) { + boundPropertyName = parts[1]; + bindingType = template_ast_1.PropertyBindingType.Class; + } else if (parts[0] == STYLE_PREFIX) { + unit = parts.length > 2 ? parts[2] : null; + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Style; + } else { + this._reportError("Invalid property name " + name + " in " + sourceInfo); + bindingType = null; + } + return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceInfo); + }; + TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { + var componentTypeNames = []; + directives.forEach(function(directive) { + var typeName = directive.directive.type.name; + if (directive.directive.isComponent) { + componentTypeNames.push(typeName); + } + }); + return componentTypeNames; + }; + TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceInfo) { + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 1) { + this._reportError("More than one component: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + }; + TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceInfo) { + var _this = this; + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 0) { + this._reportError("Components on an embedded template: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + elementProps.forEach(function(prop) { + _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template in " + prop.sourceInfo); + }); + }; + TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events, sourceInfo) { + var _this = this; + var allDirectiveEvents = new Set(); + directives.forEach(function(directive) { + collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { + allDirectiveEvents.add(eventName); + }); + }); + events.forEach(function(event) { + if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { + _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template in " + sourceInfo); + } + }); + }; + return TemplateParseVisitor; + })(); + var NonBindableVisitor = (function() { + function NonBindableVisitor() {} + NonBindableVisitor.prototype.visitElement = function(ast, component) { + var preparsedElement = template_preparser_1.preparseElement(ast); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { + return null; + } + var attrNameAndValues = ast.attrs.map(function(attrAst) { + return [attrAst.name, attrAst.value]; + }); + var selector = createElementCssSelector(ast.name, attrNameAndValues); + var ngContentIndex = component.findNgContentIndex(selector); + var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); + return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitAttr = function(ast, context) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + }; + return NonBindableVisitor; + })(); + var BoundElementOrDirectiveProperty = (function() { + function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceInfo) { + this.name = name; + this.expression = expression; + this.isLiteral = isLiteral; + this.sourceInfo = sourceInfo; + } + return BoundElementOrDirectiveProperty; + })(); + function splitClasses(classAttrValue) { + return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); + } + exports.splitClasses = splitClasses; + var Component = (function() { + function Component(ngContentIndexMatcher, wildcardNgContentIndex) { + this.ngContentIndexMatcher = ngContentIndexMatcher; + this.wildcardNgContentIndex = wildcardNgContentIndex; + } + Component.create = function(directives) { + if (directives.length === 0 || !directives[0].directive.isComponent) { + return EMPTY_COMPONENT; + } + var matcher = new selector_1.SelectorMatcher(); + var ngContentSelectors = directives[0].directive.template.ngContentSelectors; + var wildcardNgContentIndex = null; + for (var i = 0; i < ngContentSelectors.length; i++) { + var selector = ngContentSelectors[i]; + if (lang_1.StringWrapper.equals(selector, '*')) { + wildcardNgContentIndex = i; + } else { + matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); + } + } + return new Component(matcher, wildcardNgContentIndex); + }; + Component.prototype.findNgContentIndex = function(selector) { + var ngContentIndices = []; + this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { + ngContentIndices.push(ngContentIndex); + }); + collection_1.ListWrapper.sort(ngContentIndices); + if (lang_1.isPresent(this.wildcardNgContentIndex)) { + ngContentIndices.push(this.wildcardNgContentIndex); + } + return ngContentIndices.length > 0 ? ngContentIndices[0] : null; + }; + return Component; + })(); + function createElementCssSelector(elementName, matchableAttrs) { + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(elementName); + for (var i = 0; i < matchableAttrs.length; i++) { + var attrName = matchableAttrs[i][0].toLowerCase(); + var attrValue = matchableAttrs[i][1]; + cssSelector.addAttribute(attrName, attrValue); + if (attrName == CLASS_ATTR) { + var classes = splitClasses(attrValue); + classes.forEach(function(className) { + return cssSelector.addClassName(className); + }); + } + } + return cssSelector; + } + var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); + var NON_BINDABLE_VISITOR = new NonBindableVisitor(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/core/dom/generic_browser_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var generic_browser_adapter_1 = require("angular2/src/core/dom/generic_browser_adapter"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var DOM_KEY_LOCATION_NUMPAD = 3; + var _keyMap = { + '\b': 'Backspace', + '\t': 'Tab', + '\x7F': 'Delete', + '\x1B': 'Escape', + 'Del': 'Delete', + 'Esc': 'Escape', + 'Left': 'ArrowLeft', + 'Right': 'ArrowRight', + 'Up': 'ArrowUp', + 'Down': 'ArrowDown', + 'Menu': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'Win': 'OS' + }; + var _chromeNumKeyPadMap = { + 'A': '1', + 'B': '2', + 'C': '3', + 'D': '4', + 'E': '5', + 'F': '6', + 'G': '7', + 'H': '8', + 'I': '9', + 'J': '*', + 'K': '+', + 'M': '-', + 'N': '.', + 'O': '/', + '\x60': '0', + '\x90': 'NumLock' + }; + var BrowserDomAdapter = (function(_super) { + __extends(BrowserDomAdapter, _super); + function BrowserDomAdapter() { + _super.apply(this, arguments); + } + BrowserDomAdapter.prototype.parse = function(templateHtml) { + throw new Error("parse not implemented"); + }; + BrowserDomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); + }; + BrowserDomAdapter.prototype.hasProperty = function(element, name) { + return name in element; + }; + BrowserDomAdapter.prototype.setProperty = function(el, name, value) { + el[name] = value; + }; + BrowserDomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { + el[methodName].apply(el, args); + }; + BrowserDomAdapter.prototype.logError = function(error) { + if (window.console.error) { + window.console.error(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.log = function(error) { + window.console.log(error); + }; + BrowserDomAdapter.prototype.logGroup = function(error) { + if (window.console.group) { + window.console.group(error); + this.logError(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.logGroupEnd = function() { + if (window.console.groupEnd) { + window.console.groupEnd(); + } + }; + Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + BrowserDomAdapter.prototype.query = function(selector) { + return document.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelector = function(el, selector) { + return el.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { + return el.querySelectorAll(selector); + }; + BrowserDomAdapter.prototype.on = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + }; + BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + return function() { + el.removeEventListener(evt, listener, false); + }; + }; + BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { + el.dispatchEvent(evt); + }; + BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { + var evt = document.createEvent('MouseEvent'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.createEvent = function(eventType) { + var evt = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.preventDefault = function(evt) { + evt.preventDefault(); + evt.returnValue = false; + }; + BrowserDomAdapter.prototype.isPrevented = function(evt) { + return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + BrowserDomAdapter.prototype.getInnerHTML = function(el) { + return el.innerHTML; + }; + BrowserDomAdapter.prototype.getOuterHTML = function(el) { + return el.outerHTML; + }; + BrowserDomAdapter.prototype.nodeName = function(node) { + return node.nodeName; + }; + BrowserDomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + BrowserDomAdapter.prototype.type = function(node) { + return node.type; + }; + BrowserDomAdapter.prototype.content = function(node) { + if (this.hasProperty(node, "content")) { + return node.content; + } else { + return node; + } + }; + BrowserDomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + BrowserDomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + BrowserDomAdapter.prototype.parentElement = function(el) { + return el.parentNode; + }; + BrowserDomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + BrowserDomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + BrowserDomAdapter.prototype.clearNodes = function(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }; + BrowserDomAdapter.prototype.appendChild = function(el, node) { + el.appendChild(node); + }; + BrowserDomAdapter.prototype.removeChild = function(el, node) { + el.removeChild(node); + }; + BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { + el.replaceChild(newChild, oldChild); + }; + BrowserDomAdapter.prototype.remove = function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + return node; + }; + BrowserDomAdapter.prototype.insertBefore = function(el, node) { + el.parentNode.insertBefore(node, el); + }; + BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { + nodes.forEach(function(n) { + return el.parentNode.insertBefore(n, el); + }); + }; + BrowserDomAdapter.prototype.insertAfter = function(el, node) { + el.parentNode.insertBefore(node, el.nextSibling); + }; + BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { + el.innerHTML = value; + }; + BrowserDomAdapter.prototype.getText = function(el) { + return el.textContent; + }; + BrowserDomAdapter.prototype.setText = function(el, value) { + el.textContent = value; + }; + BrowserDomAdapter.prototype.getValue = function(el) { + return el.value; + }; + BrowserDomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + BrowserDomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + BrowserDomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + BrowserDomAdapter.prototype.createComment = function(text) { + return document.createComment(text); + }; + BrowserDomAdapter.prototype.createTemplate = function(html) { + var t = document.createElement('template'); + t.innerHTML = html; + return t; + }; + BrowserDomAdapter.prototype.createElement = function(tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElement(tagName); + }; + BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElementNS(ns, tagName); + }; + BrowserDomAdapter.prototype.createTextNode = function(text, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createTextNode(text); + }; + BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { + if (doc === void 0) { + doc = document; + } + var el = doc.createElement('SCRIPT'); + el.setAttribute(attrName, attrValue); + return el; + }; + BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { + if (doc === void 0) { + doc = document; + } + var style = doc.createElement('style'); + this.appendChild(style, this.createTextNode(css)); + return style; + }; + BrowserDomAdapter.prototype.createShadowRoot = function(el) { + return el.createShadowRoot(); + }; + BrowserDomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + BrowserDomAdapter.prototype.getHost = function(el) { + return el.host; + }; + BrowserDomAdapter.prototype.clone = function(node) { + return node.cloneNode(true); + }; + BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { + return element.getElementsByClassName(name); + }; + BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { + return element.getElementsByTagName(name); + }; + BrowserDomAdapter.prototype.classList = function(element) { + return Array.prototype.slice.call(element.classList, 0); + }; + BrowserDomAdapter.prototype.addClass = function(element, classname) { + element.classList.add(classname); + }; + BrowserDomAdapter.prototype.removeClass = function(element, classname) { + element.classList.remove(classname); + }; + BrowserDomAdapter.prototype.hasClass = function(element, classname) { + return element.classList.contains(classname); + }; + BrowserDomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + element.style[stylename] = stylevalue; + }; + BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { + element.style[stylename] = null; + }; + BrowserDomAdapter.prototype.getStyle = function(element, stylename) { + return element.style[stylename]; + }; + BrowserDomAdapter.prototype.tagName = function(element) { + return element.tagName; + }; + BrowserDomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = element.attributes; + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.hasAttribute(attribute); + }; + BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { + return element.getAttribute(attribute); + }; + BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { + element.setAttribute(name, value); + }; + BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { + element.setAttributeNS(ns, name, value); + }; + BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { + element.removeAttribute(attribute); + }; + BrowserDomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + BrowserDomAdapter.prototype.createHtmlDocument = function() { + return document.implementation.createHTMLDocument('fakeTitle'); + }; + BrowserDomAdapter.prototype.defaultDoc = function() { + return document; + }; + BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { + try { + return el.getBoundingClientRect(); + } catch (e) { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; + } + }; + BrowserDomAdapter.prototype.getTitle = function() { + return document.title; + }; + BrowserDomAdapter.prototype.setTitle = function(newTitle) { + document.title = newTitle || ''; + }; + BrowserDomAdapter.prototype.elementMatches = function(n, selector) { + var matches = false; + if (n instanceof HTMLElement) { + if (n.matches) { + matches = n.matches(selector); + } else if (n.msMatchesSelector) { + matches = n.msMatchesSelector(selector); + } else if (n.webkitMatchesSelector) { + matches = n.webkitMatchesSelector(selector); + } + } + return matches; + }; + BrowserDomAdapter.prototype.isTemplateElement = function(el) { + return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; + }; + BrowserDomAdapter.prototype.isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + BrowserDomAdapter.prototype.isCommentNode = function(node) { + return node.nodeType === Node.COMMENT_NODE; + }; + BrowserDomAdapter.prototype.isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + BrowserDomAdapter.prototype.hasShadowRoot = function(node) { + return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); + }; + BrowserDomAdapter.prototype.isShadowRoot = function(node) { + return node instanceof DocumentFragment; + }; + BrowserDomAdapter.prototype.importIntoDoc = function(node) { + var toImport = node; + if (this.isTemplateElement(node)) { + toImport = this.content(node); + } + return document.importNode(toImport, true); + }; + BrowserDomAdapter.prototype.adoptNode = function(node) { + return document.adoptNode(node); + }; + BrowserDomAdapter.prototype.getHref = function(el) { + return el.href; + }; + BrowserDomAdapter.prototype.getEventKey = function(event) { + var key = event.key; + if (lang_1.isBlank(key)) { + key = event.keyIdentifier; + if (lang_1.isBlank(key)) { + return 'Unidentified'; + } + if (key.startsWith('U+')) { + key = String.fromCharCode(parseInt(key.substring(2), 16)); + if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { + key = _chromeNumKeyPadMap[key]; + } + } + } + if (_keyMap.hasOwnProperty(key)) { + key = _keyMap[key]; + } + return key; + }; + BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return window; + } else if (target == "document") { + return document; + } else if (target == "body") { + return document.body; + } + }; + BrowserDomAdapter.prototype.getHistory = function() { + return window.history; + }; + BrowserDomAdapter.prototype.getLocation = function() { + return window.location; + }; + BrowserDomAdapter.prototype.getBaseHref = function() { + var href = getBaseElementHref(); + if (lang_1.isBlank(href)) { + return null; + } + return relativePath(href); + }; + BrowserDomAdapter.prototype.resetBaseElement = function() { + baseElement = null; + }; + BrowserDomAdapter.prototype.getUserAgent = function() { + return window.navigator.userAgent; + }; + BrowserDomAdapter.prototype.setData = function(element, name, value) { + this.setAttribute(element, 'data-' + name, value); + }; + BrowserDomAdapter.prototype.getData = function(element, name) { + return this.getAttribute(element, 'data-' + name); + }; + BrowserDomAdapter.prototype.getComputedStyle = function(element) { + return getComputedStyle(element); + }; + BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { + return window.requestAnimationFrame(callback); + }; + BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { + window.cancelAnimationFrame(id); + }; + BrowserDomAdapter.prototype.performanceNow = function() { + if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { + return window.performance.now(); + } else { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + } + }; + return BrowserDomAdapter; + })(generic_browser_adapter_1.GenericBrowserDomAdapter); + exports.BrowserDomAdapter = BrowserDomAdapter; + var baseElement = null; + function getBaseElementHref() { + if (lang_1.isBlank(baseElement)) { + baseElement = document.querySelector('base'); + if (lang_1.isBlank(baseElement)) { + return null; + } + } + return baseElement.getAttribute('href'); + } + var urlParsingNode = null; + function relativePath(url) { + if (lang_1.isBlank(urlParsingNode)) { + urlParsingNode = document.createElement("a"); + } + urlParsingNode.setAttribute('href', url); + return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/angular2", "angular2/src/core/application_common", "angular2/src/core/application_ref", "angular2/src/compiler/compiler", "angular2/src/facade/async", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/upgrade/metadata"); + var util_1 = require("angular2/src/upgrade/util"); + var constants_1 = require("angular2/src/upgrade/constants"); + var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter"); + var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter"); + var angular = require("angular2/src/upgrade/angular_js"); + var upgradeCount = 0; + var UpgradeAdapter = (function() { + function UpgradeAdapter() { + this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_"; + this.upgradedComponents = []; + this.downgradedComponents = {}; + this.providers = []; + } + UpgradeAdapter.prototype.downgradeNg2Component = function(type) { + this.upgradedComponents.push(type); + var info = metadata_1.getComponentInfo(type); + return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c"); + }; + UpgradeAdapter.prototype.upgradeNg1Component = function(name) { + if (this.downgradedComponents.hasOwnProperty(name)) { + return this.downgradedComponents[name].type; + } else { + return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type; + } + }; + UpgradeAdapter.prototype.bootstrap = function(element, modules, config) { + var _this = this; + var upgrade = new UpgradeAdapterRef(); + var ng1Injector = null; + var platformRef = angular2_1.platform(); + var applicationRef = platformRef.application([application_ref_1.applicationCommonProviders(), application_common_1.applicationDomProviders(), compiler_1.compilerProviders(), angular2_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() { + return ng1Injector; + }}), angular2_1.provide(constants_1.NG1_COMPILE, {useFactory: function() { + return ng1Injector.get(constants_1.NG1_COMPILE); + }}), this.providers]); + var injector = applicationRef.injector; + var ngZone = injector.get(angular2_1.NgZone); + var compiler = injector.get(angular2_1.Compiler); + var delayApplyExps = []; + var original$applyFn; + var rootScopePrototype; + var rootScope; + var protoViewRefMap = {}; + var ng1Module = angular.module(this.idPrefix, modules); + var ng1compilePromise = null; + ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(angular2_1.AppViewManager)).config(['$provide', function(provide) { + provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) { + rootScopePrototype = rootScopeDelegate.constructor.prototype; + if (rootScopePrototype.hasOwnProperty('$apply')) { + original$applyFn = rootScopePrototype.$apply; + rootScopePrototype.$apply = function(exp) { + return delayApplyExps.push(exp); + }; + } else { + throw new Error("Failed to find '$apply' on '$rootScope'!"); + } + return rootScope = rootScopeDelegate; + }]); + }]).run(['$injector', '$rootScope', function(injector, rootScope) { + ng1Injector = injector; + async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) { + ngZone.run(function() { + return rootScope.$apply(); + }); + }); + ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector); + }]); + angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector); + ngZone.run(function() { + angular.bootstrap(element, [_this.idPrefix], config); + }); + Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() { + ngZone.run(function() { + if (rootScopePrototype) { + rootScopePrototype.$apply = original$applyFn; + while (delayApplyExps.length) { + rootScope.$apply(delayApplyExps.shift()); + } + upgrade._bootstrapDone(applicationRef, ng1Injector); + rootScopePrototype = null; + } + }); + }, util_1.onError); + return upgrade; + }; + UpgradeAdapter.prototype.addProvider = function(provider) { + this.providers.push(provider); + }; + UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) { + var token = options && options.asToken || name; + this.providers.push(angular2_1.provide(token, { + useFactory: function(ng1Injector) { + return ng1Injector.get(name); + }, + deps: [constants_1.NG1_INJECTOR] + })); + }; + UpgradeAdapter.prototype.downgradeNg2Provider = function(token) { + var factory = function(injector) { + return injector.get(token); + }; + factory.$inject = [constants_1.NG2_INJECTOR]; + return factory; + }; + UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) { + var _this = this; + var promises = []; + var types = this.upgradedComponents; + for (var i = 0; i < types.length; i++) { + promises.push(compiler.compileInHost(types[i])); + } + return Promise.all(promises).then(function(protoViews) { + var types = _this.upgradedComponents; + for (var i = 0; i < protoViews.length; i++) { + protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i]; + } + return protoViewRefMap; + }, util_1.onError); + }; + return UpgradeAdapter; + })(); + exports.UpgradeAdapter = UpgradeAdapter; + function ng1ComponentDirective(info, idPrefix) { + directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE]; + function directiveFactory(protoViewRefMap, viewManager, parse) { + var protoView = protoViewRefMap[info.selector]; + if (!protoView) + throw new Error('Expecting ProtoViewRef for: ' + info.selector); + var idCount = 0; + return { + restrict: 'E', + require: constants_1.REQUIRE_INJECTOR, + link: {post: function(scope, element, attrs, parentInjector, transclude) { + var domElement = element[0]; + var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView); + facade.setupInputs(); + facade.bootstrapNg2(); + facade.projectContent(); + facade.setupOutputs(); + facade.registerCleanup(); + }} + }; + } + return directiveFactory; + } + var UpgradeAdapterRef = (function() { + function UpgradeAdapterRef() { + this._readyFn = null; + this.ng1RootScope = null; + this.ng1Injector = null; + this.ng2ApplicationRef = null; + this.ng2Injector = null; + } + UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) { + this.ng2ApplicationRef = applicationRef; + this.ng2Injector = applicationRef.injector; + this.ng1Injector = ng1Injector; + this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE); + this._readyFn && this._readyFn(this); + }; + UpgradeAdapterRef.prototype.ready = function(fn) { + this._readyFn = fn; + }; + UpgradeAdapterRef.prototype.dispose = function() { + this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy(); + this.ng2ApplicationRef.dispose(); + }; + return UpgradeAdapterRef; + })(); + exports.UpgradeAdapterRef = UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/static_request", ["angular2/src/http/headers", "angular2/src/http/http_utils", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var headers_1 = require("angular2/src/http/headers"); + var http_utils_1 = require("angular2/src/http/http_utils"); + var lang_1 = require("angular2/src/facade/lang"); + var Request = (function() { + function Request(requestOptions) { + var url = requestOptions.url; + this.url = requestOptions.url; + if (lang_1.isPresent(requestOptions.search)) { + var search = requestOptions.search.toString(); + if (search.length > 0) { + var prefix = '?'; + if (lang_1.StringWrapper.contains(this.url, '?')) { + prefix = (this.url[this.url.length - 1] == '&') ? '' : '&'; + } + this.url = url + prefix + search; + } + } + this._body = requestOptions.body; + this.method = http_utils_1.normalizeMethodName(requestOptions.method); + this.headers = new headers_1.Headers(requestOptions.headers); + } + Request.prototype.text = function() { + return lang_1.isPresent(this._body) ? this._body.toString() : ''; + }; + return Request; + })(); + exports.Request = Request; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/linker/template_commands", "angular2/src/compiler/directive_metadata", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/command_compiler", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var di_1 = require("angular2/src/core/di"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var command_compiler_2 = require("angular2/src/compiler/command_compiler"); + var util_1 = require("angular2/src/compiler/util"); + var TemplateCompiler = (function() { + function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _commandCompiler, _cdCompiler) { + this._runtimeMetadataResolver = _runtimeMetadataResolver; + this._templateNormalizer = _templateNormalizer; + this._templateParser = _templateParser; + this._styleCompiler = _styleCompiler; + this._commandCompiler = _commandCompiler; + this._cdCompiler = _cdCompiler; + this._hostCacheKeys = new Map(); + this._compiledTemplateCache = new Map(); + this._compiledTemplateDone = new Map(); + this._nextTemplateId = 0; + } + TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { + if (!directive.isComponent) { + return async_1.PromiseWrapper.resolve(directive); + } + return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { + return new directive_metadata_1.CompileDirectiveMetadata({ + type: directive.type, + isComponent: directive.isComponent, + dynamicLoadable: directive.dynamicLoadable, + selector: directive.selector, + exportAs: directive.exportAs, + changeDetection: directive.changeDetection, + inputs: directive.inputs, + outputs: directive.outputs, + hostListeners: directive.hostListeners, + hostProperties: directive.hostProperties, + hostAttributes: directive.hostAttributes, + lifecycleHooks: directive.lifecycleHooks, + template: normalizedTemplate + }); + }); + }; + TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { + var hostCacheKey = this._hostCacheKeys.get(type); + if (lang_1.isBlank(hostCacheKey)) { + hostCacheKey = new Object(); + this._hostCacheKeys.set(type, hostCacheKey); + var compMeta = this._runtimeMetadataResolver.getMetadata(type); + assertComponent(compMeta); + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], new Set()); + } + return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { + return new template_commands_1.CompiledHostTemplate(compiledTemplate); + }); + }; + TemplateCompiler.prototype.clearCache = function() { + this._hostCacheKeys.clear(); + this._styleCompiler.clearCache(); + this._compiledTemplateCache.clear(); + this._compiledTemplateDone.clear(); + }; + TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, compilingComponentCacheKeys) { + var _this = this; + var compiledTemplate = this._compiledTemplateCache.get(cacheKey); + var done = this._compiledTemplateDone.get(cacheKey); + if (lang_1.isBlank(compiledTemplate)) { + var styles = []; + var changeDetectorFactory; + var commands = []; + var templateId = lang_1.stringify(compMeta.type.runtime) + "Template" + this._nextTemplateId++; + compiledTemplate = new template_commands_1.CompiledComponentTemplate(templateId, function(dispatcher) { + return changeDetectorFactory(dispatcher); + }, commands, styles); + this._compiledTemplateCache.set(cacheKey, compiledTemplate); + compilingComponentCacheKeys.add(cacheKey); + done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(viewDirectives.map(function(dirMeta) { + return _this.normalizeDirectiveMetadata(dirMeta); + }))).then(function(stylesAndNormalizedViewDirMetas) { + var childPromises = []; + var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); + var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, compMeta.type.name); + var changeDetectorFactories = _this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); + changeDetectorFactory = changeDetectorFactories[0]; + var tmpStyles = stylesAndNormalizedViewDirMetas[0]; + tmpStyles.forEach(function(style) { + return styles.push(style); + }); + var tmpCommands = _this._compileCommandsRuntime(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises); + tmpCommands.forEach(function(cmd) { + return commands.push(cmd); + }); + return async_1.PromiseWrapper.all(childPromises); + }).then(function(_) { + collection_1.SetWrapper.delete(compilingComponentCacheKeys, cacheKey); + return compiledTemplate; + }); + this._compiledTemplateDone.set(cacheKey, done); + } + return compiledTemplate; + }; + TemplateCompiler.prototype._compileCommandsRuntime = function(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises) { + var _this = this; + var cmds = this._commandCompiler.compileComponentRuntime(compMeta, parsedTemplate, changeDetectorFactories, function(childComponentDir) { + var childCacheKey = childComponentDir.type.runtime; + var childViewDirectives = _this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); + var childIsRecursive = collection_1.SetWrapper.has(compilingComponentCacheKeys, childCacheKey); + var childTemplate = _this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, compilingComponentCacheKeys); + if (!childIsRecursive) { + childPromises.push(_this._compiledTemplateDone.get(childCacheKey)); + } + return function() { + return childTemplate; + }; + }); + cmds.forEach(function(cmd) { + if (cmd instanceof template_commands_1.BeginComponentCmd) { + cmd.templateGetter(); + } + }); + return cmds; + }; + TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { + var _this = this; + if (components.length === 0) { + throw new exceptions_1.BaseException('No components given'); + } + var declarations = []; + var templateArguments = []; + var componentMetas = []; + components.forEach(function(componentWithDirs) { + var compMeta = componentWithDirs.component; + assertComponent(compMeta); + componentMetas.push(compMeta); + _this._processTemplateCodeGen(compMeta, componentWithDirs.directives, declarations, templateArguments); + if (compMeta.dynamicLoadable) { + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + componentMetas.push(hostMeta); + _this._processTemplateCodeGen(hostMeta, [compMeta], declarations, templateArguments); + } + }); + collection_1.ListWrapper.forEachWithIndex(componentMetas, function(compMeta, index) { + var templateId = compMeta.type.moduleUrl + "|" + compMeta.type.name; + var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; + var compiledTemplateExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledComponentTemplate('" + templateId + "'," + templateArguments[index].join(',') + ")"; + var variableValueExpr; + if (compMeta.type.isHost) { + variableValueExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledHostTemplate(" + compiledTemplateExpr + ")"; + } else { + variableValueExpr = compiledTemplateExpr; + } + var varName = templateVariableName(compMeta.type); + declarations.push("" + util_1.codeGenExportVariable(varName) + variableValueExpr + ";"); + declarations.push(util_1.codeGenValueFn([], varName, templateGetterName(compMeta.type)) + ";"); + }); + var moduleUrl = components[0].component.type.moduleUrl; + return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); + }; + TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); + }; + TemplateCompiler.prototype._processTemplateCodeGen = function(compMeta, directives, targetDeclarations, targetTemplateArguments) { + var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); + var parsedTemplate = this._templateParser.parse(compMeta.template.template, directives, compMeta.type.name); + var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); + var commandsExpr = this._commandCompiler.compileComponentCodeGen(compMeta, parsedTemplate, changeDetectorsExprs.expressions, codeGenComponentTemplateFactory); + addAll(styleExpr.declarations, targetDeclarations); + addAll(changeDetectorsExprs.declarations, targetDeclarations); + addAll(commandsExpr.declarations, targetDeclarations); + targetTemplateArguments.push([changeDetectorsExprs.expressions[0], commandsExpr.expression, styleExpr.expression]); + }; + TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler])], TemplateCompiler); + return TemplateCompiler; + })(); + exports.TemplateCompiler = TemplateCompiler; + var NormalizedComponentWithViewDirectives = (function() { + function NormalizedComponentWithViewDirectives(component, directives) { + this.component = component; + this.directives = directives; + } + return NormalizedComponentWithViewDirectives; + })(); + exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; + function assertComponent(meta) { + if (!meta.isComponent) { + throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); + } + } + function templateVariableName(type) { + return type.name + "Template"; + } + function templateGetterName(type) { + return templateVariableName(type) + "Getter"; + } + function templateModuleUrl(moduleUrl) { + var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); + return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; + } + function addAll(source, target) { + for (var i = 0; i < source.length; i++) { + target.push(source[i]); + } + } + function codeGenComponentTemplateFactory(nestedCompType) { + return "" + source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + templateGetterName(nestedCompType.type); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_common", ["angular2/src/common/forms", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/dom/browser_adapter", "angular2/src/core/testability/browser_testability", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr", "angular2/src/compiler/xhr_impl", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/events/key_events", "angular2/src/core/render/dom/events/hammer_gestures", "angular2/src/core/testability/testability", "angular2/src/core/render/api", "angular2/src/core/render/render", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/platform_bindings", "angular2/src/animate/animation_builder", "angular2/src/animate/browser_details", "angular2/src/core/profile/wtf_init", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var forms_1 = require("angular2/src/common/forms"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var browser_testability_1 = require("angular2/src/core/testability/browser_testability"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var key_events_1 = require("angular2/src/core/render/dom/events/key_events"); + var hammer_gestures_1 = require("angular2/src/core/render/dom/events/hammer_gestures"); + var testability_1 = require("angular2/src/core/testability/testability"); + var api_1 = require("angular2/src/core/render/api"); + var render_1 = require("angular2/src/core/render/render"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var platform_bindings_1 = require("angular2/src/core/platform_bindings"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); + var application_ref_1 = require("angular2/src/core/application_ref"); + function applicationDomProviders() { + if (lang_1.isBlank(dom_adapter_1.DOM)) { + throw "Must set a root DOM adapter first."; + } + return [di_1.provide(render_1.DOCUMENT, {useValue: dom_adapter_1.DOM.defaultDoc()}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: key_events_1.KeyEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: hammer_gestures_1.HammerGesturesPlugin, + multi: true + }), di_1.provide(render_1.DomRenderer, {useClass: render_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), shared_styles_host_1.DomSharedStylesHost, di_1.provide(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), platform_bindings_1.EXCEPTION_PROVIDER, di_1.provide(xhr_1.XHR, {useValue: new xhr_impl_1.XHRImpl()}), testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, forms_1.FORM_PROVIDERS]; + } + exports.applicationDomProviders = applicationDomProviders; + function platform(providers) { + return application_ref_1.platformCommon(providers, function() { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + wtf_init_1.wtfInit(); + browser_testability_1.BrowserGetTestability.init(); + }); + } + exports.platform = platform; + function commonBootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var p = platform(); + var bindings = [application_ref_1.applicationCommonProviders(), applicationDomProviders()]; + if (lang_1.isPresent(appProviders)) { + bindings.push(appProviders); + } + return p.application(bindings).bootstrap(appComponentType); + } + exports.commonBootstrap = commonBootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter"); + exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter; + exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/http/http", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/http/interfaces", "angular2/src/http/static_request", "angular2/src/http/base_request_options", "angular2/src/http/enums"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var interfaces_1 = require("angular2/src/http/interfaces"); + var static_request_1 = require("angular2/src/http/static_request"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var enums_1 = require("angular2/src/http/enums"); + function httpRequest(backend, request) { + return backend.createConnection(request).response; + } + function mergeOptions(defaultOpts, providedOpts, method, url) { + var newOptions = defaultOpts; + if (lang_1.isPresent(providedOpts)) { + newOptions = newOptions.merge(new base_request_options_1.RequestOptions({ + method: providedOpts.method, + url: providedOpts.url, + search: providedOpts.search, + headers: providedOpts.headers, + body: providedOpts.body + })); + } + if (lang_1.isPresent(method)) { + return newOptions.merge(new base_request_options_1.RequestOptions({ + method: method, + url: url + })); + } else { + return newOptions.merge(new base_request_options_1.RequestOptions({url: url})); + } + } + var Http = (function() { + function Http(_backend, _defaultOptions) { + this._backend = _backend; + this._defaultOptions = _defaultOptions; + } + Http.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + responseObservable = httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + } else if (url instanceof static_request_1.Request) { + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Http.prototype.get = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url))); + }; + Http.prototype.post = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Post, url))); + }; + Http.prototype.put = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Put, url))); + }; + Http.prototype.delete = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Delete, url))); + }; + Http.prototype.patch = function(url, body, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethods.Patch, url))); + }; + Http.prototype.head = function(url, options) { + return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Head, url))); + }; + Http = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Http); + return Http; + })(); + exports.Http = Http; + var Jsonp = (function(_super) { + __extends(Jsonp, _super); + function Jsonp(backend, defaultOptions) { + _super.call(this, backend, defaultOptions); + } + Jsonp.prototype.request = function(url, options) { + var responseObservable; + if (lang_1.isString(url)) { + url = new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethods.Get, url)); + } + if (url instanceof static_request_1.Request) { + if (url.method !== enums_1.RequestMethods.Get) { + exceptions_1.makeTypeError('JSONP requests must use GET request method.'); + } + responseObservable = httpRequest(this._backend, url); + } else { + throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); + } + return responseObservable; + }; + Jsonp = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Jsonp); + return Jsonp; + })(Http); + exports.Jsonp = Jsonp; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/proto_view_factory", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var compiler_1 = require("angular2/src/core/linker/compiler"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + var di_1 = require("angular2/src/core/di"); + var RuntimeCompiler = (function(_super) { + __extends(RuntimeCompiler, _super); + function RuntimeCompiler() { + _super.apply(this, arguments); + } + return RuntimeCompiler; + })(compiler_1.Compiler); + exports.RuntimeCompiler = RuntimeCompiler; + var RuntimeCompiler_ = (function(_super) { + __extends(RuntimeCompiler_, _super); + function RuntimeCompiler_(_protoViewFactory, _templateCompiler) { + _super.call(this, _protoViewFactory); + this._templateCompiler = _templateCompiler; + } + RuntimeCompiler_.prototype.compileInHost = function(componentType) { + var _this = this; + return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(compiledHostTemplate) { + return compiler_1.internalCreateProtoView(_this, compiledHostTemplate); + }); + }; + RuntimeCompiler_.prototype.clearCache = function() { + _super.prototype.clearCache.call(this); + this._templateCompiler.clearCache(); + }; + RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory, template_compiler_1.TemplateCompiler])], RuntimeCompiler_); + return RuntimeCompiler_; + })(compiler_1.Compiler_); + exports.RuntimeCompiler_ = RuntimeCompiler_; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/compiler/app_root_url", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + exports.TemplateCompiler = template_compiler_1.TemplateCompiler; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; + exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; + exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; + var source_module_1 = require("angular2/src/compiler/source_module"); + exports.SourceModule = source_module_1.SourceModule; + exports.SourceWithImports = source_module_1.SourceWithImports; + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; + exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_compiler_2 = require("angular2/src/compiler/template_compiler"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); + function compilerProviders() { + return [change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_1.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler, di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true)}), template_compiler_2.TemplateCompiler, di_1.provide(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), di_1.provide(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), url_resolver_1.UrlResolver]; + } + exports.compilerProviders = compilerProviders; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application", ["angular2/src/facade/lang", "angular2/src/compiler/compiler", "angular2/src/core/application_common", "angular2/src/core/application_tokens", "angular2/src/core/application_common", "angular2/src/core/application_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var application_common_1 = require("angular2/src/core/application_common"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT; + exports.APP_ID = application_tokens_1.APP_ID; + var application_common_2 = require("angular2/src/core/application_common"); + exports.platform = application_common_2.platform; + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.PlatformRef = application_ref_1.PlatformRef; + exports.ApplicationRef = application_ref_1.ApplicationRef; + exports.applicationCommonProviders = application_ref_1.applicationCommonProviders; + exports.createNgZone = application_ref_1.createNgZone; + exports.platformCommon = application_ref_1.platformCommon; + exports.platformProviders = application_ref_1.platformProviders; + function bootstrap(appComponentType, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var providers = [compiler_1.compilerProviders()]; + if (lang_1.isPresent(appProviders)) { + providers.push(appProviders); + } + return application_common_1.commonBootstrap(appComponentType, providers); + } + exports.bootstrap = bootstrap; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/di", "angular2/src/common/pipes", "angular2/src/facade/facade", "angular2/src/core/application", "angular2/src/core/bootstrap", "angular2/src/core/services", "angular2/src/core/linker", "angular2/src/core/application_ref", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/core/debug", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/dev_mode"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/metadata")); + __export(require("angular2/src/core/util")); + __export(require("angular2/src/core/di")); + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/application")); + __export(require("angular2/src/core/bootstrap")); + __export(require("angular2/src/core/services")); + __export(require("angular2/src/core/linker")); + var application_ref_1 = require("angular2/src/core/application_ref"); + exports.ApplicationRef = application_ref_1.ApplicationRef; + __export(require("angular2/src/core/zone")); + __export(require("angular2/src/core/render")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/core/debug")); + __export(require("angular2/src/core/change_detection")); + __export(require("angular2/src/core/platform_directives_and_pipes")); + __export(require("angular2/src/core/dev_mode")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/angular2", ["angular2/common", "angular2/core", "angular2/profile", "angular2/lifecycle_hooks", "angular2/bootstrap", "angular2/upgrade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/common")); + __export(require("angular2/core")); + __export(require("angular2/profile")); + __export(require("angular2/lifecycle_hooks")); + __export(require("angular2/bootstrap")); + __export(require("angular2/upgrade")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/http", ["angular2/angular2", "angular2/src/http/http", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/backends/browser_xhr", "angular2/src/http/backends/browser_jsonp", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/mock_backend", "angular2/src/http/static_request", "angular2/src/http/static_response", "angular2/src/http/interfaces", "angular2/src/http/backends/browser_xhr", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/http", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/src/http/url_search_params"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var angular2_1 = require("angular2/angular2"); + var http_1 = require("angular2/src/http/http"); + var xhr_backend_1 = require("angular2/src/http/backends/xhr_backend"); + var jsonp_backend_1 = require("angular2/src/http/backends/jsonp_backend"); + var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); + var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); + var base_request_options_1 = require("angular2/src/http/base_request_options"); + var base_response_options_1 = require("angular2/src/http/base_response_options"); + var mock_backend_1 = require("angular2/src/http/backends/mock_backend"); + exports.MockConnection = mock_backend_1.MockConnection; + exports.MockBackend = mock_backend_1.MockBackend; + var static_request_1 = require("angular2/src/http/static_request"); + exports.Request = static_request_1.Request; + var static_response_1 = require("angular2/src/http/static_response"); + exports.Response = static_response_1.Response; + var interfaces_1 = require("angular2/src/http/interfaces"); + exports.Connection = interfaces_1.Connection; + exports.ConnectionBackend = interfaces_1.ConnectionBackend; + var browser_xhr_2 = require("angular2/src/http/backends/browser_xhr"); + exports.BrowserXhr = browser_xhr_2.BrowserXhr; + var base_request_options_2 = require("angular2/src/http/base_request_options"); + exports.BaseRequestOptions = base_request_options_2.BaseRequestOptions; + exports.RequestOptions = base_request_options_2.RequestOptions; + var base_response_options_2 = require("angular2/src/http/base_response_options"); + exports.BaseResponseOptions = base_response_options_2.BaseResponseOptions; + exports.ResponseOptions = base_response_options_2.ResponseOptions; + var xhr_backend_2 = require("angular2/src/http/backends/xhr_backend"); + exports.XHRBackend = xhr_backend_2.XHRBackend; + exports.XHRConnection = xhr_backend_2.XHRConnection; + var jsonp_backend_2 = require("angular2/src/http/backends/jsonp_backend"); + exports.JSONPBackend = jsonp_backend_2.JSONPBackend; + exports.JSONPConnection = jsonp_backend_2.JSONPConnection; + var http_2 = require("angular2/src/http/http"); + exports.Http = http_2.Http; + exports.Jsonp = http_2.Jsonp; + var headers_1 = require("angular2/src/http/headers"); + exports.Headers = headers_1.Headers; + var enums_1 = require("angular2/src/http/enums"); + exports.ResponseTypes = enums_1.ResponseTypes; + exports.ReadyStates = enums_1.ReadyStates; + exports.RequestMethods = enums_1.RequestMethods; + var url_search_params_1 = require("angular2/src/http/url_search_params"); + exports.URLSearchParams = url_search_params_1.URLSearchParams; + exports.HTTP_PROVIDERS = [angular2_1.provide(http_1.Http, { + useFactory: function(xhrBackend, requestOptions) { + return new http_1.Http(xhrBackend, requestOptions); + }, + deps: [xhr_backend_1.XHRBackend, base_request_options_1.RequestOptions] + }), browser_xhr_1.BrowserXhr, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), xhr_backend_1.XHRBackend]; + exports.HTTP_BINDINGS = exports.HTTP_PROVIDERS; + exports.JSONP_PROVIDERS = [angular2_1.provide(http_1.Jsonp, { + useFactory: function(jsonpBackend, requestOptions) { + return new http_1.Jsonp(jsonpBackend, requestOptions); + }, + deps: [jsonp_backend_1.JSONPBackend, base_request_options_1.RequestOptions] + }), browser_jsonp_1.BrowserJsonp, angular2_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), angular2_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), angular2_1.provide(jsonp_backend_1.JSONPBackend, {useClass: jsonp_backend_1.JSONPBackend_})]; + exports.JSON_BINDINGS = exports.JSONP_PROVIDERS; + global.define = __define; + return module.exports; +}); + +}); +//# sourceMappingURLDisabled=http.sfx.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/router.dev.js b/2.0.0-alpha.46/router.dev.js new file mode 100644 index 0000000000..2cabd4f3bd --- /dev/null +++ b/2.0.0-alpha.46/router.dev.js @@ -0,0 +1,2411 @@ +"format register"; +System.register("angular2/src/router/instruction", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var RouteParams = (function() { + function RouteParams(params) { + this.params = params; + } + RouteParams.prototype.get = function(param) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.params, param)); + }; + return RouteParams; + })(); + exports.RouteParams = RouteParams; + var RouteData = (function() { + function RouteData(data) { + if (data === void 0) { + data = lang_1.CONST_EXPR({}); + } + this.data = data; + } + RouteData.prototype.get = function(key) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.data, key)); + }; + return RouteData; + })(); + exports.RouteData = RouteData; + var BLANK_ROUTE_DATA = new RouteData(); + var Instruction = (function() { + function Instruction(component, child, auxInstruction) { + this.component = component; + this.child = child; + this.auxInstruction = auxInstruction; + } + Instruction.prototype.replaceChild = function(child) { + return new Instruction(this.component, child, this.auxInstruction); + }; + return Instruction; + })(); + exports.Instruction = Instruction; + var PrimaryInstruction = (function() { + function PrimaryInstruction(component, child, auxUrls) { + this.component = component; + this.child = child; + this.auxUrls = auxUrls; + } + return PrimaryInstruction; + })(); + exports.PrimaryInstruction = PrimaryInstruction; + function stringifyInstruction(instruction) { + return stringifyInstructionPath(instruction) + stringifyInstructionQuery(instruction); + } + exports.stringifyInstruction = stringifyInstruction; + function stringifyInstructionPath(instruction) { + return instruction.component.urlPath + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + exports.stringifyInstructionPath = stringifyInstructionPath; + function stringifyInstructionQuery(instruction) { + return instruction.component.urlParams.length > 0 ? ('?' + instruction.component.urlParams.join('&')) : ''; + } + exports.stringifyInstructionQuery = stringifyInstructionQuery; + function stringifyPrimaryPrefixed(instruction) { + var primary = stringifyPrimary(instruction); + if (primary.length > 0) { + primary = '/' + primary; + } + return primary; + } + function stringifyPrimary(instruction) { + if (lang_1.isBlank(instruction)) { + return ''; + } + var params = instruction.component.urlParams.length > 0 ? (';' + instruction.component.urlParams.join(';')) : ''; + return instruction.component.urlPath + params + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + function stringifyAux(instruction) { + var routes = []; + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(auxInstruction, _) { + routes.push(stringifyPrimary(auxInstruction)); + }); + if (routes.length > 0) { + return '(' + routes.join('//') + ')'; + } + return ''; + } + var ComponentInstruction = (function() { + function ComponentInstruction() { + this.reuse = false; + } + Object.defineProperty(ComponentInstruction.prototype, "componentType", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "specificity", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "terminal", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "routeData", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ComponentInstruction; + })(); + exports.ComponentInstruction = ComponentInstruction; + var ComponentInstruction_ = (function(_super) { + __extends(ComponentInstruction_, _super); + function ComponentInstruction_(urlPath, urlParams, _recognizer, params) { + if (params === void 0) { + params = null; + } + _super.call(this); + this._recognizer = _recognizer; + this.urlPath = urlPath; + this.urlParams = urlParams; + this.params = params; + if (lang_1.isPresent(this._recognizer.handler.data)) { + this._routeData = new RouteData(this._recognizer.handler.data); + } else { + this._routeData = BLANK_ROUTE_DATA; + } + } + Object.defineProperty(ComponentInstruction_.prototype, "componentType", { + get: function() { + return this._recognizer.handler.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentInstruction_.prototype.resolveComponentType = function() { + return this._recognizer.handler.resolveComponentType(); + }; + Object.defineProperty(ComponentInstruction_.prototype, "specificity", { + get: function() { + return this._recognizer.specificity; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "terminal", { + get: function() { + return this._recognizer.terminal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "routeData", { + get: function() { + return this._routeData; + }, + enumerable: true, + configurable: true + }); + return ComponentInstruction_; + })(ComponentInstruction); + exports.ComponentInstruction_ = ComponentInstruction_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteLifecycleHook = (function() { + function RouteLifecycleHook(name) { + this.name = name; + } + RouteLifecycleHook = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], RouteLifecycleHook); + return RouteLifecycleHook; + })(); + exports.RouteLifecycleHook = RouteLifecycleHook; + var CanActivate = (function() { + function CanActivate(fn) { + this.fn = fn; + } + CanActivate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Function])], CanActivate); + return CanActivate; + })(); + exports.CanActivate = CanActivate; + exports.canReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("canReuse")); + exports.canDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("canDeactivate")); + exports.onActivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onActivate")); + exports.onReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("onReuse")); + exports.onDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onDeactivate")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations", ["angular2/src/core/util/decorators", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/router/lifecycle_annotations_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var lifecycle_annotations_impl_2 = require("angular2/src/router/lifecycle_annotations_impl"); + exports.canReuse = lifecycle_annotations_impl_2.canReuse; + exports.canDeactivate = lifecycle_annotations_impl_2.canDeactivate; + exports.onActivate = lifecycle_annotations_impl_2.onActivate; + exports.onReuse = lifecycle_annotations_impl_2.onReuse; + exports.onDeactivate = lifecycle_annotations_impl_2.onDeactivate; + exports.CanActivate = decorators_1.makeDecorator(lifecycle_annotations_impl_1.CanActivate); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location_strategy", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var LocationStrategy = (function() { + function LocationStrategy() {} + return LocationStrategy; + })(); + exports.LocationStrategy = LocationStrategy; + function normalizeQueryParams(params) { + return (params.length > 0 && params.substring(0, 1) != '?') ? ('?' + params) : params; + } + exports.normalizeQueryParams = normalizeQueryParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/url_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Url = (function() { + function Url(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + this.path = path; + this.child = child; + this.auxiliary = auxiliary; + this.params = params; + } + Url.prototype.toString = function() { + return this.path + this._matrixParamsToString() + this._auxToString() + this._childString(); + }; + Url.prototype.segmentToString = function() { + return this.path + this._matrixParamsToString(); + }; + Url.prototype._auxToString = function() { + return this.auxiliary.length > 0 ? ('(' + this.auxiliary.map(function(sibling) { + return sibling.toString(); + }).join('//') + ')') : ''; + }; + Url.prototype._matrixParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return ';' + serializeParams(this.params).join(';'); + }; + Url.prototype._childString = function() { + return lang_1.isPresent(this.child) ? ('/' + this.child.toString()) : ''; + }; + return Url; + })(); + exports.Url = Url; + var RootUrl = (function(_super) { + __extends(RootUrl, _super); + function RootUrl(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + _super.call(this, path, child, auxiliary, params); + } + RootUrl.prototype.toString = function() { + return this.path + this._auxToString() + this._childString() + this._queryParamsToString(); + }; + RootUrl.prototype.segmentToString = function() { + return this.path + this._queryParamsToString(); + }; + RootUrl.prototype._queryParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return '?' + serializeParams(this.params).join('&'); + }; + return RootUrl; + })(Url); + exports.RootUrl = RootUrl; + function pathSegmentsToUrl(pathSegments) { + var url = new Url(pathSegments[pathSegments.length - 1]); + for (var i = pathSegments.length - 2; i >= 0; i -= 1) { + url = new Url(pathSegments[i], url); + } + return url; + } + exports.pathSegmentsToUrl = pathSegmentsToUrl; + var SEGMENT_RE = lang_1.RegExpWrapper.create('^[^\\/\\(\\)\\?;=&#]+'); + function matchUrlSegment(str) { + var match = lang_1.RegExpWrapper.firstMatch(SEGMENT_RE, str); + return lang_1.isPresent(match) ? match[0] : ''; + } + var UrlParser = (function() { + function UrlParser() {} + UrlParser.prototype.peekStartsWith = function(str) { + return this._remaining.startsWith(str); + }; + UrlParser.prototype.capture = function(str) { + if (!this._remaining.startsWith(str)) { + throw new exceptions_1.BaseException("Expected \"" + str + "\"."); + } + this._remaining = this._remaining.substring(str.length); + }; + UrlParser.prototype.parse = function(url) { + this._remaining = url; + if (url == '' || url == '/') { + return new Url(''); + } + return this.parseRoot(); + }; + UrlParser.prototype.parseRoot = function() { + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + if (this.peekStartsWith(';')) { + this.parseMatrixParams(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + var queryParams = null; + if (this.peekStartsWith('?')) { + queryParams = this.parseQueryParams(); + } + return new RootUrl(path, child, aux, queryParams); + }; + UrlParser.prototype.parseSegment = function() { + if (this._remaining.length == 0) { + return null; + } + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var matrixParams = null; + if (this.peekStartsWith(';')) { + matrixParams = this.parseMatrixParams(); + } + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + return new Url(path, child, aux, matrixParams); + }; + UrlParser.prototype.parseQueryParams = function() { + var params = {}; + this.capture('?'); + this.parseParam(params); + while (this._remaining.length > 0 && this.peekStartsWith('&')) { + this.capture('&'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseMatrixParams = function() { + var params = {}; + while (this._remaining.length > 0 && this.peekStartsWith(';')) { + this.capture(';'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseParam = function(params) { + var key = matchUrlSegment(this._remaining); + if (lang_1.isBlank(key)) { + return ; + } + this.capture(key); + var value = true; + if (this.peekStartsWith('=')) { + this.capture('='); + var valueMatch = matchUrlSegment(this._remaining); + if (lang_1.isPresent(valueMatch)) { + value = valueMatch; + this.capture(value); + } + } + params[key] = value; + }; + UrlParser.prototype.parseAuxiliaryRoutes = function() { + var routes = []; + this.capture('('); + while (!this.peekStartsWith(')') && this._remaining.length > 0) { + routes.push(this.parseSegment()); + if (this.peekStartsWith('//')) { + this.capture('//'); + } + } + this.capture(')'); + return routes; + }; + return UrlParser; + })(); + exports.UrlParser = UrlParser; + exports.parser = new UrlParser(); + function serializeParams(paramMap) { + var params = []; + if (lang_1.isPresent(paramMap)) { + collection_1.StringMapWrapper.forEach(paramMap, function(value, key) { + if (value == true) { + params.push(key); + } else { + params.push(key + '=' + value); + } + }); + } + return params; + } + exports.serializeParams = serializeParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteConfig = (function() { + function RouteConfig(configs) { + this.configs = configs; + } + RouteConfig = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array])], RouteConfig); + return RouteConfig; + })(); + exports.RouteConfig = RouteConfig; + var Route = (function() { + function Route(_a) { + var path = _a.path, + component = _a.component, + name = _a.name, + data = _a.data; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + this.data = data; + } + Route = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Route); + return Route; + })(); + exports.Route = Route; + var AuxRoute = (function() { + function AuxRoute(_a) { + var path = _a.path, + component = _a.component, + name = _a.name; + this.data = null; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + } + AuxRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AuxRoute); + return AuxRoute; + })(); + exports.AuxRoute = AuxRoute; + var AsyncRoute = (function() { + function AsyncRoute(_a) { + var path = _a.path, + loader = _a.loader, + name = _a.name, + data = _a.data; + this.aux = null; + this.path = path; + this.loader = loader; + this.name = name; + this.data = data; + } + AsyncRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AsyncRoute); + return AsyncRoute; + })(); + exports.AsyncRoute = AsyncRoute; + var Redirect = (function() { + function Redirect(_a) { + var path = _a.path, + redirectTo = _a.redirectTo; + this.name = null; + this.loader = null; + this.data = null; + this.aux = null; + this.path = path; + this.redirectTo = redirectTo; + } + Redirect = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Redirect); + return Redirect; + })(); + exports.Redirect = Redirect; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/async_route_handler", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var AsyncRouteHandler = (function() { + function AsyncRouteHandler(_loader, data) { + this._loader = _loader; + this.data = data; + this._resolvedComponent = null; + } + AsyncRouteHandler.prototype.resolveComponentType = function() { + var _this = this; + if (lang_1.isPresent(this._resolvedComponent)) { + return this._resolvedComponent; + } + return this._resolvedComponent = this._loader().then(function(componentType) { + _this.componentType = componentType; + return componentType; + }); + }; + return AsyncRouteHandler; + })(); + exports.AsyncRouteHandler = AsyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/sync_route_handler", ["angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_1 = require("angular2/src/facade/async"); + var SyncRouteHandler = (function() { + function SyncRouteHandler(componentType, data) { + this.componentType = componentType; + this.data = data; + this._resolvedComponent = null; + this._resolvedComponent = async_1.PromiseWrapper.resolve(componentType); + } + SyncRouteHandler.prototype.resolveComponentType = function() { + return this._resolvedComponent; + }; + return SyncRouteHandler; + })(); + exports.SyncRouteHandler = SyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_decorator", ["angular2/src/router/route_config_impl", "angular2/src/core/util/decorators", "angular2/src/router/route_config_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var decorators_1 = require("angular2/src/core/util/decorators"); + var route_config_impl_2 = require("angular2/src/router/route_config_impl"); + exports.Route = route_config_impl_2.Route; + exports.Redirect = route_config_impl_2.Redirect; + exports.AuxRoute = route_config_impl_2.AuxRoute; + exports.AsyncRoute = route_config_impl_2.AsyncRoute; + exports.RouteConfig = decorators_1.makeDecorator(route_config_impl_1.RouteConfig); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/hash_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var HashLocationStrategy = (function(_super) { + __extends(HashLocationStrategy, _super); + function HashLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + } + HashLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + }; + HashLocationStrategy.prototype.getBaseHref = function() { + return ''; + }; + HashLocationStrategy.prototype.path = function() { + var path = this._location.hash; + return (path.length > 0 ? path.substring(1) : path) + location_strategy_1.normalizeQueryParams(this._location.search); + }; + HashLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return internal.length > 0 ? ('#' + internal) : internal; + }; + HashLocationStrategy.prototype.pushState = function(state, title, path, queryParams) { + var url = path + location_strategy_1.normalizeQueryParams(queryParams); + if (url.length == 0) { + url = this._location.pathname; + } else { + url = this.prepareExternalUrl(url); + } + this._history.pushState(state, title, url); + }; + HashLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + HashLocationStrategy.prototype.back = function() { + this._history.back(); + }; + HashLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], HashLocationStrategy); + return HashLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.HashLocationStrategy = HashLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var PathLocationStrategy = (function(_super) { + __extends(PathLocationStrategy, _super); + function PathLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + this._baseHref = dom_adapter_1.DOM.getBaseHref(); + } + PathLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('hashchange', fn, false); + }; + PathLocationStrategy.prototype.getBaseHref = function() { + return this._baseHref; + }; + PathLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return this._baseHref + internal; + }; + PathLocationStrategy.prototype.path = function() { + return this._location.pathname + location_strategy_1.normalizeQueryParams(this._location.search); + }; + PathLocationStrategy.prototype.pushState = function(state, title, url, queryParams) { + this._history.pushState(state, title, (url + location_strategy_1.normalizeQueryParams(queryParams))); + }; + PathLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + PathLocationStrategy.prototype.back = function() { + this._history.back(); + }; + PathLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], PathLocationStrategy); + return PathLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.PathLocationStrategy = PathLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_definition", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location", ["angular2/src/router/location_strategy", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var lang_2 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + exports.APP_BASE_HREF = lang_1.CONST_EXPR(new angular2_1.OpaqueToken('appBaseHref')); + var Location = (function() { + function Location(platformStrategy, href) { + var _this = this; + this.platformStrategy = platformStrategy; + this._subject = new async_1.EventEmitter(); + var browserBaseHref = lang_1.isPresent(href) ? href : this.platformStrategy.getBaseHref(); + if (lang_2.isBlank(browserBaseHref)) { + throw new exceptions_1.BaseException("No base href set. Either provide a provider for the APP_BASE_HREF token or add a base element to the document."); + } + this._baseHref = stripTrailingSlash(stripIndexHtml(browserBaseHref)); + this.platformStrategy.onPopState(function(_) { + async_1.ObservableWrapper.callNext(_this._subject, { + 'url': _this.path(), + 'pop': true + }); + }); + } + Location.prototype.path = function() { + return this.normalize(this.platformStrategy.path()); + }; + Location.prototype.normalize = function(url) { + return stripTrailingSlash(_stripBaseHref(this._baseHref, stripIndexHtml(url))); + }; + Location.prototype.prepareExternalUrl = function(url) { + if (!url.startsWith('/')) { + url = '/' + url; + } + return this.platformStrategy.prepareExternalUrl(stripTrailingSlash(_addBaseHref(this._baseHref, url))); + }; + Location.prototype.go = function(path, query) { + if (query === void 0) { + query = ''; + } + this.platformStrategy.pushState(null, '', path, query); + }; + Location.prototype.forward = function() { + this.platformStrategy.forward(); + }; + Location.prototype.back = function() { + this.platformStrategy.back(); + }; + Location.prototype.subscribe = function(onNext, onThrow, onReturn) { + if (onThrow === void 0) { + onThrow = null; + } + if (onReturn === void 0) { + onReturn = null; + } + return async_1.ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn); + }; + Location = __decorate([angular2_1.Injectable(), __param(1, angular2_1.Optional()), __param(1, angular2_1.Inject(exports.APP_BASE_HREF)), __metadata('design:paramtypes', [location_strategy_1.LocationStrategy, String])], Location); + return Location; + })(); + exports.Location = Location; + function _stripBaseHref(baseHref, url) { + if (baseHref.length > 0 && url.startsWith(baseHref)) { + return url.substring(baseHref.length); + } + return url; + } + function _addBaseHref(baseHref, url) { + if (!url.startsWith(baseHref)) { + return baseHref + url; + } + return url; + } + function stripIndexHtml(url) { + if (/\/index.html$/g.test(url)) { + return url.substring(0, url.length - 11); + } + return url; + } + function stripTrailingSlash(url) { + if (/\/$/g.test(url)) { + url = url.substring(0, url.length - 1); + } + return url; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/url_parser", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var instruction_1 = require("angular2/src/router/instruction"); + var TouchMap = (function() { + function TouchMap(map) { + var _this = this; + this.map = {}; + this.keys = {}; + if (lang_1.isPresent(map)) { + collection_1.StringMapWrapper.forEach(map, function(value, key) { + _this.map[key] = lang_1.isPresent(value) ? value.toString() : null; + _this.keys[key] = true; + }); + } + } + TouchMap.prototype.get = function(key) { + collection_1.StringMapWrapper.delete(this.keys, key); + return this.map[key]; + }; + TouchMap.prototype.getUnused = function() { + var _this = this; + var unused = collection_1.StringMapWrapper.create(); + var keys = collection_1.StringMapWrapper.keys(this.keys); + keys.forEach(function(key) { + return unused[key] = collection_1.StringMapWrapper.get(_this.map, key); + }); + return unused; + }; + return TouchMap; + })(); + function normalizeString(obj) { + if (lang_1.isBlank(obj)) { + return null; + } else { + return obj.toString(); + } + } + var ContinuationSegment = (function() { + function ContinuationSegment() { + this.name = ''; + } + ContinuationSegment.prototype.generate = function(params) { + return ''; + }; + ContinuationSegment.prototype.match = function(path) { + return true; + }; + return ContinuationSegment; + })(); + var StaticSegment = (function() { + function StaticSegment(path) { + this.path = path; + this.name = ''; + } + StaticSegment.prototype.match = function(path) { + return path == this.path; + }; + StaticSegment.prototype.generate = function(params) { + return this.path; + }; + return StaticSegment; + })(); + var DynamicSegment = (function() { + function DynamicSegment(name) { + this.name = name; + } + DynamicSegment.prototype.match = function(path) { + return path.length > 0; + }; + DynamicSegment.prototype.generate = function(params) { + if (!collection_1.StringMapWrapper.contains(params.map, this.name)) { + throw new exceptions_1.BaseException("Route generator for '" + this.name + "' was not included in parameters passed."); + } + return normalizeString(params.get(this.name)); + }; + return DynamicSegment; + })(); + var StarSegment = (function() { + function StarSegment(name) { + this.name = name; + } + StarSegment.prototype.match = function(path) { + return true; + }; + StarSegment.prototype.generate = function(params) { + return normalizeString(params.get(this.name)); + }; + return StarSegment; + })(); + var paramMatcher = /^:([^\/]+)$/g; + var wildcardMatcher = /^\*([^\/]+)$/g; + function parsePathString(route) { + if (route.startsWith("/")) { + route = route.substring(1); + } + var segments = splitBySlash(route); + var results = []; + var specificity = 0; + if (segments.length > 98) { + throw new exceptions_1.BaseException("'" + route + "' has more than the maximum supported number of segments."); + } + var limit = segments.length - 1; + for (var i = 0; i <= limit; i++) { + var segment = segments[i], + match; + if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(paramMatcher, segment))) { + results.push(new DynamicSegment(match[1])); + specificity += (100 - i); + } else if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(wildcardMatcher, segment))) { + results.push(new StarSegment(match[1])); + } else if (segment == '...') { + if (i < limit) { + throw new exceptions_1.BaseException("Unexpected \"...\" before the end of the path for \"" + route + "\"."); + } + results.push(new ContinuationSegment()); + } else { + results.push(new StaticSegment(segment)); + specificity += 100 * (100 - i); + } + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'segments', results); + collection_1.StringMapWrapper.set(result, 'specificity', specificity); + return result; + } + function pathDslHash(segments) { + return segments.map(function(segment) { + if (segment instanceof StarSegment) { + return '*'; + } else if (segment instanceof ContinuationSegment) { + return '...'; + } else if (segment instanceof DynamicSegment) { + return ':'; + } else if (segment instanceof StaticSegment) { + return segment.path; + } + }).join('/'); + } + function splitBySlash(url) { + return url.split('/'); + } + var RESERVED_CHARS = lang_1.RegExpWrapper.create('//|\\(|\\)|;|\\?|='); + function assertPath(path) { + if (lang_1.StringWrapper.contains(path, '#')) { + throw new exceptions_1.BaseException("Path \"" + path + "\" should not include \"#\". Use \"HashLocationStrategy\" instead."); + } + var illegalCharacter = lang_1.RegExpWrapper.firstMatch(RESERVED_CHARS, path); + if (lang_1.isPresent(illegalCharacter)) { + throw new exceptions_1.BaseException("Path \"" + path + "\" contains \"" + illegalCharacter[0] + "\" which is not allowed in a route config."); + } + } + var PathMatch = (function() { + function PathMatch(instruction, remaining, remainingAux) { + this.instruction = instruction; + this.remaining = remaining; + this.remainingAux = remainingAux; + } + return PathMatch; + })(); + exports.PathMatch = PathMatch; + var PathRecognizer = (function() { + function PathRecognizer(path, handler) { + this.path = path; + this.handler = handler; + this.terminal = true; + this._cache = new collection_1.Map(); + assertPath(path); + var parsed = parsePathString(path); + this._segments = parsed['segments']; + this.specificity = parsed['specificity']; + this.hash = pathDslHash(this._segments); + var lastSegment = this._segments[this._segments.length - 1]; + this.terminal = !(lastSegment instanceof ContinuationSegment); + } + PathRecognizer.prototype.recognize = function(beginningSegment) { + var nextSegment = beginningSegment; + var currentSegment; + var positionalParams = {}; + var captured = []; + for (var i = 0; i < this._segments.length; i += 1) { + var segment = this._segments[i]; + currentSegment = nextSegment; + if (segment instanceof ContinuationSegment) { + break; + } + if (lang_1.isPresent(currentSegment)) { + captured.push(currentSegment.path); + if (segment instanceof StarSegment) { + positionalParams[segment.name] = currentSegment.toString(); + nextSegment = null; + break; + } + if (segment instanceof DynamicSegment) { + positionalParams[segment.name] = currentSegment.path; + } else if (!segment.match(currentSegment.path)) { + return null; + } + nextSegment = currentSegment.child; + } else if (!segment.match('')) { + return null; + } + } + if (this.terminal && lang_1.isPresent(nextSegment)) { + return null; + } + var urlPath = captured.join('/'); + var auxiliary; + var instruction; + var urlParams; + var allParams; + if (lang_1.isPresent(currentSegment)) { + var paramsSegment = beginningSegment instanceof url_parser_1.RootUrl ? beginningSegment : currentSegment; + allParams = lang_1.isPresent(paramsSegment.params) ? collection_1.StringMapWrapper.merge(paramsSegment.params, positionalParams) : positionalParams; + urlParams = url_parser_1.serializeParams(paramsSegment.params); + auxiliary = currentSegment.auxiliary; + } else { + allParams = positionalParams; + auxiliary = []; + urlParams = []; + } + instruction = this._getInstruction(urlPath, urlParams, this, allParams); + return new PathMatch(instruction, nextSegment, auxiliary); + }; + PathRecognizer.prototype.generate = function(params) { + var paramTokens = new TouchMap(params); + var path = []; + for (var i = 0; i < this._segments.length; i++) { + var segment = this._segments[i]; + if (!(segment instanceof ContinuationSegment)) { + path.push(segment.generate(paramTokens)); + } + } + var urlPath = path.join('/'); + var nonPositionalParams = paramTokens.getUnused(); + var urlParams = url_parser_1.serializeParams(nonPositionalParams); + return this._getInstruction(urlPath, urlParams, this, params); + }; + PathRecognizer.prototype._getInstruction = function(urlPath, urlParams, _recognizer, params) { + var hashKey = urlPath + '?' + urlParams.join('?'); + if (this._cache.has(hashKey)) { + return this._cache.get(hashKey); + } + var instruction = new instruction_1.ComponentInstruction_(urlPath, urlParams, _recognizer, params); + this._cache.set(hashKey, instruction); + return instruction; + }; + return PathRecognizer; + })(); + exports.PathRecognizer = PathRecognizer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_nomalizer", ["angular2/src/router/route_config_decorator", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_decorator_1 = require("angular2/src/router/route_config_decorator"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeRouteConfig(config) { + if (config instanceof route_config_decorator_1.Route || config instanceof route_config_decorator_1.Redirect || config instanceof route_config_decorator_1.AsyncRoute || config instanceof route_config_decorator_1.AuxRoute) { + return config; + } + if ((+!!config.component) + (+!!config.redirectTo) + (+!!config.loader) != 1) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"component\", \"loader\", or \"redirectTo\" property."); + } + if (config.as && config.name) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"as\" or \"name\" property."); + } + if (config.as) { + config.name = config.as; + } + if (config.loader) { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: config.loader, + name: config.name + }); + } + if (config.aux) { + return new route_config_decorator_1.AuxRoute({ + path: config.aux, + component: config.component, + name: config.name + }); + } + if (config.component) { + if (typeof config.component == 'object') { + var componentDefinitionObject = config.component; + if (componentDefinitionObject.type == 'constructor') { + return new route_config_decorator_1.Route({ + path: config.path, + component: componentDefinitionObject.constructor, + name: config.name + }); + } else if (componentDefinitionObject.type == 'loader') { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: componentDefinitionObject.loader, + name: config.name + }); + } else { + throw new exceptions_1.BaseException("Invalid component type \"" + componentDefinitionObject.type + "\". Valid types are \"constructor\" and \"loader\"."); + } + } + return new route_config_decorator_1.Route(config); + } + if (config.redirectTo) { + return new route_config_decorator_1.Redirect({ + path: config.path, + redirectTo: config.redirectTo + }); + } + return config; + } + exports.normalizeRouteConfig = normalizeRouteConfig; + function assertComponentExists(component, path) { + if (!lang_1.isType(component)) { + throw new exceptions_1.BaseException("Component for route \"" + path + "\" is not defined, or is not a class."); + } + } + exports.assertComponentExists = assertComponentExists; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function hasLifecycleHook(e, type) { + if (!(type instanceof lang_1.Type)) + return false; + return e.name in type.prototype; + } + exports.hasLifecycleHook = hasLifecycleHook; + function getCanActivateHook(type) { + var annotations = reflection_1.reflector.annotations(type); + for (var i = 0; i < annotations.length; i += 1) { + var annotation = annotations[i]; + if (annotation instanceof lifecycle_annotations_impl_1.CanActivate) { + return annotation.fn; + } + } + return null; + } + exports.getCanActivateHook = getCanActivateHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_link", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/router/router", "angular2/src/router/location", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var router_1 = require("angular2/src/router/router"); + var location_1 = require("angular2/src/router/location"); + var instruction_1 = require("angular2/src/router/instruction"); + var RouterLink = (function() { + function RouterLink(_router, _location) { + this._router = _router; + this._location = _location; + } + Object.defineProperty(RouterLink.prototype, "isRouteActive", { + get: function() { + return this._router.isRouteActive(this._navigationInstruction); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RouterLink.prototype, "routeParams", { + set: function(changes) { + this._routeParams = changes; + this._navigationInstruction = this._router.generate(this._routeParams); + var navigationHref = instruction_1.stringifyInstruction(this._navigationInstruction); + this.visibleHref = this._location.prepareExternalUrl(navigationHref); + }, + enumerable: true, + configurable: true + }); + RouterLink.prototype.onClick = function() { + if (!lang_1.isString(this.target) || this.target == '_self') { + this._router.navigateByInstruction(this._navigationInstruction); + return false; + } + return true; + }; + RouterLink = __decorate([angular2_1.Directive({ + selector: '[router-link]', + inputs: ['routeParams: routerLink', 'target: target'], + host: { + '(click)': 'onClick()', + '[attr.href]': 'visibleHref', + '[class.router-link-active]': 'isRouteActive' + } + }), __metadata('design:paramtypes', [router_1.Router, location_1.Location])], RouterLink); + return RouterLink; + })(); + exports.RouterLink = RouterLink; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/path_recognizer", "angular2/src/router/route_config_impl", "angular2/src/router/async_route_handler", "angular2/src/router/sync_route_handler", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var path_recognizer_1 = require("angular2/src/router/path_recognizer"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var async_route_handler_1 = require("angular2/src/router/async_route_handler"); + var sync_route_handler_1 = require("angular2/src/router/sync_route_handler"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var RouteRecognizer = (function() { + function RouteRecognizer() { + this.names = new collection_1.Map(); + this.auxRoutes = new collection_1.Map(); + this.matchers = []; + this.redirects = []; + } + RouteRecognizer.prototype.config = function(config) { + var handler; + if (lang_1.isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) { + var suggestedName = config.name[0].toUpperCase() + config.name.substring(1); + throw new exceptions_1.BaseException("Route \"" + config.path + "\" with name \"" + config.name + "\" does not begin with an uppercase letter. Route names should be CamelCase like \"" + suggestedName + "\"."); + } + if (config instanceof route_config_impl_1.AuxRoute) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + var path = config.path.startsWith('/') ? config.path.substring(1) : config.path; + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.auxRoutes.set(path, recognizer); + return recognizer.terminal; + } + if (config instanceof route_config_impl_1.Redirect) { + this.redirects.push(new Redirector(config.path, config.redirectTo)); + return true; + } + if (config instanceof route_config_impl_1.Route) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + } else if (config instanceof route_config_impl_1.AsyncRoute) { + handler = new async_route_handler_1.AsyncRouteHandler(config.loader, config.data); + } + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.matchers.forEach(function(matcher) { + if (recognizer.hash == matcher.hash) { + throw new exceptions_1.BaseException("Configuration '" + config.path + "' conflicts with existing route '" + matcher.path + "'"); + } + }); + this.matchers.push(recognizer); + if (lang_1.isPresent(config.name)) { + this.names.set(config.name, recognizer); + } + return recognizer.terminal; + }; + RouteRecognizer.prototype.recognize = function(urlParse) { + var solutions = []; + urlParse = this._redirect(urlParse); + this.matchers.forEach(function(pathRecognizer) { + var pathMatch = pathRecognizer.recognize(urlParse); + if (lang_1.isPresent(pathMatch)) { + solutions.push(pathMatch); + } + }); + return solutions; + }; + RouteRecognizer.prototype._redirect = function(urlParse) { + for (var i = 0; i < this.redirects.length; i += 1) { + var redirector = this.redirects[i]; + var redirectedUrl = redirector.redirect(urlParse); + if (lang_1.isPresent(redirectedUrl)) { + return redirectedUrl; + } + } + return urlParse; + }; + RouteRecognizer.prototype.recognizeAuxiliary = function(urlParse) { + var pathRecognizer = this.auxRoutes.get(urlParse.path); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.recognize(urlParse); + }; + RouteRecognizer.prototype.hasRoute = function(name) { + return this.names.has(name); + }; + RouteRecognizer.prototype.generate = function(name, params) { + var pathRecognizer = this.names.get(name); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.generate(params); + }; + return RouteRecognizer; + })(); + exports.RouteRecognizer = RouteRecognizer; + var Redirector = (function() { + function Redirector(path, redirectTo) { + this.segments = []; + this.toSegments = []; + if (path.startsWith('/')) { + path = path.substring(1); + } + this.segments = path.split('/'); + if (redirectTo.startsWith('/')) { + redirectTo = redirectTo.substring(1); + } + this.toSegments = redirectTo.split('/'); + } + Redirector.prototype.redirect = function(urlParse) { + for (var i = 0; i < this.segments.length; i += 1) { + if (lang_1.isBlank(urlParse)) { + return null; + } + var segment = this.segments[i]; + if (segment != urlParse.path) { + return null; + } + urlParse = urlParse.child; + } + for (var i = this.toSegments.length - 1; i >= 0; i -= 1) { + var segment = this.toSegments[i]; + urlParse = new url_parser_1.Url(segment, urlParse); + } + return urlParse; + }; + return Redirector; + })(); + exports.Redirector = Redirector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_registry", ["angular2/src/router/route_recognizer", "angular2/src/router/instruction", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/route_config_impl", "angular2/src/core/reflection/reflection", "angular2/angular2", "angular2/src/router/route_config_nomalizer", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var route_recognizer_1 = require("angular2/src/router/route_recognizer"); + var instruction_1 = require("angular2/src/router/instruction"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var angular2_1 = require("angular2/angular2"); + var route_config_nomalizer_1 = require("angular2/src/router/route_config_nomalizer"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var _resolveToNull = async_1.PromiseWrapper.resolve(null); + var RouteRegistry = (function() { + function RouteRegistry() { + this._rules = new collection_1.Map(); + } + RouteRegistry.prototype.config = function(parentComponent, config) { + config = route_config_nomalizer_1.normalizeRouteConfig(config); + if (config instanceof route_config_impl_1.Route) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } else if (config instanceof route_config_impl_1.AuxRoute) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } + var recognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(recognizer)) { + recognizer = new route_recognizer_1.RouteRecognizer(); + this._rules.set(parentComponent, recognizer); + } + var terminal = recognizer.config(config); + if (config instanceof route_config_impl_1.Route) { + if (terminal) { + assertTerminalComponent(config.component, config.path); + } else { + this.configFromComponent(config.component); + } + } + }; + RouteRegistry.prototype.configFromComponent = function(component) { + var _this = this; + if (!lang_1.isType(component)) { + return ; + } + if (this._rules.has(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + var routeCfgs = annotation.configs; + routeCfgs.forEach(function(config) { + return _this.config(component, config); + }); + } + } + } + }; + RouteRegistry.prototype.recognize = function(url, parentComponent) { + var parsedUrl = url_parser_1.parser.parse(url); + return this._recognize(parsedUrl, parentComponent); + }; + RouteRegistry.prototype._recognize = function(parsedUrl, parentComponent) { + var _this = this; + return this._recognizePrimaryRoute(parsedUrl, parentComponent).then(function(instruction) { + return _this._completeAuxiliaryRouteMatches(instruction, parentComponent); + }); + }; + RouteRegistry.prototype._recognizePrimaryRoute = function(parsedUrl, parentComponent) { + var _this = this; + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return _resolveToNull; + } + var possibleMatches = componentRecognizer.recognize(parsedUrl); + var matchPromises = possibleMatches.map(function(candidate) { + return _this._completePrimaryRouteMatch(candidate); + }); + return async_1.PromiseWrapper.all(matchPromises).then(mostSpecific); + }; + RouteRegistry.prototype._completePrimaryRouteMatch = function(partialMatch) { + var _this = this; + var instruction = partialMatch.instruction; + return instruction.resolveComponentType().then(function(componentType) { + _this.configFromComponent(componentType); + if (instruction.terminal) { + return new instruction_1.PrimaryInstruction(instruction, null, partialMatch.remainingAux); + } + return _this._recognizePrimaryRoute(partialMatch.remaining, componentType).then(function(childInstruction) { + if (lang_1.isBlank(childInstruction)) { + return null; + } else { + return new instruction_1.PrimaryInstruction(instruction, childInstruction, partialMatch.remainingAux); + } + }); + }); + }; + RouteRegistry.prototype._completeAuxiliaryRouteMatches = function(instruction, parentComponent) { + var _this = this; + if (lang_1.isBlank(instruction)) { + return _resolveToNull; + } + var componentRecognizer = this._rules.get(parentComponent); + var auxInstructions = {}; + var promises = instruction.auxUrls.map(function(auxSegment) { + var match = componentRecognizer.recognizeAuxiliary(auxSegment); + if (lang_1.isBlank(match)) { + return _resolveToNull; + } + return _this._completePrimaryRouteMatch(match).then(function(auxInstruction) { + if (lang_1.isPresent(auxInstruction)) { + return _this._completeAuxiliaryRouteMatches(auxInstruction, parentComponent).then(function(finishedAuxRoute) { + auxInstructions[auxSegment.path] = finishedAuxRoute; + }); + } + }); + }); + return async_1.PromiseWrapper.all(promises).then(function(_) { + if (lang_1.isBlank(instruction.child)) { + return new instruction_1.Instruction(instruction.component, null, auxInstructions); + } + return _this._completeAuxiliaryRouteMatches(instruction.child, instruction.component.componentType).then(function(completeChild) { + return new instruction_1.Instruction(instruction.component, completeChild, auxInstructions); + }); + }); + }; + RouteRegistry.prototype.generate = function(linkParams, parentComponent) { + var segments = []; + var componentCursor = parentComponent; + var lastInstructionIsTerminal = false; + for (var i = 0; i < linkParams.length; i += 1) { + var segment = linkParams[i]; + if (lang_1.isBlank(componentCursor)) { + throw new exceptions_1.BaseException("Could not find route named \"" + segment + "\"."); + } + if (!lang_1.isString(segment)) { + throw new exceptions_1.BaseException("Unexpected segment \"" + segment + "\" in link DSL. Expected a string."); + } else if (segment == '' || segment == '.' || segment == '..') { + throw new exceptions_1.BaseException("\"" + segment + "/\" is only allowed at the beginning of a link DSL."); + } + var params = {}; + if (i + 1 < linkParams.length) { + var nextSegment = linkParams[i + 1]; + if (lang_1.isStringMap(nextSegment)) { + params = nextSegment; + i += 1; + } + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route config."); + } + var response = componentRecognizer.generate(segment, params); + if (lang_1.isBlank(response)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route named \"" + segment + "\"."); + } + segments.push(response); + componentCursor = response.componentType; + lastInstructionIsTerminal = response.terminal; + } + var instruction = null; + if (!lastInstructionIsTerminal) { + instruction = this._generateRedirects(componentCursor); + if (lang_1.isPresent(instruction)) { + var lastInstruction = instruction; + while (lang_1.isPresent(lastInstruction.child)) { + lastInstruction = lastInstruction.child; + } + lastInstructionIsTerminal = lastInstruction.component.terminal; + } + if (lang_1.isPresent(componentCursor) && !lastInstructionIsTerminal) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" does not resolve to a terminal or async instruction."); + } + } + while (segments.length > 0) { + instruction = new instruction_1.Instruction(segments.pop(), instruction, {}); + } + return instruction; + }; + RouteRegistry.prototype.hasRoute = function(name, parentComponent) { + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return false; + } + return componentRecognizer.hasRoute(name); + }; + RouteRegistry.prototype._generateRedirects = function(componentCursor) { + if (lang_1.isBlank(componentCursor)) { + return null; + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + return null; + } + for (var i = 0; i < componentRecognizer.redirects.length; i += 1) { + var redirect = componentRecognizer.redirects[i]; + if (redirect.segments.length == 1 && redirect.segments[0] == '') { + var toSegments = url_parser_1.pathSegmentsToUrl(redirect.toSegments); + var matches = componentRecognizer.recognize(toSegments); + var primaryInstruction = collection_1.ListWrapper.maximum(matches, function(match) { + return match.instruction.specificity; + }); + if (lang_1.isPresent(primaryInstruction)) { + var child = this._generateRedirects(primaryInstruction.instruction.componentType); + return new instruction_1.Instruction(primaryInstruction.instruction, child, {}); + } + return null; + } + } + return null; + }; + RouteRegistry = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], RouteRegistry); + return RouteRegistry; + })(); + exports.RouteRegistry = RouteRegistry; + function mostSpecific(instructions) { + return collection_1.ListWrapper.maximum(instructions, function(instruction) { + return instruction.component.specificity; + }); + } + function assertTerminalComponent(component, path) { + if (!lang_1.isType(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + throw new exceptions_1.BaseException("Child routes are not allowed for \"" + path + "\". Use \"...\" on the parent's route path."); + } + } + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/instruction", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var instruction_1 = require("angular2/src/router/instruction"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var _resolveToFalse = async_1.PromiseWrapper.resolve(false); + var Router = (function() { + function Router(registry, parent, hostComponent) { + this.registry = registry; + this.parent = parent; + this.hostComponent = hostComponent; + this.navigating = false; + this._currentInstruction = null; + this._currentNavigation = _resolveToTrue; + this._outlet = null; + this._auxRouters = new collection_1.Map(); + this._subject = new async_1.EventEmitter(); + } + Router.prototype.childRouter = function(hostComponent) { + return this._childRouter = new ChildRouter(this, hostComponent); + }; + Router.prototype.auxRouter = function(hostComponent) { + return new ChildRouter(this, hostComponent); + }; + Router.prototype.registerPrimaryOutlet = function(outlet) { + if (lang_1.isPresent(outlet.name)) { + throw new exceptions_1.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet."); + } + this._outlet = outlet; + if (lang_1.isPresent(this._currentInstruction)) { + return this.commit(this._currentInstruction, false); + } + return _resolveToTrue; + }; + Router.prototype.registerAuxOutlet = function(outlet) { + var outletName = outlet.name; + if (lang_1.isBlank(outletName)) { + throw new exceptions_1.BaseException("registerAuxOutlet expects to be called with an outlet with a name."); + } + var router = this.auxRouter(this.hostComponent); + this._auxRouters.set(outletName, router); + router._outlet = outlet; + var auxInstruction; + if (lang_1.isPresent(this._currentInstruction) && lang_1.isPresent(auxInstruction = this._currentInstruction.auxInstruction[outletName])) { + return router.commit(auxInstruction); + } + return _resolveToTrue; + }; + Router.prototype.isRouteActive = function(instruction) { + var router = this; + while (lang_1.isPresent(router.parent) && lang_1.isPresent(instruction.child)) { + router = router.parent; + instruction = instruction.child; + } + return lang_1.isPresent(this._currentInstruction) && this._currentInstruction.component == instruction.component; + }; + Router.prototype.config = function(definitions) { + var _this = this; + definitions.forEach(function(routeDefinition) { + _this.registry.config(_this.hostComponent, routeDefinition); + }); + return this.renavigate(); + }; + Router.prototype.navigate = function(linkParams) { + var instruction = this.generate(linkParams); + return this.navigateByInstruction(instruction, false); + }; + Router.prototype.navigateByUrl = function(url, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this.lastNavigationAttempt = url; + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this.recognize(url).then(function(instruction) { + if (lang_1.isBlank(instruction)) { + return false; + } + return _this._navigate(instruction, _skipLocationChange); + })); + }); + }; + Router.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + if (lang_1.isBlank(instruction)) { + return _resolveToFalse; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this._navigate(instruction, _skipLocationChange)); + }); + }; + Router.prototype._navigate = function(instruction, _skipLocationChange) { + var _this = this; + return this._settleInstruction(instruction).then(function(_) { + return _this._canReuse(instruction); + }).then(function(_) { + return _this._canActivate(instruction); + }).then(function(result) { + if (!result) { + return false; + } + return _this._canDeactivate(instruction).then(function(result) { + if (result) { + return _this.commit(instruction, _skipLocationChange).then(function(_) { + _this._emitNavigationFinish(instruction_1.stringifyInstruction(instruction)); + return true; + }); + } + }); + }); + }; + Router.prototype._settleInstruction = function(instruction) { + var _this = this; + var unsettledInstructions = []; + if (lang_1.isBlank(instruction.component.componentType)) { + unsettledInstructions.push(instruction.component.resolveComponentType().then(function(type) { + _this.registry.configFromComponent(type); + })); + } + if (lang_1.isPresent(instruction.child)) { + unsettledInstructions.push(this._settleInstruction(instruction.child)); + } + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(instruction, _) { + unsettledInstructions.push(_this._settleInstruction(instruction)); + }); + return async_1.PromiseWrapper.all(unsettledInstructions); + }; + Router.prototype._emitNavigationFinish = function(url) { + async_1.ObservableWrapper.callNext(this._subject, url); + }; + Router.prototype._afterPromiseFinishNavigating = function(promise) { + var _this = this; + return async_1.PromiseWrapper.catchError(promise.then(function(_) { + return _this._finishNavigating(); + }), function(err) { + _this._finishNavigating(); + throw err; + }); + }; + Router.prototype._canReuse = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToFalse; + } + return this._outlet.canReuse(instruction.component).then(function(result) { + instruction.component.reuse = result; + if (result && lang_1.isPresent(_this._childRouter) && lang_1.isPresent(instruction.child)) { + return _this._childRouter._canReuse(instruction.child); + } + }); + }; + Router.prototype._canActivate = function(nextInstruction) { + return canActivateOne(nextInstruction, this._currentInstruction); + }; + Router.prototype._canDeactivate = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToTrue; + } + var next; + var childInstruction = null; + var reuse = false; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + reuse = instruction.component.reuse; + } + if (reuse) { + next = _resolveToTrue; + } else { + next = this._outlet.canDeactivate(componentInstruction); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter._canDeactivate(childInstruction); + } + return true; + }); + }; + Router.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + this._currentInstruction = instruction; + var next = _resolveToTrue; + if (lang_1.isPresent(this._outlet)) { + var componentInstruction = instruction.component; + if (componentInstruction.reuse) { + next = this._outlet.reuse(componentInstruction); + } else { + next = this.deactivate(instruction).then(function(_) { + return _this._outlet.activate(componentInstruction); + }); + } + if (lang_1.isPresent(instruction.child)) { + next = next.then(function(_) { + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter.commit(instruction.child); + } + }); + } + } + var promises = []; + this._auxRouters.forEach(function(router, name) { + if (lang_1.isPresent(instruction.auxInstruction[name])) { + promises.push(router.commit(instruction.auxInstruction[name])); + } + }); + return next.then(function(_) { + return async_1.PromiseWrapper.all(promises); + }); + }; + Router.prototype._startNavigating = function() { + this.navigating = true; + }; + Router.prototype._finishNavigating = function() { + this.navigating = false; + }; + Router.prototype.subscribe = function(onNext) { + return async_1.ObservableWrapper.subscribe(this._subject, onNext); + }; + Router.prototype.deactivate = function(instruction) { + var _this = this; + var childInstruction = null; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + } + var next = _resolveToTrue; + if (lang_1.isPresent(this._childRouter)) { + next = this._childRouter.deactivate(childInstruction); + } + if (lang_1.isPresent(this._outlet)) { + next = next.then(function(_) { + return _this._outlet.deactivate(componentInstruction); + }); + } + return next; + }; + Router.prototype.recognize = function(url) { + return this.registry.recognize(url, this.hostComponent); + }; + Router.prototype.renavigate = function() { + if (lang_1.isBlank(this.lastNavigationAttempt)) { + return this._currentNavigation; + } + return this.navigateByUrl(this.lastNavigationAttempt); + }; + Router.prototype.generate = function(linkParams) { + var normalizedLinkParams = splitAndFlattenLinkParams(linkParams); + var first = collection_1.ListWrapper.first(normalizedLinkParams); + var rest = collection_1.ListWrapper.slice(normalizedLinkParams, 1); + var router = this; + if (first == '') { + while (lang_1.isPresent(router.parent)) { + router = router.parent; + } + } else if (first == '..') { + router = router.parent; + while (collection_1.ListWrapper.first(rest) == '..') { + rest = collection_1.ListWrapper.slice(rest, 1); + router = router.parent; + if (lang_1.isBlank(router)) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" has too many \"../\" segments."); + } + } + } else if (first != '.') { + var childRouteExists = this.registry.hasRoute(first, this.hostComponent); + var parentRouteExists = lang_1.isPresent(this.parent) && this.registry.hasRoute(first, this.parent.hostComponent); + if (parentRouteExists && childRouteExists) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" is ambiguous, use \"./\" or \"../\" to disambiguate."; + throw new exceptions_1.BaseException(msg); + } + if (parentRouteExists) { + router = this.parent; + } + rest = linkParams; + } + if (rest[rest.length - 1] == '') { + rest.pop(); + } + if (rest.length < 1) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" must include a route name."; + throw new exceptions_1.BaseException(msg); + } + var nextInstruction = this.registry.generate(rest, router.hostComponent); + var url = []; + var parent = router.parent; + while (lang_1.isPresent(parent)) { + url.unshift(parent._currentInstruction); + parent = parent.parent; + } + while (url.length > 0) { + nextInstruction = url.pop().replaceChild(nextInstruction); + } + return nextInstruction; + }; + return Router; + })(); + exports.Router = Router; + var RootRouter = (function(_super) { + __extends(RootRouter, _super); + function RootRouter(registry, location, primaryComponent) { + var _this = this; + _super.call(this, registry, null, primaryComponent); + this._location = location; + this._locationSub = this._location.subscribe(function(change) { + return _this.navigateByUrl(change['url'], lang_1.isPresent(change['pop'])); + }); + this.registry.configFromComponent(primaryComponent); + this.navigateByUrl(location.path()); + } + RootRouter.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + var emitPath = instruction_1.stringifyInstructionPath(instruction); + var emitQuery = instruction_1.stringifyInstructionQuery(instruction); + if (emitPath.length > 0) { + emitPath = '/' + emitPath; + } + var promise = _super.prototype.commit.call(this, instruction); + if (!_skipLocationChange) { + promise = promise.then(function(_) { + _this._location.go(emitPath, emitQuery); + }); + } + return promise; + }; + RootRouter.prototype.dispose = function() { + if (lang_1.isPresent(this._locationSub)) { + async_1.ObservableWrapper.dispose(this._locationSub); + this._locationSub = null; + } + }; + return RootRouter; + })(Router); + exports.RootRouter = RootRouter; + var ChildRouter = (function(_super) { + __extends(ChildRouter, _super); + function ChildRouter(parent, hostComponent) { + _super.call(this, parent.registry, parent, hostComponent); + this.parent = parent; + } + ChildRouter.prototype.navigateByUrl = function(url, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByUrl(url, _skipLocationChange); + }; + ChildRouter.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByInstruction(instruction, _skipLocationChange); + }; + return ChildRouter; + })(Router); + function splitAndFlattenLinkParams(linkParams) { + return linkParams.reduce(function(accumulation, item) { + if (lang_1.isString(item)) { + var strItem = item; + return accumulation.concat(strItem.split('/')); + } + accumulation.push(item); + return accumulation; + }, []); + } + function canActivateOne(nextInstruction, prevInstruction) { + var next = _resolveToTrue; + if (lang_1.isPresent(nextInstruction.child)) { + next = canActivateOne(nextInstruction.child, lang_1.isPresent(prevInstruction) ? prevInstruction.child : null); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (nextInstruction.component.reuse) { + return true; + } + var hook = route_lifecycle_reflector_1.getCanActivateHook(nextInstruction.component.componentType); + if (lang_1.isPresent(hook)) { + return hook(nextInstruction.component, lang_1.isPresent(prevInstruction) ? prevInstruction.component : null); + } + return true; + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_outlet", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/router/router", "angular2/src/router/instruction", "angular2/src/router/lifecycle_annotations", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var routerMod = require("angular2/src/router/router"); + var instruction_1 = require("angular2/src/router/instruction"); + var hookMod = require("angular2/src/router/lifecycle_annotations"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var RouterOutlet = (function() { + function RouterOutlet(_elementRef, _loader, _parentRouter, nameAttr) { + this._elementRef = _elementRef; + this._loader = _loader; + this._parentRouter = _parentRouter; + this.name = null; + this._componentRef = null; + this._currentInstruction = null; + if (lang_1.isPresent(nameAttr)) { + this.name = nameAttr; + this._parentRouter.registerAuxOutlet(this); + } else { + this._parentRouter.registerPrimaryOutlet(this); + } + } + RouterOutlet.prototype.activate = function(nextInstruction) { + var _this = this; + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + var componentType = nextInstruction.componentType; + var childRouter = this._parentRouter.childRouter(componentType); + var providers = angular2_1.Injector.resolve([angular2_1.provide(instruction_1.RouteData, {useValue: nextInstruction.routeData}), angular2_1.provide(instruction_1.RouteParams, {useValue: new instruction_1.RouteParams(nextInstruction.params)}), angular2_1.provide(routerMod.Router, {useValue: childRouter})]); + return this._loader.loadNextToLocation(componentType, this._elementRef, providers).then(function(componentRef) { + _this._componentRef = componentRef; + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onActivate, componentType)) { + return _this._componentRef.instance.onActivate(nextInstruction, previousInstruction); + } + }); + }; + RouterOutlet.prototype.reuse = function(nextInstruction) { + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + if (lang_1.isBlank(this._componentRef)) { + throw new exceptions_1.BaseException("Cannot reuse an outlet that does not contain a component."); + } + return async_1.PromiseWrapper.resolve(route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onReuse, this._currentInstruction.componentType) ? this._componentRef.instance.onReuse(nextInstruction, previousInstruction) : true); + }; + RouterOutlet.prototype.deactivate = function(nextInstruction) { + var _this = this; + var next = _resolveToTrue; + if (lang_1.isPresent(this._componentRef) && lang_1.isPresent(this._currentInstruction) && route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onDeactivate, this._currentInstruction.componentType)) { + next = async_1.PromiseWrapper.resolve(this._componentRef.instance.onDeactivate(nextInstruction, this._currentInstruction)); + } + return next.then(function(_) { + if (lang_1.isPresent(_this._componentRef)) { + _this._componentRef.dispose(); + _this._componentRef = null; + } + }); + }; + RouterOutlet.prototype.canDeactivate = function(nextInstruction) { + if (lang_1.isBlank(this._currentInstruction)) { + return _resolveToTrue; + } + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canDeactivate, this._currentInstruction.componentType)) { + return async_1.PromiseWrapper.resolve(this._componentRef.instance.canDeactivate(nextInstruction, this._currentInstruction)); + } + return _resolveToTrue; + }; + RouterOutlet.prototype.canReuse = function(nextInstruction) { + var result; + if (lang_1.isBlank(this._currentInstruction) || this._currentInstruction.componentType != nextInstruction.componentType) { + result = false; + } else if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canReuse, this._currentInstruction.componentType)) { + result = this._componentRef.instance.canReuse(nextInstruction, this._currentInstruction); + } else { + result = nextInstruction == this._currentInstruction || (lang_1.isPresent(nextInstruction.params) && lang_1.isPresent(this._currentInstruction.params) && collection_1.StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params)); + } + return async_1.PromiseWrapper.resolve(result); + }; + RouterOutlet = __decorate([angular2_1.Directive({selector: 'router-outlet'}), __param(3, angular2_1.Attribute('name')), __metadata('design:paramtypes', [angular2_1.ElementRef, angular2_1.DynamicComponentLoader, routerMod.Router, String])], RouterOutlet); + return RouterOutlet; + })(); + exports.RouterOutlet = RouterOutlet; + global.define = __define; + return module.exports; +}); + +System.register("angular2/router", ["angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/instruction", "angular2/src/router/route_registry", "angular2/src/router/location_strategy", "angular2/src/router/hash_location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/location", "angular2/src/router/route_config_decorator", "angular2/src/router/route_definition", "angular2/src/router/lifecycle_annotations", "angular2/src/router/instruction", "angular2/angular2", "angular2/src/router/location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/route_registry", "angular2/src/router/location", "angular2/angular2", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var router_1 = require("angular2/src/router/router"); + exports.Router = router_1.Router; + var router_outlet_1 = require("angular2/src/router/router_outlet"); + exports.RouterOutlet = router_outlet_1.RouterOutlet; + var router_link_1 = require("angular2/src/router/router_link"); + exports.RouterLink = router_link_1.RouterLink; + var instruction_1 = require("angular2/src/router/instruction"); + exports.RouteParams = instruction_1.RouteParams; + exports.RouteData = instruction_1.RouteData; + var route_registry_1 = require("angular2/src/router/route_registry"); + exports.RouteRegistry = route_registry_1.RouteRegistry; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + exports.LocationStrategy = location_strategy_1.LocationStrategy; + var hash_location_strategy_1 = require("angular2/src/router/hash_location_strategy"); + exports.HashLocationStrategy = hash_location_strategy_1.HashLocationStrategy; + var path_location_strategy_1 = require("angular2/src/router/path_location_strategy"); + exports.PathLocationStrategy = path_location_strategy_1.PathLocationStrategy; + var location_1 = require("angular2/src/router/location"); + exports.Location = location_1.Location; + exports.APP_BASE_HREF = location_1.APP_BASE_HREF; + __export(require("angular2/src/router/route_config_decorator")); + __export(require("angular2/src/router/route_definition")); + var lifecycle_annotations_1 = require("angular2/src/router/lifecycle_annotations"); + exports.CanActivate = lifecycle_annotations_1.CanActivate; + var instruction_2 = require("angular2/src/router/instruction"); + exports.Instruction = instruction_2.Instruction; + exports.ComponentInstruction = instruction_2.ComponentInstruction; + var angular2_1 = require("angular2/angular2"); + exports.OpaqueToken = angular2_1.OpaqueToken; + var location_strategy_2 = require("angular2/src/router/location_strategy"); + var path_location_strategy_2 = require("angular2/src/router/path_location_strategy"); + var router_2 = require("angular2/src/router/router"); + var router_outlet_2 = require("angular2/src/router/router_outlet"); + var router_link_2 = require("angular2/src/router/router_link"); + var route_registry_2 = require("angular2/src/router/route_registry"); + var location_2 = require("angular2/src/router/location"); + var angular2_2 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.ROUTER_PRIMARY_COMPONENT = lang_1.CONST_EXPR(new angular2_2.OpaqueToken('RouterPrimaryComponent')); + exports.ROUTER_DIRECTIVES = lang_1.CONST_EXPR([router_outlet_2.RouterOutlet, router_link_2.RouterLink]); + exports.ROUTER_PROVIDERS = lang_1.CONST_EXPR([route_registry_2.RouteRegistry, lang_1.CONST_EXPR(new angular2_2.Provider(location_strategy_2.LocationStrategy, {useClass: path_location_strategy_2.PathLocationStrategy})), location_2.Location, lang_1.CONST_EXPR(new angular2_2.Provider(router_2.Router, { + useFactory: routerFactory, + deps: lang_1.CONST_EXPR([route_registry_2.RouteRegistry, location_2.Location, exports.ROUTER_PRIMARY_COMPONENT, angular2_2.ApplicationRef]) + })), lang_1.CONST_EXPR(new angular2_2.Provider(exports.ROUTER_PRIMARY_COMPONENT, { + useFactory: routerPrimaryComponentFactory, + deps: lang_1.CONST_EXPR([angular2_2.ApplicationRef]) + }))]); + exports.ROUTER_BINDINGS = exports.ROUTER_PROVIDERS; + function routerFactory(registry, location, primaryComponent, appRef) { + var rootRouter = new router_2.RootRouter(registry, location, primaryComponent); + appRef.registerDisposeListener(function() { + return rootRouter.dispose(); + }); + return rootRouter; + } + function routerPrimaryComponentFactory(app) { + if (app.componentTypes.length == 0) { + throw new exceptions_1.BaseException("Bootstrap at least one component before injecting Router."); + } + return app.componentTypes[0]; + } + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=router.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/router.js b/2.0.0-alpha.46/router.js new file mode 100644 index 0000000000..5353b1ecfa --- /dev/null +++ b/2.0.0-alpha.46/router.js @@ -0,0 +1,2411 @@ +"format register"; +System.register("angular2/src/router/instruction", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var RouteParams = (function() { + function RouteParams(params) { + this.params = params; + } + RouteParams.prototype.get = function(param) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.params, param)); + }; + return RouteParams; + })(); + exports.RouteParams = RouteParams; + var RouteData = (function() { + function RouteData(data) { + if (data === void 0) { + data = lang_1.CONST_EXPR({}); + } + this.data = data; + } + RouteData.prototype.get = function(key) { + return lang_1.normalizeBlank(collection_1.StringMapWrapper.get(this.data, key)); + }; + return RouteData; + })(); + exports.RouteData = RouteData; + var BLANK_ROUTE_DATA = new RouteData(); + var Instruction = (function() { + function Instruction(component, child, auxInstruction) { + this.component = component; + this.child = child; + this.auxInstruction = auxInstruction; + } + Instruction.prototype.replaceChild = function(child) { + return new Instruction(this.component, child, this.auxInstruction); + }; + return Instruction; + })(); + exports.Instruction = Instruction; + var PrimaryInstruction = (function() { + function PrimaryInstruction(component, child, auxUrls) { + this.component = component; + this.child = child; + this.auxUrls = auxUrls; + } + return PrimaryInstruction; + })(); + exports.PrimaryInstruction = PrimaryInstruction; + function stringifyInstruction(instruction) { + return stringifyInstructionPath(instruction) + stringifyInstructionQuery(instruction); + } + exports.stringifyInstruction = stringifyInstruction; + function stringifyInstructionPath(instruction) { + return instruction.component.urlPath + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + exports.stringifyInstructionPath = stringifyInstructionPath; + function stringifyInstructionQuery(instruction) { + return instruction.component.urlParams.length > 0 ? ('?' + instruction.component.urlParams.join('&')) : ''; + } + exports.stringifyInstructionQuery = stringifyInstructionQuery; + function stringifyPrimaryPrefixed(instruction) { + var primary = stringifyPrimary(instruction); + if (primary.length > 0) { + primary = '/' + primary; + } + return primary; + } + function stringifyPrimary(instruction) { + if (lang_1.isBlank(instruction)) { + return ''; + } + var params = instruction.component.urlParams.length > 0 ? (';' + instruction.component.urlParams.join(';')) : ''; + return instruction.component.urlPath + params + stringifyAux(instruction) + stringifyPrimaryPrefixed(instruction.child); + } + function stringifyAux(instruction) { + var routes = []; + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(auxInstruction, _) { + routes.push(stringifyPrimary(auxInstruction)); + }); + if (routes.length > 0) { + return '(' + routes.join('//') + ')'; + } + return ''; + } + var ComponentInstruction = (function() { + function ComponentInstruction() { + this.reuse = false; + } + Object.defineProperty(ComponentInstruction.prototype, "componentType", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "specificity", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "terminal", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ComponentInstruction.prototype, "routeData", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ComponentInstruction; + })(); + exports.ComponentInstruction = ComponentInstruction; + var ComponentInstruction_ = (function(_super) { + __extends(ComponentInstruction_, _super); + function ComponentInstruction_(urlPath, urlParams, _recognizer, params) { + if (params === void 0) { + params = null; + } + _super.call(this); + this._recognizer = _recognizer; + this.urlPath = urlPath; + this.urlParams = urlParams; + this.params = params; + if (lang_1.isPresent(this._recognizer.handler.data)) { + this._routeData = new RouteData(this._recognizer.handler.data); + } else { + this._routeData = BLANK_ROUTE_DATA; + } + } + Object.defineProperty(ComponentInstruction_.prototype, "componentType", { + get: function() { + return this._recognizer.handler.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentInstruction_.prototype.resolveComponentType = function() { + return this._recognizer.handler.resolveComponentType(); + }; + Object.defineProperty(ComponentInstruction_.prototype, "specificity", { + get: function() { + return this._recognizer.specificity; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "terminal", { + get: function() { + return this._recognizer.terminal; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentInstruction_.prototype, "routeData", { + get: function() { + return this._routeData; + }, + enumerable: true, + configurable: true + }); + return ComponentInstruction_; + })(ComponentInstruction); + exports.ComponentInstruction_ = ComponentInstruction_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteLifecycleHook = (function() { + function RouteLifecycleHook(name) { + this.name = name; + } + RouteLifecycleHook = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], RouteLifecycleHook); + return RouteLifecycleHook; + })(); + exports.RouteLifecycleHook = RouteLifecycleHook; + var CanActivate = (function() { + function CanActivate(fn) { + this.fn = fn; + } + CanActivate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Function])], CanActivate); + return CanActivate; + })(); + exports.CanActivate = CanActivate; + exports.canReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("canReuse")); + exports.canDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("canDeactivate")); + exports.onActivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onActivate")); + exports.onReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("onReuse")); + exports.onDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("onDeactivate")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/lifecycle_annotations", ["angular2/src/core/util/decorators", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/router/lifecycle_annotations_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var lifecycle_annotations_impl_2 = require("angular2/src/router/lifecycle_annotations_impl"); + exports.canReuse = lifecycle_annotations_impl_2.canReuse; + exports.canDeactivate = lifecycle_annotations_impl_2.canDeactivate; + exports.onActivate = lifecycle_annotations_impl_2.onActivate; + exports.onReuse = lifecycle_annotations_impl_2.onReuse; + exports.onDeactivate = lifecycle_annotations_impl_2.onDeactivate; + exports.CanActivate = decorators_1.makeDecorator(lifecycle_annotations_impl_1.CanActivate); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location_strategy", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var LocationStrategy = (function() { + function LocationStrategy() {} + return LocationStrategy; + })(); + exports.LocationStrategy = LocationStrategy; + function normalizeQueryParams(params) { + return (params.length > 0 && params.substring(0, 1) != '?') ? ('?' + params) : params; + } + exports.normalizeQueryParams = normalizeQueryParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/url_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var Url = (function() { + function Url(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + this.path = path; + this.child = child; + this.auxiliary = auxiliary; + this.params = params; + } + Url.prototype.toString = function() { + return this.path + this._matrixParamsToString() + this._auxToString() + this._childString(); + }; + Url.prototype.segmentToString = function() { + return this.path + this._matrixParamsToString(); + }; + Url.prototype._auxToString = function() { + return this.auxiliary.length > 0 ? ('(' + this.auxiliary.map(function(sibling) { + return sibling.toString(); + }).join('//') + ')') : ''; + }; + Url.prototype._matrixParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return ';' + serializeParams(this.params).join(';'); + }; + Url.prototype._childString = function() { + return lang_1.isPresent(this.child) ? ('/' + this.child.toString()) : ''; + }; + return Url; + })(); + exports.Url = Url; + var RootUrl = (function(_super) { + __extends(RootUrl, _super); + function RootUrl(path, child, auxiliary, params) { + if (child === void 0) { + child = null; + } + if (auxiliary === void 0) { + auxiliary = lang_1.CONST_EXPR([]); + } + if (params === void 0) { + params = null; + } + _super.call(this, path, child, auxiliary, params); + } + RootUrl.prototype.toString = function() { + return this.path + this._auxToString() + this._childString() + this._queryParamsToString(); + }; + RootUrl.prototype.segmentToString = function() { + return this.path + this._queryParamsToString(); + }; + RootUrl.prototype._queryParamsToString = function() { + if (lang_1.isBlank(this.params)) { + return ''; + } + return '?' + serializeParams(this.params).join('&'); + }; + return RootUrl; + })(Url); + exports.RootUrl = RootUrl; + function pathSegmentsToUrl(pathSegments) { + var url = new Url(pathSegments[pathSegments.length - 1]); + for (var i = pathSegments.length - 2; i >= 0; i -= 1) { + url = new Url(pathSegments[i], url); + } + return url; + } + exports.pathSegmentsToUrl = pathSegmentsToUrl; + var SEGMENT_RE = lang_1.RegExpWrapper.create('^[^\\/\\(\\)\\?;=&#]+'); + function matchUrlSegment(str) { + var match = lang_1.RegExpWrapper.firstMatch(SEGMENT_RE, str); + return lang_1.isPresent(match) ? match[0] : ''; + } + var UrlParser = (function() { + function UrlParser() {} + UrlParser.prototype.peekStartsWith = function(str) { + return this._remaining.startsWith(str); + }; + UrlParser.prototype.capture = function(str) { + if (!this._remaining.startsWith(str)) { + throw new exceptions_1.BaseException("Expected \"" + str + "\"."); + } + this._remaining = this._remaining.substring(str.length); + }; + UrlParser.prototype.parse = function(url) { + this._remaining = url; + if (url == '' || url == '/') { + return new Url(''); + } + return this.parseRoot(); + }; + UrlParser.prototype.parseRoot = function() { + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + if (this.peekStartsWith(';')) { + this.parseMatrixParams(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + var queryParams = null; + if (this.peekStartsWith('?')) { + queryParams = this.parseQueryParams(); + } + return new RootUrl(path, child, aux, queryParams); + }; + UrlParser.prototype.parseSegment = function() { + if (this._remaining.length == 0) { + return null; + } + if (this.peekStartsWith('/')) { + this.capture('/'); + } + var path = matchUrlSegment(this._remaining); + this.capture(path); + var matrixParams = null; + if (this.peekStartsWith(';')) { + matrixParams = this.parseMatrixParams(); + } + var aux = []; + if (this.peekStartsWith('(')) { + aux = this.parseAuxiliaryRoutes(); + } + var child = null; + if (this.peekStartsWith('/') && !this.peekStartsWith('//')) { + this.capture('/'); + child = this.parseSegment(); + } + return new Url(path, child, aux, matrixParams); + }; + UrlParser.prototype.parseQueryParams = function() { + var params = {}; + this.capture('?'); + this.parseParam(params); + while (this._remaining.length > 0 && this.peekStartsWith('&')) { + this.capture('&'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseMatrixParams = function() { + var params = {}; + while (this._remaining.length > 0 && this.peekStartsWith(';')) { + this.capture(';'); + this.parseParam(params); + } + return params; + }; + UrlParser.prototype.parseParam = function(params) { + var key = matchUrlSegment(this._remaining); + if (lang_1.isBlank(key)) { + return ; + } + this.capture(key); + var value = true; + if (this.peekStartsWith('=')) { + this.capture('='); + var valueMatch = matchUrlSegment(this._remaining); + if (lang_1.isPresent(valueMatch)) { + value = valueMatch; + this.capture(value); + } + } + params[key] = value; + }; + UrlParser.prototype.parseAuxiliaryRoutes = function() { + var routes = []; + this.capture('('); + while (!this.peekStartsWith(')') && this._remaining.length > 0) { + routes.push(this.parseSegment()); + if (this.peekStartsWith('//')) { + this.capture('//'); + } + } + this.capture(')'); + return routes; + }; + return UrlParser; + })(); + exports.UrlParser = UrlParser; + exports.parser = new UrlParser(); + function serializeParams(paramMap) { + var params = []; + if (lang_1.isPresent(paramMap)) { + collection_1.StringMapWrapper.forEach(paramMap, function(value, key) { + if (value == true) { + params.push(key); + } else { + params.push(key + '=' + value); + } + }); + } + return params; + } + exports.serializeParams = serializeParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var RouteConfig = (function() { + function RouteConfig(configs) { + this.configs = configs; + } + RouteConfig = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array])], RouteConfig); + return RouteConfig; + })(); + exports.RouteConfig = RouteConfig; + var Route = (function() { + function Route(_a) { + var path = _a.path, + component = _a.component, + name = _a.name, + data = _a.data; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + this.data = data; + } + Route = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Route); + return Route; + })(); + exports.Route = Route; + var AuxRoute = (function() { + function AuxRoute(_a) { + var path = _a.path, + component = _a.component, + name = _a.name; + this.data = null; + this.aux = null; + this.loader = null; + this.redirectTo = null; + this.path = path; + this.component = component; + this.name = name; + } + AuxRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AuxRoute); + return AuxRoute; + })(); + exports.AuxRoute = AuxRoute; + var AsyncRoute = (function() { + function AsyncRoute(_a) { + var path = _a.path, + loader = _a.loader, + name = _a.name, + data = _a.data; + this.aux = null; + this.path = path; + this.loader = loader; + this.name = name; + this.data = data; + } + AsyncRoute = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], AsyncRoute); + return AsyncRoute; + })(); + exports.AsyncRoute = AsyncRoute; + var Redirect = (function() { + function Redirect(_a) { + var path = _a.path, + redirectTo = _a.redirectTo; + this.name = null; + this.loader = null; + this.data = null; + this.aux = null; + this.path = path; + this.redirectTo = redirectTo; + } + Redirect = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], Redirect); + return Redirect; + })(); + exports.Redirect = Redirect; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/async_route_handler", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var AsyncRouteHandler = (function() { + function AsyncRouteHandler(_loader, data) { + this._loader = _loader; + this.data = data; + this._resolvedComponent = null; + } + AsyncRouteHandler.prototype.resolveComponentType = function() { + var _this = this; + if (lang_1.isPresent(this._resolvedComponent)) { + return this._resolvedComponent; + } + return this._resolvedComponent = this._loader().then(function(componentType) { + _this.componentType = componentType; + return componentType; + }); + }; + return AsyncRouteHandler; + })(); + exports.AsyncRouteHandler = AsyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/sync_route_handler", ["angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_1 = require("angular2/src/facade/async"); + var SyncRouteHandler = (function() { + function SyncRouteHandler(componentType, data) { + this.componentType = componentType; + this.data = data; + this._resolvedComponent = null; + this._resolvedComponent = async_1.PromiseWrapper.resolve(componentType); + } + SyncRouteHandler.prototype.resolveComponentType = function() { + return this._resolvedComponent; + }; + return SyncRouteHandler; + })(); + exports.SyncRouteHandler = SyncRouteHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_decorator", ["angular2/src/router/route_config_impl", "angular2/src/core/util/decorators", "angular2/src/router/route_config_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var decorators_1 = require("angular2/src/core/util/decorators"); + var route_config_impl_2 = require("angular2/src/router/route_config_impl"); + exports.Route = route_config_impl_2.Route; + exports.Redirect = route_config_impl_2.Redirect; + exports.AuxRoute = route_config_impl_2.AuxRoute; + exports.AsyncRoute = route_config_impl_2.AsyncRoute; + exports.RouteConfig = decorators_1.makeDecorator(route_config_impl_1.RouteConfig); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/hash_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var HashLocationStrategy = (function(_super) { + __extends(HashLocationStrategy, _super); + function HashLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + } + HashLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + }; + HashLocationStrategy.prototype.getBaseHref = function() { + return ''; + }; + HashLocationStrategy.prototype.path = function() { + var path = this._location.hash; + return (path.length > 0 ? path.substring(1) : path) + location_strategy_1.normalizeQueryParams(this._location.search); + }; + HashLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return internal.length > 0 ? ('#' + internal) : internal; + }; + HashLocationStrategy.prototype.pushState = function(state, title, path, queryParams) { + var url = path + location_strategy_1.normalizeQueryParams(queryParams); + if (url.length == 0) { + url = this._location.pathname; + } else { + url = this.prepareExternalUrl(url); + } + this._history.pushState(state, title, url); + }; + HashLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + HashLocationStrategy.prototype.back = function() { + this._history.back(); + }; + HashLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], HashLocationStrategy); + return HashLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.HashLocationStrategy = HashLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_location_strategy", ["angular2/src/core/dom/dom_adapter", "angular2/angular2", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var angular2_1 = require("angular2/angular2"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var PathLocationStrategy = (function(_super) { + __extends(PathLocationStrategy, _super); + function PathLocationStrategy() { + _super.call(this); + this._location = dom_adapter_1.DOM.getLocation(); + this._history = dom_adapter_1.DOM.getHistory(); + this._baseHref = dom_adapter_1.DOM.getBaseHref(); + } + PathLocationStrategy.prototype.onPopState = function(fn) { + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false); + dom_adapter_1.DOM.getGlobalEventTarget('window').addEventListener('hashchange', fn, false); + }; + PathLocationStrategy.prototype.getBaseHref = function() { + return this._baseHref; + }; + PathLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return this._baseHref + internal; + }; + PathLocationStrategy.prototype.path = function() { + return this._location.pathname + location_strategy_1.normalizeQueryParams(this._location.search); + }; + PathLocationStrategy.prototype.pushState = function(state, title, url, queryParams) { + this._history.pushState(state, title, (url + location_strategy_1.normalizeQueryParams(queryParams))); + }; + PathLocationStrategy.prototype.forward = function() { + this._history.forward(); + }; + PathLocationStrategy.prototype.back = function() { + this._history.back(); + }; + PathLocationStrategy = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], PathLocationStrategy); + return PathLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.PathLocationStrategy = PathLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_definition", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/location", ["angular2/src/router/location_strategy", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var lang_2 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + exports.APP_BASE_HREF = lang_1.CONST_EXPR(new angular2_1.OpaqueToken('appBaseHref')); + var Location = (function() { + function Location(platformStrategy, href) { + var _this = this; + this.platformStrategy = platformStrategy; + this._subject = new async_1.EventEmitter(); + var browserBaseHref = lang_1.isPresent(href) ? href : this.platformStrategy.getBaseHref(); + if (lang_2.isBlank(browserBaseHref)) { + throw new exceptions_1.BaseException("No base href set. Either provide a provider for the APP_BASE_HREF token or add a base element to the document."); + } + this._baseHref = stripTrailingSlash(stripIndexHtml(browserBaseHref)); + this.platformStrategy.onPopState(function(_) { + async_1.ObservableWrapper.callNext(_this._subject, { + 'url': _this.path(), + 'pop': true + }); + }); + } + Location.prototype.path = function() { + return this.normalize(this.platformStrategy.path()); + }; + Location.prototype.normalize = function(url) { + return stripTrailingSlash(_stripBaseHref(this._baseHref, stripIndexHtml(url))); + }; + Location.prototype.prepareExternalUrl = function(url) { + if (!url.startsWith('/')) { + url = '/' + url; + } + return this.platformStrategy.prepareExternalUrl(stripTrailingSlash(_addBaseHref(this._baseHref, url))); + }; + Location.prototype.go = function(path, query) { + if (query === void 0) { + query = ''; + } + this.platformStrategy.pushState(null, '', path, query); + }; + Location.prototype.forward = function() { + this.platformStrategy.forward(); + }; + Location.prototype.back = function() { + this.platformStrategy.back(); + }; + Location.prototype.subscribe = function(onNext, onThrow, onReturn) { + if (onThrow === void 0) { + onThrow = null; + } + if (onReturn === void 0) { + onReturn = null; + } + return async_1.ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn); + }; + Location = __decorate([angular2_1.Injectable(), __param(1, angular2_1.Optional()), __param(1, angular2_1.Inject(exports.APP_BASE_HREF)), __metadata('design:paramtypes', [location_strategy_1.LocationStrategy, String])], Location); + return Location; + })(); + exports.Location = Location; + function _stripBaseHref(baseHref, url) { + if (baseHref.length > 0 && url.startsWith(baseHref)) { + return url.substring(baseHref.length); + } + return url; + } + function _addBaseHref(baseHref, url) { + if (!url.startsWith(baseHref)) { + return baseHref + url; + } + return url; + } + function stripIndexHtml(url) { + if (/\/index.html$/g.test(url)) { + return url.substring(0, url.length - 11); + } + return url; + } + function stripTrailingSlash(url) { + if (/\/$/g.test(url)) { + url = url.substring(0, url.length - 1); + } + return url; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/path_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/url_parser", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var instruction_1 = require("angular2/src/router/instruction"); + var TouchMap = (function() { + function TouchMap(map) { + var _this = this; + this.map = {}; + this.keys = {}; + if (lang_1.isPresent(map)) { + collection_1.StringMapWrapper.forEach(map, function(value, key) { + _this.map[key] = lang_1.isPresent(value) ? value.toString() : null; + _this.keys[key] = true; + }); + } + } + TouchMap.prototype.get = function(key) { + collection_1.StringMapWrapper.delete(this.keys, key); + return this.map[key]; + }; + TouchMap.prototype.getUnused = function() { + var _this = this; + var unused = collection_1.StringMapWrapper.create(); + var keys = collection_1.StringMapWrapper.keys(this.keys); + keys.forEach(function(key) { + return unused[key] = collection_1.StringMapWrapper.get(_this.map, key); + }); + return unused; + }; + return TouchMap; + })(); + function normalizeString(obj) { + if (lang_1.isBlank(obj)) { + return null; + } else { + return obj.toString(); + } + } + var ContinuationSegment = (function() { + function ContinuationSegment() { + this.name = ''; + } + ContinuationSegment.prototype.generate = function(params) { + return ''; + }; + ContinuationSegment.prototype.match = function(path) { + return true; + }; + return ContinuationSegment; + })(); + var StaticSegment = (function() { + function StaticSegment(path) { + this.path = path; + this.name = ''; + } + StaticSegment.prototype.match = function(path) { + return path == this.path; + }; + StaticSegment.prototype.generate = function(params) { + return this.path; + }; + return StaticSegment; + })(); + var DynamicSegment = (function() { + function DynamicSegment(name) { + this.name = name; + } + DynamicSegment.prototype.match = function(path) { + return path.length > 0; + }; + DynamicSegment.prototype.generate = function(params) { + if (!collection_1.StringMapWrapper.contains(params.map, this.name)) { + throw new exceptions_1.BaseException("Route generator for '" + this.name + "' was not included in parameters passed."); + } + return normalizeString(params.get(this.name)); + }; + return DynamicSegment; + })(); + var StarSegment = (function() { + function StarSegment(name) { + this.name = name; + } + StarSegment.prototype.match = function(path) { + return true; + }; + StarSegment.prototype.generate = function(params) { + return normalizeString(params.get(this.name)); + }; + return StarSegment; + })(); + var paramMatcher = /^:([^\/]+)$/g; + var wildcardMatcher = /^\*([^\/]+)$/g; + function parsePathString(route) { + if (route.startsWith("/")) { + route = route.substring(1); + } + var segments = splitBySlash(route); + var results = []; + var specificity = 0; + if (segments.length > 98) { + throw new exceptions_1.BaseException("'" + route + "' has more than the maximum supported number of segments."); + } + var limit = segments.length - 1; + for (var i = 0; i <= limit; i++) { + var segment = segments[i], + match; + if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(paramMatcher, segment))) { + results.push(new DynamicSegment(match[1])); + specificity += (100 - i); + } else if (lang_1.isPresent(match = lang_1.RegExpWrapper.firstMatch(wildcardMatcher, segment))) { + results.push(new StarSegment(match[1])); + } else if (segment == '...') { + if (i < limit) { + throw new exceptions_1.BaseException("Unexpected \"...\" before the end of the path for \"" + route + "\"."); + } + results.push(new ContinuationSegment()); + } else { + results.push(new StaticSegment(segment)); + specificity += 100 * (100 - i); + } + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'segments', results); + collection_1.StringMapWrapper.set(result, 'specificity', specificity); + return result; + } + function pathDslHash(segments) { + return segments.map(function(segment) { + if (segment instanceof StarSegment) { + return '*'; + } else if (segment instanceof ContinuationSegment) { + return '...'; + } else if (segment instanceof DynamicSegment) { + return ':'; + } else if (segment instanceof StaticSegment) { + return segment.path; + } + }).join('/'); + } + function splitBySlash(url) { + return url.split('/'); + } + var RESERVED_CHARS = lang_1.RegExpWrapper.create('//|\\(|\\)|;|\\?|='); + function assertPath(path) { + if (lang_1.StringWrapper.contains(path, '#')) { + throw new exceptions_1.BaseException("Path \"" + path + "\" should not include \"#\". Use \"HashLocationStrategy\" instead."); + } + var illegalCharacter = lang_1.RegExpWrapper.firstMatch(RESERVED_CHARS, path); + if (lang_1.isPresent(illegalCharacter)) { + throw new exceptions_1.BaseException("Path \"" + path + "\" contains \"" + illegalCharacter[0] + "\" which is not allowed in a route config."); + } + } + var PathMatch = (function() { + function PathMatch(instruction, remaining, remainingAux) { + this.instruction = instruction; + this.remaining = remaining; + this.remainingAux = remainingAux; + } + return PathMatch; + })(); + exports.PathMatch = PathMatch; + var PathRecognizer = (function() { + function PathRecognizer(path, handler) { + this.path = path; + this.handler = handler; + this.terminal = true; + this._cache = new collection_1.Map(); + assertPath(path); + var parsed = parsePathString(path); + this._segments = parsed['segments']; + this.specificity = parsed['specificity']; + this.hash = pathDslHash(this._segments); + var lastSegment = this._segments[this._segments.length - 1]; + this.terminal = !(lastSegment instanceof ContinuationSegment); + } + PathRecognizer.prototype.recognize = function(beginningSegment) { + var nextSegment = beginningSegment; + var currentSegment; + var positionalParams = {}; + var captured = []; + for (var i = 0; i < this._segments.length; i += 1) { + var segment = this._segments[i]; + currentSegment = nextSegment; + if (segment instanceof ContinuationSegment) { + break; + } + if (lang_1.isPresent(currentSegment)) { + captured.push(currentSegment.path); + if (segment instanceof StarSegment) { + positionalParams[segment.name] = currentSegment.toString(); + nextSegment = null; + break; + } + if (segment instanceof DynamicSegment) { + positionalParams[segment.name] = currentSegment.path; + } else if (!segment.match(currentSegment.path)) { + return null; + } + nextSegment = currentSegment.child; + } else if (!segment.match('')) { + return null; + } + } + if (this.terminal && lang_1.isPresent(nextSegment)) { + return null; + } + var urlPath = captured.join('/'); + var auxiliary; + var instruction; + var urlParams; + var allParams; + if (lang_1.isPresent(currentSegment)) { + var paramsSegment = beginningSegment instanceof url_parser_1.RootUrl ? beginningSegment : currentSegment; + allParams = lang_1.isPresent(paramsSegment.params) ? collection_1.StringMapWrapper.merge(paramsSegment.params, positionalParams) : positionalParams; + urlParams = url_parser_1.serializeParams(paramsSegment.params); + auxiliary = currentSegment.auxiliary; + } else { + allParams = positionalParams; + auxiliary = []; + urlParams = []; + } + instruction = this._getInstruction(urlPath, urlParams, this, allParams); + return new PathMatch(instruction, nextSegment, auxiliary); + }; + PathRecognizer.prototype.generate = function(params) { + var paramTokens = new TouchMap(params); + var path = []; + for (var i = 0; i < this._segments.length; i++) { + var segment = this._segments[i]; + if (!(segment instanceof ContinuationSegment)) { + path.push(segment.generate(paramTokens)); + } + } + var urlPath = path.join('/'); + var nonPositionalParams = paramTokens.getUnused(); + var urlParams = url_parser_1.serializeParams(nonPositionalParams); + return this._getInstruction(urlPath, urlParams, this, params); + }; + PathRecognizer.prototype._getInstruction = function(urlPath, urlParams, _recognizer, params) { + var hashKey = urlPath + '?' + urlParams.join('?'); + if (this._cache.has(hashKey)) { + return this._cache.get(hashKey); + } + var instruction = new instruction_1.ComponentInstruction_(urlPath, urlParams, _recognizer, params); + this._cache.set(hashKey, instruction); + return instruction; + }; + return PathRecognizer; + })(); + exports.PathRecognizer = PathRecognizer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_config_nomalizer", ["angular2/src/router/route_config_decorator", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var route_config_decorator_1 = require("angular2/src/router/route_config_decorator"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function normalizeRouteConfig(config) { + if (config instanceof route_config_decorator_1.Route || config instanceof route_config_decorator_1.Redirect || config instanceof route_config_decorator_1.AsyncRoute || config instanceof route_config_decorator_1.AuxRoute) { + return config; + } + if ((+!!config.component) + (+!!config.redirectTo) + (+!!config.loader) != 1) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"component\", \"loader\", or \"redirectTo\" property."); + } + if (config.as && config.name) { + throw new exceptions_1.BaseException("Route config should contain exactly one \"as\" or \"name\" property."); + } + if (config.as) { + config.name = config.as; + } + if (config.loader) { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: config.loader, + name: config.name + }); + } + if (config.aux) { + return new route_config_decorator_1.AuxRoute({ + path: config.aux, + component: config.component, + name: config.name + }); + } + if (config.component) { + if (typeof config.component == 'object') { + var componentDefinitionObject = config.component; + if (componentDefinitionObject.type == 'constructor') { + return new route_config_decorator_1.Route({ + path: config.path, + component: componentDefinitionObject.constructor, + name: config.name + }); + } else if (componentDefinitionObject.type == 'loader') { + return new route_config_decorator_1.AsyncRoute({ + path: config.path, + loader: componentDefinitionObject.loader, + name: config.name + }); + } else { + throw new exceptions_1.BaseException("Invalid component type \"" + componentDefinitionObject.type + "\". Valid types are \"constructor\" and \"loader\"."); + } + } + return new route_config_decorator_1.Route(config); + } + if (config.redirectTo) { + return new route_config_decorator_1.Redirect({ + path: config.path, + redirectTo: config.redirectTo + }); + } + return config; + } + exports.normalizeRouteConfig = normalizeRouteConfig; + function assertComponentExists(component, path) { + if (!lang_1.isType(component)) { + throw new exceptions_1.BaseException("Component for route \"" + path + "\" is not defined, or is not a class."); + } + } + exports.assertComponentExists = assertComponentExists; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/router/lifecycle_annotations_impl", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var lifecycle_annotations_impl_1 = require("angular2/src/router/lifecycle_annotations_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function hasLifecycleHook(e, type) { + if (!(type instanceof lang_1.Type)) + return false; + return e.name in type.prototype; + } + exports.hasLifecycleHook = hasLifecycleHook; + function getCanActivateHook(type) { + var annotations = reflection_1.reflector.annotations(type); + for (var i = 0; i < annotations.length; i += 1) { + var annotation = annotations[i]; + if (annotation instanceof lifecycle_annotations_impl_1.CanActivate) { + return annotation.fn; + } + } + return null; + } + exports.getCanActivateHook = getCanActivateHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_link", ["angular2/angular2", "angular2/src/facade/lang", "angular2/src/router/router", "angular2/src/router/location", "angular2/src/router/instruction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var angular2_1 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var router_1 = require("angular2/src/router/router"); + var location_1 = require("angular2/src/router/location"); + var instruction_1 = require("angular2/src/router/instruction"); + var RouterLink = (function() { + function RouterLink(_router, _location) { + this._router = _router; + this._location = _location; + } + Object.defineProperty(RouterLink.prototype, "isRouteActive", { + get: function() { + return this._router.isRouteActive(this._navigationInstruction); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RouterLink.prototype, "routeParams", { + set: function(changes) { + this._routeParams = changes; + this._navigationInstruction = this._router.generate(this._routeParams); + var navigationHref = instruction_1.stringifyInstruction(this._navigationInstruction); + this.visibleHref = this._location.prepareExternalUrl(navigationHref); + }, + enumerable: true, + configurable: true + }); + RouterLink.prototype.onClick = function() { + if (!lang_1.isString(this.target) || this.target == '_self') { + this._router.navigateByInstruction(this._navigationInstruction); + return false; + } + return true; + }; + RouterLink = __decorate([angular2_1.Directive({ + selector: '[router-link]', + inputs: ['routeParams: routerLink', 'target: target'], + host: { + '(click)': 'onClick()', + '[attr.href]': 'visibleHref', + '[class.router-link-active]': 'isRouteActive' + } + }), __metadata('design:paramtypes', [router_1.Router, location_1.Location])], RouterLink); + return RouterLink; + })(); + exports.RouterLink = RouterLink; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_recognizer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/router/path_recognizer", "angular2/src/router/route_config_impl", "angular2/src/router/async_route_handler", "angular2/src/router/sync_route_handler", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var path_recognizer_1 = require("angular2/src/router/path_recognizer"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var async_route_handler_1 = require("angular2/src/router/async_route_handler"); + var sync_route_handler_1 = require("angular2/src/router/sync_route_handler"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var RouteRecognizer = (function() { + function RouteRecognizer() { + this.names = new collection_1.Map(); + this.auxRoutes = new collection_1.Map(); + this.matchers = []; + this.redirects = []; + } + RouteRecognizer.prototype.config = function(config) { + var handler; + if (lang_1.isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) { + var suggestedName = config.name[0].toUpperCase() + config.name.substring(1); + throw new exceptions_1.BaseException("Route \"" + config.path + "\" with name \"" + config.name + "\" does not begin with an uppercase letter. Route names should be CamelCase like \"" + suggestedName + "\"."); + } + if (config instanceof route_config_impl_1.AuxRoute) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + var path = config.path.startsWith('/') ? config.path.substring(1) : config.path; + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.auxRoutes.set(path, recognizer); + return recognizer.terminal; + } + if (config instanceof route_config_impl_1.Redirect) { + this.redirects.push(new Redirector(config.path, config.redirectTo)); + return true; + } + if (config instanceof route_config_impl_1.Route) { + handler = new sync_route_handler_1.SyncRouteHandler(config.component, config.data); + } else if (config instanceof route_config_impl_1.AsyncRoute) { + handler = new async_route_handler_1.AsyncRouteHandler(config.loader, config.data); + } + var recognizer = new path_recognizer_1.PathRecognizer(config.path, handler); + this.matchers.forEach(function(matcher) { + if (recognizer.hash == matcher.hash) { + throw new exceptions_1.BaseException("Configuration '" + config.path + "' conflicts with existing route '" + matcher.path + "'"); + } + }); + this.matchers.push(recognizer); + if (lang_1.isPresent(config.name)) { + this.names.set(config.name, recognizer); + } + return recognizer.terminal; + }; + RouteRecognizer.prototype.recognize = function(urlParse) { + var solutions = []; + urlParse = this._redirect(urlParse); + this.matchers.forEach(function(pathRecognizer) { + var pathMatch = pathRecognizer.recognize(urlParse); + if (lang_1.isPresent(pathMatch)) { + solutions.push(pathMatch); + } + }); + return solutions; + }; + RouteRecognizer.prototype._redirect = function(urlParse) { + for (var i = 0; i < this.redirects.length; i += 1) { + var redirector = this.redirects[i]; + var redirectedUrl = redirector.redirect(urlParse); + if (lang_1.isPresent(redirectedUrl)) { + return redirectedUrl; + } + } + return urlParse; + }; + RouteRecognizer.prototype.recognizeAuxiliary = function(urlParse) { + var pathRecognizer = this.auxRoutes.get(urlParse.path); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.recognize(urlParse); + }; + RouteRecognizer.prototype.hasRoute = function(name) { + return this.names.has(name); + }; + RouteRecognizer.prototype.generate = function(name, params) { + var pathRecognizer = this.names.get(name); + if (lang_1.isBlank(pathRecognizer)) { + return null; + } + return pathRecognizer.generate(params); + }; + return RouteRecognizer; + })(); + exports.RouteRecognizer = RouteRecognizer; + var Redirector = (function() { + function Redirector(path, redirectTo) { + this.segments = []; + this.toSegments = []; + if (path.startsWith('/')) { + path = path.substring(1); + } + this.segments = path.split('/'); + if (redirectTo.startsWith('/')) { + redirectTo = redirectTo.substring(1); + } + this.toSegments = redirectTo.split('/'); + } + Redirector.prototype.redirect = function(urlParse) { + for (var i = 0; i < this.segments.length; i += 1) { + if (lang_1.isBlank(urlParse)) { + return null; + } + var segment = this.segments[i]; + if (segment != urlParse.path) { + return null; + } + urlParse = urlParse.child; + } + for (var i = this.toSegments.length - 1; i >= 0; i -= 1) { + var segment = this.toSegments[i]; + urlParse = new url_parser_1.Url(segment, urlParse); + } + return urlParse; + }; + return Redirector; + })(); + exports.Redirector = Redirector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/route_registry", ["angular2/src/router/route_recognizer", "angular2/src/router/instruction", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/route_config_impl", "angular2/src/core/reflection/reflection", "angular2/angular2", "angular2/src/router/route_config_nomalizer", "angular2/src/router/url_parser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var route_recognizer_1 = require("angular2/src/router/route_recognizer"); + var instruction_1 = require("angular2/src/router/instruction"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var route_config_impl_1 = require("angular2/src/router/route_config_impl"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var angular2_1 = require("angular2/angular2"); + var route_config_nomalizer_1 = require("angular2/src/router/route_config_nomalizer"); + var url_parser_1 = require("angular2/src/router/url_parser"); + var _resolveToNull = async_1.PromiseWrapper.resolve(null); + var RouteRegistry = (function() { + function RouteRegistry() { + this._rules = new collection_1.Map(); + } + RouteRegistry.prototype.config = function(parentComponent, config) { + config = route_config_nomalizer_1.normalizeRouteConfig(config); + if (config instanceof route_config_impl_1.Route) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } else if (config instanceof route_config_impl_1.AuxRoute) { + route_config_nomalizer_1.assertComponentExists(config.component, config.path); + } + var recognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(recognizer)) { + recognizer = new route_recognizer_1.RouteRecognizer(); + this._rules.set(parentComponent, recognizer); + } + var terminal = recognizer.config(config); + if (config instanceof route_config_impl_1.Route) { + if (terminal) { + assertTerminalComponent(config.component, config.path); + } else { + this.configFromComponent(config.component); + } + } + }; + RouteRegistry.prototype.configFromComponent = function(component) { + var _this = this; + if (!lang_1.isType(component)) { + return ; + } + if (this._rules.has(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + var routeCfgs = annotation.configs; + routeCfgs.forEach(function(config) { + return _this.config(component, config); + }); + } + } + } + }; + RouteRegistry.prototype.recognize = function(url, parentComponent) { + var parsedUrl = url_parser_1.parser.parse(url); + return this._recognize(parsedUrl, parentComponent); + }; + RouteRegistry.prototype._recognize = function(parsedUrl, parentComponent) { + var _this = this; + return this._recognizePrimaryRoute(parsedUrl, parentComponent).then(function(instruction) { + return _this._completeAuxiliaryRouteMatches(instruction, parentComponent); + }); + }; + RouteRegistry.prototype._recognizePrimaryRoute = function(parsedUrl, parentComponent) { + var _this = this; + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return _resolveToNull; + } + var possibleMatches = componentRecognizer.recognize(parsedUrl); + var matchPromises = possibleMatches.map(function(candidate) { + return _this._completePrimaryRouteMatch(candidate); + }); + return async_1.PromiseWrapper.all(matchPromises).then(mostSpecific); + }; + RouteRegistry.prototype._completePrimaryRouteMatch = function(partialMatch) { + var _this = this; + var instruction = partialMatch.instruction; + return instruction.resolveComponentType().then(function(componentType) { + _this.configFromComponent(componentType); + if (instruction.terminal) { + return new instruction_1.PrimaryInstruction(instruction, null, partialMatch.remainingAux); + } + return _this._recognizePrimaryRoute(partialMatch.remaining, componentType).then(function(childInstruction) { + if (lang_1.isBlank(childInstruction)) { + return null; + } else { + return new instruction_1.PrimaryInstruction(instruction, childInstruction, partialMatch.remainingAux); + } + }); + }); + }; + RouteRegistry.prototype._completeAuxiliaryRouteMatches = function(instruction, parentComponent) { + var _this = this; + if (lang_1.isBlank(instruction)) { + return _resolveToNull; + } + var componentRecognizer = this._rules.get(parentComponent); + var auxInstructions = {}; + var promises = instruction.auxUrls.map(function(auxSegment) { + var match = componentRecognizer.recognizeAuxiliary(auxSegment); + if (lang_1.isBlank(match)) { + return _resolveToNull; + } + return _this._completePrimaryRouteMatch(match).then(function(auxInstruction) { + if (lang_1.isPresent(auxInstruction)) { + return _this._completeAuxiliaryRouteMatches(auxInstruction, parentComponent).then(function(finishedAuxRoute) { + auxInstructions[auxSegment.path] = finishedAuxRoute; + }); + } + }); + }); + return async_1.PromiseWrapper.all(promises).then(function(_) { + if (lang_1.isBlank(instruction.child)) { + return new instruction_1.Instruction(instruction.component, null, auxInstructions); + } + return _this._completeAuxiliaryRouteMatches(instruction.child, instruction.component.componentType).then(function(completeChild) { + return new instruction_1.Instruction(instruction.component, completeChild, auxInstructions); + }); + }); + }; + RouteRegistry.prototype.generate = function(linkParams, parentComponent) { + var segments = []; + var componentCursor = parentComponent; + var lastInstructionIsTerminal = false; + for (var i = 0; i < linkParams.length; i += 1) { + var segment = linkParams[i]; + if (lang_1.isBlank(componentCursor)) { + throw new exceptions_1.BaseException("Could not find route named \"" + segment + "\"."); + } + if (!lang_1.isString(segment)) { + throw new exceptions_1.BaseException("Unexpected segment \"" + segment + "\" in link DSL. Expected a string."); + } else if (segment == '' || segment == '.' || segment == '..') { + throw new exceptions_1.BaseException("\"" + segment + "/\" is only allowed at the beginning of a link DSL."); + } + var params = {}; + if (i + 1 < linkParams.length) { + var nextSegment = linkParams[i + 1]; + if (lang_1.isStringMap(nextSegment)) { + params = nextSegment; + i += 1; + } + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route config."); + } + var response = componentRecognizer.generate(segment, params); + if (lang_1.isBlank(response)) { + throw new exceptions_1.BaseException("Component \"" + lang_1.getTypeNameForDebugging(componentCursor) + "\" has no route named \"" + segment + "\"."); + } + segments.push(response); + componentCursor = response.componentType; + lastInstructionIsTerminal = response.terminal; + } + var instruction = null; + if (!lastInstructionIsTerminal) { + instruction = this._generateRedirects(componentCursor); + if (lang_1.isPresent(instruction)) { + var lastInstruction = instruction; + while (lang_1.isPresent(lastInstruction.child)) { + lastInstruction = lastInstruction.child; + } + lastInstructionIsTerminal = lastInstruction.component.terminal; + } + if (lang_1.isPresent(componentCursor) && !lastInstructionIsTerminal) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" does not resolve to a terminal or async instruction."); + } + } + while (segments.length > 0) { + instruction = new instruction_1.Instruction(segments.pop(), instruction, {}); + } + return instruction; + }; + RouteRegistry.prototype.hasRoute = function(name, parentComponent) { + var componentRecognizer = this._rules.get(parentComponent); + if (lang_1.isBlank(componentRecognizer)) { + return false; + } + return componentRecognizer.hasRoute(name); + }; + RouteRegistry.prototype._generateRedirects = function(componentCursor) { + if (lang_1.isBlank(componentCursor)) { + return null; + } + var componentRecognizer = this._rules.get(componentCursor); + if (lang_1.isBlank(componentRecognizer)) { + return null; + } + for (var i = 0; i < componentRecognizer.redirects.length; i += 1) { + var redirect = componentRecognizer.redirects[i]; + if (redirect.segments.length == 1 && redirect.segments[0] == '') { + var toSegments = url_parser_1.pathSegmentsToUrl(redirect.toSegments); + var matches = componentRecognizer.recognize(toSegments); + var primaryInstruction = collection_1.ListWrapper.maximum(matches, function(match) { + return match.instruction.specificity; + }); + if (lang_1.isPresent(primaryInstruction)) { + var child = this._generateRedirects(primaryInstruction.instruction.componentType); + return new instruction_1.Instruction(primaryInstruction.instruction, child, {}); + } + return null; + } + } + return null; + }; + RouteRegistry = __decorate([angular2_1.Injectable(), __metadata('design:paramtypes', [])], RouteRegistry); + return RouteRegistry; + })(); + exports.RouteRegistry = RouteRegistry; + function mostSpecific(instructions) { + return collection_1.ListWrapper.maximum(instructions, function(instruction) { + return instruction.component.specificity; + }); + } + function assertTerminalComponent(component, path) { + if (!lang_1.isType(component)) { + return ; + } + var annotations = reflection_1.reflector.annotations(component); + if (lang_1.isPresent(annotations)) { + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (annotation instanceof route_config_impl_1.RouteConfig) { + throw new exceptions_1.BaseException("Child routes are not allowed for \"" + path + "\". Use \"...\" on the parent's route path."); + } + } + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/router/instruction", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var instruction_1 = require("angular2/src/router/instruction"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var _resolveToFalse = async_1.PromiseWrapper.resolve(false); + var Router = (function() { + function Router(registry, parent, hostComponent) { + this.registry = registry; + this.parent = parent; + this.hostComponent = hostComponent; + this.navigating = false; + this._currentInstruction = null; + this._currentNavigation = _resolveToTrue; + this._outlet = null; + this._auxRouters = new collection_1.Map(); + this._subject = new async_1.EventEmitter(); + } + Router.prototype.childRouter = function(hostComponent) { + return this._childRouter = new ChildRouter(this, hostComponent); + }; + Router.prototype.auxRouter = function(hostComponent) { + return new ChildRouter(this, hostComponent); + }; + Router.prototype.registerPrimaryOutlet = function(outlet) { + if (lang_1.isPresent(outlet.name)) { + throw new exceptions_1.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet."); + } + this._outlet = outlet; + if (lang_1.isPresent(this._currentInstruction)) { + return this.commit(this._currentInstruction, false); + } + return _resolveToTrue; + }; + Router.prototype.registerAuxOutlet = function(outlet) { + var outletName = outlet.name; + if (lang_1.isBlank(outletName)) { + throw new exceptions_1.BaseException("registerAuxOutlet expects to be called with an outlet with a name."); + } + var router = this.auxRouter(this.hostComponent); + this._auxRouters.set(outletName, router); + router._outlet = outlet; + var auxInstruction; + if (lang_1.isPresent(this._currentInstruction) && lang_1.isPresent(auxInstruction = this._currentInstruction.auxInstruction[outletName])) { + return router.commit(auxInstruction); + } + return _resolveToTrue; + }; + Router.prototype.isRouteActive = function(instruction) { + var router = this; + while (lang_1.isPresent(router.parent) && lang_1.isPresent(instruction.child)) { + router = router.parent; + instruction = instruction.child; + } + return lang_1.isPresent(this._currentInstruction) && this._currentInstruction.component == instruction.component; + }; + Router.prototype.config = function(definitions) { + var _this = this; + definitions.forEach(function(routeDefinition) { + _this.registry.config(_this.hostComponent, routeDefinition); + }); + return this.renavigate(); + }; + Router.prototype.navigate = function(linkParams) { + var instruction = this.generate(linkParams); + return this.navigateByInstruction(instruction, false); + }; + Router.prototype.navigateByUrl = function(url, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this.lastNavigationAttempt = url; + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this.recognize(url).then(function(instruction) { + if (lang_1.isBlank(instruction)) { + return false; + } + return _this._navigate(instruction, _skipLocationChange); + })); + }); + }; + Router.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + if (lang_1.isBlank(instruction)) { + return _resolveToFalse; + } + return this._currentNavigation = this._currentNavigation.then(function(_) { + _this._startNavigating(); + return _this._afterPromiseFinishNavigating(_this._navigate(instruction, _skipLocationChange)); + }); + }; + Router.prototype._navigate = function(instruction, _skipLocationChange) { + var _this = this; + return this._settleInstruction(instruction).then(function(_) { + return _this._canReuse(instruction); + }).then(function(_) { + return _this._canActivate(instruction); + }).then(function(result) { + if (!result) { + return false; + } + return _this._canDeactivate(instruction).then(function(result) { + if (result) { + return _this.commit(instruction, _skipLocationChange).then(function(_) { + _this._emitNavigationFinish(instruction_1.stringifyInstruction(instruction)); + return true; + }); + } + }); + }); + }; + Router.prototype._settleInstruction = function(instruction) { + var _this = this; + var unsettledInstructions = []; + if (lang_1.isBlank(instruction.component.componentType)) { + unsettledInstructions.push(instruction.component.resolveComponentType().then(function(type) { + _this.registry.configFromComponent(type); + })); + } + if (lang_1.isPresent(instruction.child)) { + unsettledInstructions.push(this._settleInstruction(instruction.child)); + } + collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function(instruction, _) { + unsettledInstructions.push(_this._settleInstruction(instruction)); + }); + return async_1.PromiseWrapper.all(unsettledInstructions); + }; + Router.prototype._emitNavigationFinish = function(url) { + async_1.ObservableWrapper.callNext(this._subject, url); + }; + Router.prototype._afterPromiseFinishNavigating = function(promise) { + var _this = this; + return async_1.PromiseWrapper.catchError(promise.then(function(_) { + return _this._finishNavigating(); + }), function(err) { + _this._finishNavigating(); + throw err; + }); + }; + Router.prototype._canReuse = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToFalse; + } + return this._outlet.canReuse(instruction.component).then(function(result) { + instruction.component.reuse = result; + if (result && lang_1.isPresent(_this._childRouter) && lang_1.isPresent(instruction.child)) { + return _this._childRouter._canReuse(instruction.child); + } + }); + }; + Router.prototype._canActivate = function(nextInstruction) { + return canActivateOne(nextInstruction, this._currentInstruction); + }; + Router.prototype._canDeactivate = function(instruction) { + var _this = this; + if (lang_1.isBlank(this._outlet)) { + return _resolveToTrue; + } + var next; + var childInstruction = null; + var reuse = false; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + reuse = instruction.component.reuse; + } + if (reuse) { + next = _resolveToTrue; + } else { + next = this._outlet.canDeactivate(componentInstruction); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter._canDeactivate(childInstruction); + } + return true; + }); + }; + Router.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + this._currentInstruction = instruction; + var next = _resolveToTrue; + if (lang_1.isPresent(this._outlet)) { + var componentInstruction = instruction.component; + if (componentInstruction.reuse) { + next = this._outlet.reuse(componentInstruction); + } else { + next = this.deactivate(instruction).then(function(_) { + return _this._outlet.activate(componentInstruction); + }); + } + if (lang_1.isPresent(instruction.child)) { + next = next.then(function(_) { + if (lang_1.isPresent(_this._childRouter)) { + return _this._childRouter.commit(instruction.child); + } + }); + } + } + var promises = []; + this._auxRouters.forEach(function(router, name) { + if (lang_1.isPresent(instruction.auxInstruction[name])) { + promises.push(router.commit(instruction.auxInstruction[name])); + } + }); + return next.then(function(_) { + return async_1.PromiseWrapper.all(promises); + }); + }; + Router.prototype._startNavigating = function() { + this.navigating = true; + }; + Router.prototype._finishNavigating = function() { + this.navigating = false; + }; + Router.prototype.subscribe = function(onNext) { + return async_1.ObservableWrapper.subscribe(this._subject, onNext); + }; + Router.prototype.deactivate = function(instruction) { + var _this = this; + var childInstruction = null; + var componentInstruction = null; + if (lang_1.isPresent(instruction)) { + childInstruction = instruction.child; + componentInstruction = instruction.component; + } + var next = _resolveToTrue; + if (lang_1.isPresent(this._childRouter)) { + next = this._childRouter.deactivate(childInstruction); + } + if (lang_1.isPresent(this._outlet)) { + next = next.then(function(_) { + return _this._outlet.deactivate(componentInstruction); + }); + } + return next; + }; + Router.prototype.recognize = function(url) { + return this.registry.recognize(url, this.hostComponent); + }; + Router.prototype.renavigate = function() { + if (lang_1.isBlank(this.lastNavigationAttempt)) { + return this._currentNavigation; + } + return this.navigateByUrl(this.lastNavigationAttempt); + }; + Router.prototype.generate = function(linkParams) { + var normalizedLinkParams = splitAndFlattenLinkParams(linkParams); + var first = collection_1.ListWrapper.first(normalizedLinkParams); + var rest = collection_1.ListWrapper.slice(normalizedLinkParams, 1); + var router = this; + if (first == '') { + while (lang_1.isPresent(router.parent)) { + router = router.parent; + } + } else if (first == '..') { + router = router.parent; + while (collection_1.ListWrapper.first(rest) == '..') { + rest = collection_1.ListWrapper.slice(rest, 1); + router = router.parent; + if (lang_1.isBlank(router)) { + throw new exceptions_1.BaseException("Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" has too many \"../\" segments."); + } + } + } else if (first != '.') { + var childRouteExists = this.registry.hasRoute(first, this.hostComponent); + var parentRouteExists = lang_1.isPresent(this.parent) && this.registry.hasRoute(first, this.parent.hostComponent); + if (parentRouteExists && childRouteExists) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" is ambiguous, use \"./\" or \"../\" to disambiguate."; + throw new exceptions_1.BaseException(msg); + } + if (parentRouteExists) { + router = this.parent; + } + rest = linkParams; + } + if (rest[rest.length - 1] == '') { + rest.pop(); + } + if (rest.length < 1) { + var msg = "Link \"" + collection_1.ListWrapper.toJSON(linkParams) + "\" must include a route name."; + throw new exceptions_1.BaseException(msg); + } + var nextInstruction = this.registry.generate(rest, router.hostComponent); + var url = []; + var parent = router.parent; + while (lang_1.isPresent(parent)) { + url.unshift(parent._currentInstruction); + parent = parent.parent; + } + while (url.length > 0) { + nextInstruction = url.pop().replaceChild(nextInstruction); + } + return nextInstruction; + }; + return Router; + })(); + exports.Router = Router; + var RootRouter = (function(_super) { + __extends(RootRouter, _super); + function RootRouter(registry, location, primaryComponent) { + var _this = this; + _super.call(this, registry, null, primaryComponent); + this._location = location; + this._locationSub = this._location.subscribe(function(change) { + return _this.navigateByUrl(change['url'], lang_1.isPresent(change['pop'])); + }); + this.registry.configFromComponent(primaryComponent); + this.navigateByUrl(location.path()); + } + RootRouter.prototype.commit = function(instruction, _skipLocationChange) { + var _this = this; + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + var emitPath = instruction_1.stringifyInstructionPath(instruction); + var emitQuery = instruction_1.stringifyInstructionQuery(instruction); + if (emitPath.length > 0) { + emitPath = '/' + emitPath; + } + var promise = _super.prototype.commit.call(this, instruction); + if (!_skipLocationChange) { + promise = promise.then(function(_) { + _this._location.go(emitPath, emitQuery); + }); + } + return promise; + }; + RootRouter.prototype.dispose = function() { + if (lang_1.isPresent(this._locationSub)) { + async_1.ObservableWrapper.dispose(this._locationSub); + this._locationSub = null; + } + }; + return RootRouter; + })(Router); + exports.RootRouter = RootRouter; + var ChildRouter = (function(_super) { + __extends(ChildRouter, _super); + function ChildRouter(parent, hostComponent) { + _super.call(this, parent.registry, parent, hostComponent); + this.parent = parent; + } + ChildRouter.prototype.navigateByUrl = function(url, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByUrl(url, _skipLocationChange); + }; + ChildRouter.prototype.navigateByInstruction = function(instruction, _skipLocationChange) { + if (_skipLocationChange === void 0) { + _skipLocationChange = false; + } + return this.parent.navigateByInstruction(instruction, _skipLocationChange); + }; + return ChildRouter; + })(Router); + function splitAndFlattenLinkParams(linkParams) { + return linkParams.reduce(function(accumulation, item) { + if (lang_1.isString(item)) { + var strItem = item; + return accumulation.concat(strItem.split('/')); + } + accumulation.push(item); + return accumulation; + }, []); + } + function canActivateOne(nextInstruction, prevInstruction) { + var next = _resolveToTrue; + if (lang_1.isPresent(nextInstruction.child)) { + next = canActivateOne(nextInstruction.child, lang_1.isPresent(prevInstruction) ? prevInstruction.child : null); + } + return next.then(function(result) { + if (result == false) { + return false; + } + if (nextInstruction.component.reuse) { + return true; + } + var hook = route_lifecycle_reflector_1.getCanActivateHook(nextInstruction.component.componentType); + if (lang_1.isPresent(hook)) { + return hook(nextInstruction.component, lang_1.isPresent(prevInstruction) ? prevInstruction.component : null); + } + return true; + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/router/router_outlet", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/angular2", "angular2/src/router/router", "angular2/src/router/instruction", "angular2/src/router/lifecycle_annotations", "angular2/src/router/route_lifecycle_reflector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var angular2_1 = require("angular2/angular2"); + var routerMod = require("angular2/src/router/router"); + var instruction_1 = require("angular2/src/router/instruction"); + var hookMod = require("angular2/src/router/lifecycle_annotations"); + var route_lifecycle_reflector_1 = require("angular2/src/router/route_lifecycle_reflector"); + var _resolveToTrue = async_1.PromiseWrapper.resolve(true); + var RouterOutlet = (function() { + function RouterOutlet(_elementRef, _loader, _parentRouter, nameAttr) { + this._elementRef = _elementRef; + this._loader = _loader; + this._parentRouter = _parentRouter; + this.name = null; + this._componentRef = null; + this._currentInstruction = null; + if (lang_1.isPresent(nameAttr)) { + this.name = nameAttr; + this._parentRouter.registerAuxOutlet(this); + } else { + this._parentRouter.registerPrimaryOutlet(this); + } + } + RouterOutlet.prototype.activate = function(nextInstruction) { + var _this = this; + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + var componentType = nextInstruction.componentType; + var childRouter = this._parentRouter.childRouter(componentType); + var providers = angular2_1.Injector.resolve([angular2_1.provide(instruction_1.RouteData, {useValue: nextInstruction.routeData}), angular2_1.provide(instruction_1.RouteParams, {useValue: new instruction_1.RouteParams(nextInstruction.params)}), angular2_1.provide(routerMod.Router, {useValue: childRouter})]); + return this._loader.loadNextToLocation(componentType, this._elementRef, providers).then(function(componentRef) { + _this._componentRef = componentRef; + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onActivate, componentType)) { + return _this._componentRef.instance.onActivate(nextInstruction, previousInstruction); + } + }); + }; + RouterOutlet.prototype.reuse = function(nextInstruction) { + var previousInstruction = this._currentInstruction; + this._currentInstruction = nextInstruction; + if (lang_1.isBlank(this._componentRef)) { + throw new exceptions_1.BaseException("Cannot reuse an outlet that does not contain a component."); + } + return async_1.PromiseWrapper.resolve(route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onReuse, this._currentInstruction.componentType) ? this._componentRef.instance.onReuse(nextInstruction, previousInstruction) : true); + }; + RouterOutlet.prototype.deactivate = function(nextInstruction) { + var _this = this; + var next = _resolveToTrue; + if (lang_1.isPresent(this._componentRef) && lang_1.isPresent(this._currentInstruction) && route_lifecycle_reflector_1.hasLifecycleHook(hookMod.onDeactivate, this._currentInstruction.componentType)) { + next = async_1.PromiseWrapper.resolve(this._componentRef.instance.onDeactivate(nextInstruction, this._currentInstruction)); + } + return next.then(function(_) { + if (lang_1.isPresent(_this._componentRef)) { + _this._componentRef.dispose(); + _this._componentRef = null; + } + }); + }; + RouterOutlet.prototype.canDeactivate = function(nextInstruction) { + if (lang_1.isBlank(this._currentInstruction)) { + return _resolveToTrue; + } + if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canDeactivate, this._currentInstruction.componentType)) { + return async_1.PromiseWrapper.resolve(this._componentRef.instance.canDeactivate(nextInstruction, this._currentInstruction)); + } + return _resolveToTrue; + }; + RouterOutlet.prototype.canReuse = function(nextInstruction) { + var result; + if (lang_1.isBlank(this._currentInstruction) || this._currentInstruction.componentType != nextInstruction.componentType) { + result = false; + } else if (route_lifecycle_reflector_1.hasLifecycleHook(hookMod.canReuse, this._currentInstruction.componentType)) { + result = this._componentRef.instance.canReuse(nextInstruction, this._currentInstruction); + } else { + result = nextInstruction == this._currentInstruction || (lang_1.isPresent(nextInstruction.params) && lang_1.isPresent(this._currentInstruction.params) && collection_1.StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params)); + } + return async_1.PromiseWrapper.resolve(result); + }; + RouterOutlet = __decorate([angular2_1.Directive({selector: 'router-outlet'}), __param(3, angular2_1.Attribute('name')), __metadata('design:paramtypes', [angular2_1.ElementRef, angular2_1.DynamicComponentLoader, routerMod.Router, String])], RouterOutlet); + return RouterOutlet; + })(); + exports.RouterOutlet = RouterOutlet; + global.define = __define; + return module.exports; +}); + +System.register("angular2/router", ["angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/instruction", "angular2/src/router/route_registry", "angular2/src/router/location_strategy", "angular2/src/router/hash_location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/location", "angular2/src/router/route_config_decorator", "angular2/src/router/route_definition", "angular2/src/router/lifecycle_annotations", "angular2/src/router/instruction", "angular2/angular2", "angular2/src/router/location_strategy", "angular2/src/router/path_location_strategy", "angular2/src/router/router", "angular2/src/router/router_outlet", "angular2/src/router/router_link", "angular2/src/router/route_registry", "angular2/src/router/location", "angular2/angular2", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var router_1 = require("angular2/src/router/router"); + exports.Router = router_1.Router; + var router_outlet_1 = require("angular2/src/router/router_outlet"); + exports.RouterOutlet = router_outlet_1.RouterOutlet; + var router_link_1 = require("angular2/src/router/router_link"); + exports.RouterLink = router_link_1.RouterLink; + var instruction_1 = require("angular2/src/router/instruction"); + exports.RouteParams = instruction_1.RouteParams; + exports.RouteData = instruction_1.RouteData; + var route_registry_1 = require("angular2/src/router/route_registry"); + exports.RouteRegistry = route_registry_1.RouteRegistry; + var location_strategy_1 = require("angular2/src/router/location_strategy"); + exports.LocationStrategy = location_strategy_1.LocationStrategy; + var hash_location_strategy_1 = require("angular2/src/router/hash_location_strategy"); + exports.HashLocationStrategy = hash_location_strategy_1.HashLocationStrategy; + var path_location_strategy_1 = require("angular2/src/router/path_location_strategy"); + exports.PathLocationStrategy = path_location_strategy_1.PathLocationStrategy; + var location_1 = require("angular2/src/router/location"); + exports.Location = location_1.Location; + exports.APP_BASE_HREF = location_1.APP_BASE_HREF; + __export(require("angular2/src/router/route_config_decorator")); + __export(require("angular2/src/router/route_definition")); + var lifecycle_annotations_1 = require("angular2/src/router/lifecycle_annotations"); + exports.CanActivate = lifecycle_annotations_1.CanActivate; + var instruction_2 = require("angular2/src/router/instruction"); + exports.Instruction = instruction_2.Instruction; + exports.ComponentInstruction = instruction_2.ComponentInstruction; + var angular2_1 = require("angular2/angular2"); + exports.OpaqueToken = angular2_1.OpaqueToken; + var location_strategy_2 = require("angular2/src/router/location_strategy"); + var path_location_strategy_2 = require("angular2/src/router/path_location_strategy"); + var router_2 = require("angular2/src/router/router"); + var router_outlet_2 = require("angular2/src/router/router_outlet"); + var router_link_2 = require("angular2/src/router/router_link"); + var route_registry_2 = require("angular2/src/router/route_registry"); + var location_2 = require("angular2/src/router/location"); + var angular2_2 = require("angular2/angular2"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.ROUTER_PRIMARY_COMPONENT = lang_1.CONST_EXPR(new angular2_2.OpaqueToken('RouterPrimaryComponent')); + exports.ROUTER_DIRECTIVES = lang_1.CONST_EXPR([router_outlet_2.RouterOutlet, router_link_2.RouterLink]); + exports.ROUTER_PROVIDERS = lang_1.CONST_EXPR([route_registry_2.RouteRegistry, lang_1.CONST_EXPR(new angular2_2.Provider(location_strategy_2.LocationStrategy, {useClass: path_location_strategy_2.PathLocationStrategy})), location_2.Location, lang_1.CONST_EXPR(new angular2_2.Provider(router_2.Router, { + useFactory: routerFactory, + deps: lang_1.CONST_EXPR([route_registry_2.RouteRegistry, location_2.Location, exports.ROUTER_PRIMARY_COMPONENT, angular2_2.ApplicationRef]) + })), lang_1.CONST_EXPR(new angular2_2.Provider(exports.ROUTER_PRIMARY_COMPONENT, { + useFactory: routerPrimaryComponentFactory, + deps: lang_1.CONST_EXPR([angular2_2.ApplicationRef]) + }))]); + exports.ROUTER_BINDINGS = exports.ROUTER_PROVIDERS; + function routerFactory(registry, location, primaryComponent, appRef) { + var rootRouter = new router_2.RootRouter(registry, location, primaryComponent); + appRef.registerDisposeListener(function() { + return rootRouter.dispose(); + }); + return rootRouter; + } + function routerPrimaryComponentFactory(app) { + if (app.componentTypes.length == 0) { + throw new exceptions_1.BaseException("Bootstrap at least one component before injecting Router."); + } + return app.componentTypes[0]; + } + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=router.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/testing.js b/2.0.0-alpha.46/testing.js new file mode 100644 index 0000000000..897dfa3c4d --- /dev/null +++ b/2.0.0-alpha.46/testing.js @@ -0,0 +1,2063 @@ +"format register"; +System.register("angular2/src/router/location_strategy", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var LocationStrategy = (function() { + function LocationStrategy() {} + return LocationStrategy; + })(); + exports.LocationStrategy = LocationStrategy; + function normalizeQueryParams(params) { + return (params.length > 0 && params.substring(0, 1) != '?') ? ('?' + params) : params; + } + exports.normalizeQueryParams = normalizeQueryParams; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_mock", ["angular2/src/compiler/xhr", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var xhr_1 = require("angular2/src/compiler/xhr"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var MockXHR = (function(_super) { + __extends(MockXHR, _super); + function MockXHR() { + _super.apply(this, arguments); + this._expectations = []; + this._definitions = new collection_1.Map(); + this._requests = []; + } + MockXHR.prototype.get = function(url) { + var request = new _PendingRequest(url); + this._requests.push(request); + return request.getPromise(); + }; + MockXHR.prototype.expect = function(url, response) { + var expectation = new _Expectation(url, response); + this._expectations.push(expectation); + }; + MockXHR.prototype.when = function(url, response) { + this._definitions.set(url, response); + }; + MockXHR.prototype.flush = function() { + if (this._requests.length === 0) { + throw new exceptions_1.BaseException('No pending requests to flush'); + } + do { + this._processRequest(this._requests.shift()); + } while (this._requests.length > 0); + this.verifyNoOustandingExpectations(); + }; + MockXHR.prototype.verifyNoOustandingExpectations = function() { + if (this._expectations.length === 0) + return ; + var urls = []; + for (var i = 0; i < this._expectations.length; i++) { + var expectation = this._expectations[i]; + urls.push(expectation.url); + } + throw new exceptions_1.BaseException("Unsatisfied requests: " + urls.join(', ')); + }; + MockXHR.prototype._processRequest = function(request) { + var url = request.url; + if (this._expectations.length > 0) { + var expectation = this._expectations[0]; + if (expectation.url == url) { + collection_1.ListWrapper.remove(this._expectations, expectation); + request.complete(expectation.response); + return ; + } + } + if (this._definitions.has(url)) { + var response = this._definitions.get(url); + request.complete(lang_1.normalizeBlank(response)); + return ; + } + throw new exceptions_1.BaseException("Unexpected request " + url); + }; + return MockXHR; + })(xhr_1.XHR); + exports.MockXHR = MockXHR; + var _PendingRequest = (function() { + function _PendingRequest(url) { + this.url = url; + this.completer = async_1.PromiseWrapper.completer(); + } + _PendingRequest.prototype.complete = function(response) { + if (lang_1.isBlank(response)) { + this.completer.reject("Failed to load " + this.url, null); + } else { + this.completer.resolve(response); + } + }; + _PendingRequest.prototype.getPromise = function() { + return this.completer.promise; + }; + return _PendingRequest; + })(); + var _Expectation = (function() { + function _Expectation(url, response) { + this.url = url; + this.response = response; + } + return _Expectation; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/mock/mock_location_strategy", ["angular2/src/facade/async", "angular2/src/router/location_strategy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var async_1 = require("angular2/src/facade/async"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var MockLocationStrategy = (function(_super) { + __extends(MockLocationStrategy, _super); + function MockLocationStrategy() { + _super.call(this); + this.internalBaseHref = '/'; + this.internalPath = '/'; + this.internalTitle = ''; + this.urlChanges = []; + this._subject = new async_1.EventEmitter(); + } + MockLocationStrategy.prototype.simulatePopState = function(url) { + this.internalPath = url; + async_1.ObservableWrapper.callNext(this._subject, null); + }; + MockLocationStrategy.prototype.path = function() { + return this.internalPath; + }; + MockLocationStrategy.prototype.prepareExternalUrl = function(internal) { + return internal; + }; + MockLocationStrategy.prototype.simulateUrlPop = function(pathname) { + async_1.ObservableWrapper.callNext(this._subject, {'url': pathname}); + }; + MockLocationStrategy.prototype.pushState = function(ctx, title, path, query) { + this.internalTitle = title; + var url = path + (query.length > 0 ? ('?' + query) : ''); + this.internalPath = url; + this.urlChanges.push(url); + }; + MockLocationStrategy.prototype.onPopState = function(fn) { + async_1.ObservableWrapper.subscribe(this._subject, fn); + }; + MockLocationStrategy.prototype.getBaseHref = function() { + return this.internalBaseHref; + }; + MockLocationStrategy.prototype.back = function() { + if (this.urlChanges.length > 0) { + this.urlChanges.pop(); + var nextUrl = this.urlChanges.length > 0 ? this.urlChanges[this.urlChanges.length - 1] : ''; + this.simulatePopState(nextUrl); + } + }; + MockLocationStrategy.prototype.forward = function() { + throw 'not implemented'; + }; + return MockLocationStrategy; + })(location_strategy_1.LocationStrategy); + exports.MockLocationStrategy = MockLocationStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/mock/view_resolver_mock", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/linker/view_resolver"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var MockViewResolver = (function(_super) { + __extends(MockViewResolver, _super); + function MockViewResolver() { + _super.call(this); + this._views = new collection_1.Map(); + this._inlineTemplates = new collection_1.Map(); + this._viewCache = new collection_1.Map(); + this._directiveOverrides = new collection_1.Map(); + } + MockViewResolver.prototype.setView = function(component, view) { + this._checkOverrideable(component); + this._views.set(component, view); + }; + MockViewResolver.prototype.setInlineTemplate = function(component, template) { + this._checkOverrideable(component); + this._inlineTemplates.set(component, template); + }; + MockViewResolver.prototype.overrideViewDirective = function(component, from, to) { + this._checkOverrideable(component); + var overrides = this._directiveOverrides.get(component); + if (lang_1.isBlank(overrides)) { + overrides = new collection_1.Map(); + this._directiveOverrides.set(component, overrides); + } + overrides.set(from, to); + }; + MockViewResolver.prototype.resolve = function(component) { + var view = this._viewCache.get(component); + if (lang_1.isPresent(view)) + return view; + view = this._views.get(component); + if (lang_1.isBlank(view)) { + view = _super.prototype.resolve.call(this, component); + } + var directives = view.directives; + var overrides = this._directiveOverrides.get(component); + if (lang_1.isPresent(overrides) && lang_1.isPresent(directives)) { + directives = collection_1.ListWrapper.clone(view.directives); + overrides.forEach(function(to, from) { + var srcIndex = directives.indexOf(from); + if (srcIndex == -1) { + throw new exceptions_1.BaseException("Overriden directive " + lang_1.stringify(from) + " not found in the template of " + lang_1.stringify(component)); + } + directives[srcIndex] = to; + }); + view = new metadata_1.ViewMetadata({ + template: view.template, + templateUrl: view.templateUrl, + directives: directives + }); + } + var inlineTemplate = this._inlineTemplates.get(component); + if (lang_1.isPresent(inlineTemplate)) { + view = new metadata_1.ViewMetadata({ + template: inlineTemplate, + templateUrl: null, + directives: view.directives + }); + } + this._viewCache.set(component, view); + return view; + }; + MockViewResolver.prototype._checkOverrideable = function(component) { + var cached = this._viewCache.get(component); + if (lang_1.isPresent(cached)) { + throw new exceptions_1.BaseException("The component " + lang_1.stringify(component) + " has already been compiled, its configuration can not be changed"); + } + }; + return MockViewResolver; + })(view_resolver_1.ViewResolver); + exports.MockViewResolver = MockViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/mock", ["angular2/src/mock/mock_location_strategy", "angular2/src/router/location_strategy", "angular2/src/mock/view_resolver_mock", "angular2/src/compiler/xhr_mock"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/mock/mock_location_strategy")); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + exports.LocationStrategy = location_strategy_1.LocationStrategy; + var view_resolver_mock_1 = require("angular2/src/mock/view_resolver_mock"); + exports.MockViewResolver = view_resolver_mock_1.MockViewResolver; + var xhr_mock_1 = require("angular2/src/compiler/xhr_mock"); + exports.MockXHR = xhr_mock_1.MockXHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/mock/animation_builder_mock", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/animate/css_animation_builder", "angular2/src/animate/animation", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var animation_1 = require("angular2/src/animate/animation"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var MockAnimationBuilder = (function(_super) { + __extends(MockAnimationBuilder, _super); + function MockAnimationBuilder() { + _super.call(this, null); + } + MockAnimationBuilder.prototype.css = function() { + return new MockCssAnimationBuilder(); + }; + MockAnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], MockAnimationBuilder); + return MockAnimationBuilder; + })(animation_builder_1.AnimationBuilder); + exports.MockAnimationBuilder = MockAnimationBuilder; + var MockCssAnimationBuilder = (function(_super) { + __extends(MockCssAnimationBuilder, _super); + function MockCssAnimationBuilder() { + _super.call(this, null); + } + MockCssAnimationBuilder.prototype.start = function(element) { + return new MockAnimation(element, this.data); + }; + return MockCssAnimationBuilder; + })(css_animation_builder_1.CssAnimationBuilder); + var MockBrowserAbstraction = (function(_super) { + __extends(MockBrowserAbstraction, _super); + function MockBrowserAbstraction() { + _super.apply(this, arguments); + } + MockBrowserAbstraction.prototype.doesElapsedTimeIncludesDelay = function() { + this.elapsedTimeIncludesDelay = false; + }; + return MockBrowserAbstraction; + })(browser_details_1.BrowserDetails); + var MockAnimation = (function(_super) { + __extends(MockAnimation, _super); + function MockAnimation(element, data) { + _super.call(this, element, data, new MockBrowserAbstraction()); + } + MockAnimation.prototype.wait = function(callback) { + this._callback = callback; + }; + MockAnimation.prototype.flush = function() { + this._callback(0); + this._callback = null; + }; + return MockAnimation; + })(animation_1.Animation); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/mock/directive_resolver_mock", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker/directive_resolver"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var MockDirectiveResolver = (function(_super) { + __extends(MockDirectiveResolver, _super); + function MockDirectiveResolver() { + _super.apply(this, arguments); + this._providerOverrides = new collection_1.Map(); + this.viewProviderOverrides = new collection_1.Map(); + } + MockDirectiveResolver.prototype.resolve = function(type) { + var dm = _super.prototype.resolve.call(this, type); + var providerOverrides = this._providerOverrides.get(type); + var viewProviderOverrides = this.viewProviderOverrides.get(type); + var providers = dm.providers; + if (lang_1.isPresent(providerOverrides)) { + providers = dm.providers.concat(providerOverrides); + } + if (dm instanceof metadata_1.ComponentMetadata) { + var viewProviders = dm.viewProviders; + if (lang_1.isPresent(viewProviderOverrides)) { + viewProviders = dm.viewProviders.concat(viewProviderOverrides); + } + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: dm.inputs, + outputs: dm.outputs, + host: dm.host, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: dm.queries, + changeDetection: dm.changeDetection, + providers: providers, + viewProviders: viewProviders + }); + } + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: dm.inputs, + outputs: dm.outputs, + host: dm.host, + providers: providers, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: dm.queries + }); + }; + MockDirectiveResolver.prototype.setBindingsOverride = function(type, bindings) { + this._providerOverrides.set(type, bindings); + }; + MockDirectiveResolver.prototype.setViewBindingsOverride = function(type, viewBindings) { + this.viewProviderOverrides.set(type, viewBindings); + }; + MockDirectiveResolver.prototype.setProvidersOverride = function(type, bindings) { + this._providerOverrides.set(type, bindings); + }; + MockDirectiveResolver.prototype.setViewProvidersOverride = function(type, viewBindings) { + this.viewProviderOverrides.set(type, viewBindings); + }; + return MockDirectiveResolver; + })(directive_resolver_1.DirectiveResolver); + exports.MockDirectiveResolver = MockDirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/mock/ng_zone_mock", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var MockNgZone = (function(_super) { + __extends(MockNgZone, _super); + function MockNgZone() { + _super.call(this, {enableLongStackTrace: false}); + } + MockNgZone.prototype.run = function(fn) { + return fn(); + }; + MockNgZone.prototype.runOutsideAngular = function(fn) { + return fn(); + }; + MockNgZone.prototype.overrideOnEventDone = function(fn, opt_waitForAsync) { + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + this._onEventDone = fn; + }; + MockNgZone.prototype.simulateZoneExit = function() { + this._onEventDone(); + }; + return MockNgZone; + })(ng_zone_1.NgZone); + exports.MockNgZone = MockNgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/utils", ["angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var Log = (function() { + function Log() { + this._result = []; + } + Log.prototype.add = function(value) { + this._result.push(value); + }; + Log.prototype.fn = function(value) { + var _this = this; + return function(a1, a2, a3, a4, a5) { + if (a1 === void 0) { + a1 = null; + } + if (a2 === void 0) { + a2 = null; + } + if (a3 === void 0) { + a3 = null; + } + if (a4 === void 0) { + a4 = null; + } + if (a5 === void 0) { + a5 = null; + } + _this._result.push(value); + }; + }; + Log.prototype.clear = function() { + this._result = []; + }; + Log.prototype.result = function() { + return this._result.join("; "); + }; + return Log; + })(); + exports.Log = Log; + var BrowserDetection = (function() { + function BrowserDetection(ua) { + if (lang_1.isPresent(ua)) { + this._ua = ua; + } else { + this._ua = lang_1.isPresent(dom_adapter_1.DOM) ? dom_adapter_1.DOM.getUserAgent() : ''; + } + } + Object.defineProperty(BrowserDetection.prototype, "isFirefox", { + get: function() { + return this._ua.indexOf('Firefox') > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isAndroid", { + get: function() { + return this._ua.indexOf('Mozilla/5.0') > -1 && this._ua.indexOf('Android') > -1 && this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Chrome') == -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isEdge", { + get: function() { + return this._ua.indexOf('Edge') > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isIE", { + get: function() { + return this._ua.indexOf('Trident') > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isWebkit", { + get: function() { + return this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Edge') == -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isIOS7", { + get: function() { + return this._ua.indexOf('iPhone OS 7') > -1 || this._ua.indexOf('iPad OS 7') > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "isSlow", { + get: function() { + return this.isAndroid || this.isIE || this.isIOS7; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BrowserDetection.prototype, "supportsIntlApi", { + get: function() { + return this._ua.indexOf('Chrome/4') > -1 && this._ua.indexOf('Edge') == -1; + }, + enumerable: true, + configurable: true + }); + return BrowserDetection; + })(); + exports.BrowserDetection = BrowserDetection; + exports.browserDetection = new BrowserDetection(null); + function dispatchEvent(element, eventType) { + dom_adapter_1.DOM.dispatchEvent(element, dom_adapter_1.DOM.createEvent(eventType)); + } + exports.dispatchEvent = dispatchEvent; + function el(html) { + return dom_adapter_1.DOM.firstChild(dom_adapter_1.DOM.content(dom_adapter_1.DOM.createTemplate(html))); + } + exports.el = el; + var _RE_SPECIAL_CHARS = ['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|']; + var _ESCAPE_RE = lang_1.RegExpWrapper.create("[\\" + _RE_SPECIAL_CHARS.join('\\') + "]"); + function containsRegexp(input) { + return lang_1.RegExpWrapper.create(lang_1.StringWrapper.replaceAllMapped(input, _ESCAPE_RE, function(match) { + return ("\\" + match[0]); + })); + } + exports.containsRegexp = containsRegexp; + function normalizeCSS(css) { + css = lang_1.StringWrapper.replaceAll(css, /\s+/g, ' '); + css = lang_1.StringWrapper.replaceAll(css, /:\s/g, ':'); + css = lang_1.StringWrapper.replaceAll(css, /'/g, '"'); + css = lang_1.StringWrapper.replaceAll(css, / }/g, '}'); + css = lang_1.StringWrapper.replaceAllMapped(css, /url\((\"|\s)(.+)(\"|\s)\)(\s*)/g, function(match) { + return ("url(\"" + match[2] + "\")"); + }); + css = lang_1.StringWrapper.replaceAllMapped(css, /\[(.+)=([^"\]]+)\]/g, function(match) { + return ("[" + match[1] + "=\"" + match[2] + "\"]"); + }); + return css; + } + exports.normalizeCSS = normalizeCSS; + var _singleTagWhitelist = ['br', 'hr', 'input']; + function stringifyElement(el) { + var result = ''; + if (dom_adapter_1.DOM.isElementNode(el)) { + var tagName = dom_adapter_1.DOM.tagName(el).toLowerCase(); + result += "<" + tagName; + var attributeMap = dom_adapter_1.DOM.attributeMap(el); + var keys = []; + attributeMap.forEach(function(v, k) { + return keys.push(k); + }); + collection_1.ListWrapper.sort(keys); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var attValue = attributeMap.get(key); + if (!lang_1.isString(attValue)) { + result += " " + key; + } else { + result += " " + key + "=\"" + attValue + "\""; + } + } + result += '>'; + var childrenRoot = dom_adapter_1.DOM.templateAwareRoot(el); + var children = lang_1.isPresent(childrenRoot) ? dom_adapter_1.DOM.childNodes(childrenRoot) : []; + for (var j = 0; j < children.length; j++) { + result += stringifyElement(children[j]); + } + if (!collection_1.ListWrapper.contains(_singleTagWhitelist, tagName)) { + result += ""; + } + } else if (dom_adapter_1.DOM.isCommentNode(el)) { + result += ""; + } else { + result += dom_adapter_1.DOM.getText(el); + } + return result; + } + exports.stringifyElement = stringifyElement; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/api", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.ON_WEB_WORKER = lang_1.CONST_EXPR(new di_1.OpaqueToken('WebWorker.onWebWorker')); + var WebWorkerElementRef = (function() { + function WebWorkerElementRef(renderView, boundElementIndex) { + this.renderView = renderView; + this.boundElementIndex = boundElementIndex; + } + return WebWorkerElementRef; + })(); + exports.WebWorkerElementRef = WebWorkerElementRef; + var WebWorkerTemplateCmd = (function() { + function WebWorkerTemplateCmd() {} + WebWorkerTemplateCmd.prototype.visit = function(visitor, context) { + return null; + }; + return WebWorkerTemplateCmd; + })(); + exports.WebWorkerTemplateCmd = WebWorkerTemplateCmd; + var WebWorkerTextCmd = (function() { + function WebWorkerTextCmd(isBound, ngContentIndex, value) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.value = value; + } + WebWorkerTextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return WebWorkerTextCmd; + })(); + exports.WebWorkerTextCmd = WebWorkerTextCmd; + var WebWorkerNgContentCmd = (function() { + function WebWorkerNgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + } + WebWorkerNgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return WebWorkerNgContentCmd; + })(); + exports.WebWorkerNgContentCmd = WebWorkerNgContentCmd; + var WebWorkerBeginElementCmd = (function() { + function WebWorkerBeginElementCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + } + WebWorkerBeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + return WebWorkerBeginElementCmd; + })(); + exports.WebWorkerBeginElementCmd = WebWorkerBeginElementCmd; + var WebWorkerEndElementCmd = (function() { + function WebWorkerEndElementCmd() {} + WebWorkerEndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + return WebWorkerEndElementCmd; + })(); + exports.WebWorkerEndElementCmd = WebWorkerEndElementCmd; + var WebWorkerBeginComponentCmd = (function() { + function WebWorkerBeginComponentCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, templateId) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.templateId = templateId; + } + WebWorkerBeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + return WebWorkerBeginComponentCmd; + })(); + exports.WebWorkerBeginComponentCmd = WebWorkerBeginComponentCmd; + var WebWorkerEndComponentCmd = (function() { + function WebWorkerEndComponentCmd() {} + WebWorkerEndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + return WebWorkerEndComponentCmd; + })(); + exports.WebWorkerEndComponentCmd = WebWorkerEndComponentCmd; + var WebWorkerEmbeddedTemplateCmd = (function() { + function WebWorkerEmbeddedTemplateCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, isMerged, children) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.isMerged = isMerged; + this.children = children; + } + WebWorkerEmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return WebWorkerEmbeddedTemplateCmd; + })(); + exports.WebWorkerEmbeddedTemplateCmd = WebWorkerEmbeddedTemplateCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_proto_view_ref_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var RenderProtoViewRefStore = (function() { + function RenderProtoViewRefStore(onWebworker) { + this._lookupByIndex = new Map(); + this._lookupByProtoView = new Map(); + this._nextIndex = 0; + this._onWebworker = onWebworker; + } + RenderProtoViewRefStore.prototype.allocate = function() { + var index = this._nextIndex++; + var result = new WebWorkerRenderProtoViewRef(index); + this.store(result, index); + return result; + }; + RenderProtoViewRefStore.prototype.store = function(ref, index) { + this._lookupByProtoView.set(ref, index); + this._lookupByIndex.set(index, ref); + }; + RenderProtoViewRefStore.prototype.deserialize = function(index) { + if (index == null) { + return null; + } + return this._lookupByIndex.get(index); + }; + RenderProtoViewRefStore.prototype.serialize = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebworker) { + return ref.refNumber; + } else { + return this._lookupByProtoView.get(ref); + } + }; + RenderProtoViewRefStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderProtoViewRefStore); + return RenderProtoViewRefStore; + })(); + exports.RenderProtoViewRefStore = RenderProtoViewRefStore; + var WebWorkerRenderProtoViewRef = (function(_super) { + __extends(WebWorkerRenderProtoViewRef, _super); + function WebWorkerRenderProtoViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + return WebWorkerRenderProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.WebWorkerRenderProtoViewRef = WebWorkerRenderProtoViewRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_view_with_fragments_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var collection_1 = require("angular2/src/facade/collection"); + var RenderViewWithFragmentsStore = (function() { + function RenderViewWithFragmentsStore(onWebWorker) { + this._nextIndex = 0; + this._onWebWorker = onWebWorker; + this._lookupByIndex = new Map(); + this._lookupByView = new Map(); + this._viewFragments = new Map(); + } + RenderViewWithFragmentsStore.prototype.allocate = function(fragmentCount) { + var initialIndex = this._nextIndex; + var viewRef = new WebWorkerRenderViewRef(this._nextIndex++); + var fragmentRefs = collection_1.ListWrapper.createGrowableSize(fragmentCount); + for (var i = 0; i < fragmentCount; i++) { + fragmentRefs[i] = new WebWorkerRenderFragmentRef(this._nextIndex++); + } + var renderViewWithFragments = new api_1.RenderViewWithFragments(viewRef, fragmentRefs); + this.store(renderViewWithFragments, initialIndex); + return renderViewWithFragments; + }; + RenderViewWithFragmentsStore.prototype.store = function(view, startIndex) { + var _this = this; + this._lookupByIndex.set(startIndex, view.viewRef); + this._lookupByView.set(view.viewRef, startIndex); + startIndex++; + view.fragmentRefs.forEach(function(ref) { + _this._lookupByIndex.set(startIndex, ref); + _this._lookupByView.set(ref, startIndex); + startIndex++; + }); + this._viewFragments.set(view.viewRef, view.fragmentRefs); + }; + RenderViewWithFragmentsStore.prototype.remove = function(view) { + var _this = this; + this._removeRef(view); + var fragments = this._viewFragments.get(view); + fragments.forEach(function(fragment) { + _this._removeRef(fragment); + }); + this._viewFragments.delete(view); + }; + RenderViewWithFragmentsStore.prototype._removeRef = function(ref) { + var index = this._lookupByView.get(ref); + this._lookupByView.delete(ref); + this._lookupByIndex.delete(index); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderViewRef = function(viewRef) { + return this._serializeRenderFragmentOrViewRef(viewRef); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderFragmentRef = function(fragmentRef) { + return this._serializeRenderFragmentOrViewRef(fragmentRef); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderViewRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderFragmentRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype._retrieve = function(ref) { + if (ref == null) { + return null; + } + if (!this._lookupByIndex.has(ref)) { + return null; + } + return this._lookupByIndex.get(ref); + }; + RenderViewWithFragmentsStore.prototype._serializeRenderFragmentOrViewRef = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebWorker) { + return ref.serialize(); + } else { + return this._lookupByView.get(ref); + } + }; + RenderViewWithFragmentsStore.prototype.serializeViewWithFragments = function(view) { + var _this = this; + if (view == null) { + return null; + } + if (this._onWebWorker) { + return { + 'viewRef': view.viewRef.serialize(), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return val.serialize(); + }) + }; + } else { + return { + 'viewRef': this._lookupByView.get(view.viewRef), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return _this._lookupByView.get(val); + }) + }; + } + }; + RenderViewWithFragmentsStore.prototype.deserializeViewWithFragments = function(obj) { + var _this = this; + if (obj == null) { + return null; + } + var viewRef = this.deserializeRenderViewRef(obj['viewRef']); + var fragments = obj['fragmentRefs'].map(function(val) { + return _this.deserializeRenderFragmentRef(val); + }); + return new api_1.RenderViewWithFragments(viewRef, fragments); + }; + RenderViewWithFragmentsStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderViewWithFragmentsStore); + return RenderViewWithFragmentsStore; + })(); + exports.RenderViewWithFragmentsStore = RenderViewWithFragmentsStore; + var WebWorkerRenderViewRef = (function(_super) { + __extends(WebWorkerRenderViewRef, _super); + function WebWorkerRenderViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderViewRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderViewRef.deserialize = function(ref) { + return new WebWorkerRenderViewRef(ref); + }; + return WebWorkerRenderViewRef; + })(api_1.RenderViewRef); + exports.WebWorkerRenderViewRef = WebWorkerRenderViewRef; + var WebWorkerRenderFragmentRef = (function(_super) { + __extends(WebWorkerRenderFragmentRef, _super); + function WebWorkerRenderFragmentRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderFragmentRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderFragmentRef.deserialize = function(ref) { + return new WebWorkerRenderFragmentRef(ref); + }; + return WebWorkerRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.WebWorkerRenderFragmentRef = WebWorkerRenderFragmentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/matchers", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var _global = (typeof window === 'undefined' ? lang_1.global : window); + exports.expect = _global.expect; + Map.prototype['jasmineToString'] = function() { + var m = this; + if (!m) { + return '' + m; + } + var res = []; + m.forEach(function(v, k) { + res.push(k + ":" + v); + }); + return "{ " + res.join(',') + " }"; + }; + _global.beforeEach(function() { + jasmine.addMatchers({ + toEqual: function(util, customEqualityTesters) { + return {compare: function(actual, expected) { + return {pass: util.equals(actual, expected, [compareMap])}; + }}; + function compareMap(actual, expected) { + if (actual instanceof Map) { + var pass = actual.size === expected.size; + if (pass) { + actual.forEach(function(v, k) { + pass = pass && util.equals(v, expected.get(k)); + }); + } + return pass; + } else { + return undefined; + } + } + }, + toBePromise: function() { + return {compare: function(actual, expectedClass) { + var pass = typeof actual === 'object' && typeof actual.then === 'function'; + return { + pass: pass, + get message() { + return 'Expected ' + actual + ' to be a promise'; + } + }; + }}; + }, + toBeAnInstanceOf: function() { + return {compare: function(actual, expectedClass) { + var pass = typeof actual === 'object' && actual instanceof expectedClass; + return { + pass: pass, + get message() { + return 'Expected ' + actual + ' to be an instance of ' + expectedClass; + } + }; + }}; + }, + toHaveText: function() { + return {compare: function(actual, expectedText) { + var actualText = elementText(actual); + return { + pass: actualText == expectedText, + get message() { + return 'Expected ' + actualText + ' to be equal to ' + expectedText; + } + }; + }}; + }, + toHaveCssClass: function() { + return { + compare: buildError(false), + negativeCompare: buildError(true) + }; + function buildError(isNot) { + return function(actual, className) { + return { + pass: dom_adapter_1.DOM.hasClass(actual, className) == !isNot, + get message() { + return "Expected " + actual.outerHTML + " " + (isNot ? 'not ' : '') + "to contain the CSS class \"" + className + "\""; + } + }; + }; + } + }, + toContainError: function() { + return {compare: function(actual, expectedText) { + var errorMessage = actual.toString(); + return { + pass: errorMessage.indexOf(expectedText) > -1, + get message() { + return 'Expected ' + errorMessage + ' to contain ' + expectedText; + } + }; + }}; + }, + toThrowErrorWith: function() { + return {compare: function(actual, expectedText) { + try { + actual(); + return { + pass: false, + get message() { + return "Was expected to throw, but did not throw"; + } + }; + } catch (e) { + var errorMessage = e.toString(); + return { + pass: errorMessage.indexOf(expectedText) > -1, + get message() { + return 'Expected ' + errorMessage + ' to contain ' + expectedText; + } + }; + } + }}; + }, + toImplement: function() { + return {compare: function(actualObject, expectedInterface) { + var objProps = Object.keys(actualObject.constructor.prototype); + var intProps = Object.keys(expectedInterface.prototype); + var missedMethods = []; + intProps.forEach(function(k) { + if (!actualObject.constructor.prototype[k]) + missedMethods.push(k); + }); + return { + pass: missedMethods.length == 0, + get message() { + return 'Expected ' + actualObject + ' to have the following methods: ' + missedMethods.join(", "); + } + }; + }}; + } + }); + }); + function elementText(n) { + var hasNodes = function(n) { + var children = dom_adapter_1.DOM.childNodes(n); + return children && children.length > 0; + }; + if (n instanceof Array) { + return n.map(elementText).join(""); + } + if (dom_adapter_1.DOM.isCommentNode(n)) { + return ''; + } + if (dom_adapter_1.DOM.isElementNode(n) && dom_adapter_1.DOM.tagName(n) == 'CONTENT') { + return elementText(Array.prototype.slice.apply(dom_adapter_1.DOM.getDistributedNodes(n))); + } + if (dom_adapter_1.DOM.hasShadowRoot(n)) { + return elementText(dom_adapter_1.DOM.childNodesAsList(dom_adapter_1.DOM.getShadowRoot(n))); + } + if (hasNodes(n)) { + return elementText(dom_adapter_1.DOM.childNodesAsList(n)); + } + return dom_adapter_1.DOM.getText(n); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/fake_async", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _scheduler; + var _microtasks = []; + var _pendingPeriodicTimers = []; + var _pendingTimers = []; + function fakeAsync(fn) { + if (lang_1.global.zone._inFakeAsyncZone) { + throw new Error('fakeAsync() calls can not be nested'); + } + var fakeAsyncZone = lang_1.global.zone.fork({ + setTimeout: _setTimeout, + clearTimeout: _clearTimeout, + setInterval: _setInterval, + clearInterval: _clearInterval, + scheduleMicrotask: _scheduleMicrotask, + _inFakeAsyncZone: true + }); + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + _scheduler = new jasmine.DelayedFunctionScheduler(); + clearPendingTimers(); + var res = fakeAsyncZone.run(function() { + var res = fn.apply(void 0, args); + flushMicrotasks(); + return res; + }); + if (_pendingPeriodicTimers.length > 0) { + throw new exceptions_1.BaseException(_pendingPeriodicTimers.length + " periodic timer(s) still in the queue."); + } + if (_pendingTimers.length > 0) { + throw new exceptions_1.BaseException(_pendingTimers.length + " timer(s) still in the queue."); + } + _scheduler = null; + collection_1.ListWrapper.clear(_microtasks); + return res; + }; + } + exports.fakeAsync = fakeAsync; + function clearPendingTimers() { + collection_1.ListWrapper.clear(_microtasks); + collection_1.ListWrapper.clear(_pendingPeriodicTimers); + collection_1.ListWrapper.clear(_pendingTimers); + } + exports.clearPendingTimers = clearPendingTimers; + function tick(millis) { + if (millis === void 0) { + millis = 0; + } + _assertInFakeAsyncZone(); + flushMicrotasks(); + _scheduler.tick(millis); + } + exports.tick = tick; + function flushMicrotasks() { + _assertInFakeAsyncZone(); + while (_microtasks.length > 0) { + var microtask = collection_1.ListWrapper.removeAt(_microtasks, 0); + microtask(); + } + } + exports.flushMicrotasks = flushMicrotasks; + function _setTimeout(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var cb = _fnAndFlush(fn); + var id = _scheduler.scheduleFunction(cb, delay, args); + _pendingTimers.push(id); + _scheduler.scheduleFunction(_dequeueTimer(id), delay); + return id; + } + function _clearTimeout(id) { + _dequeueTimer(id); + return _scheduler.removeFunctionWithId(id); + } + function _setInterval(fn, interval) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var cb = _fnAndFlush(fn); + var id = _scheduler.scheduleFunction(cb, interval, args, true); + _pendingPeriodicTimers.push(id); + return id; + } + function _clearInterval(id) { + collection_1.ListWrapper.remove(_pendingPeriodicTimers, id); + return _scheduler.removeFunctionWithId(id); + } + function _fnAndFlush(fn) { + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + fn.apply(lang_1.global, args); + flushMicrotasks(); + }; + } + function _scheduleMicrotask(microtask) { + _microtasks.push(microtask); + } + function _dequeueTimer(id) { + return function() { + collection_1.ListWrapper.remove(_pendingTimers, id); + }; + } + function _assertInFakeAsyncZone() { + if (!lang_1.global.zone || !lang_1.global.zone._inFakeAsyncZone) { + throw new Error('The code should be running in the fakeAsync zone to call this function'); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/test_component_builder", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/testing/utils", "angular2/src/core/render/render", "angular2/src/core/dom/dom_adapter", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var utils_1 = require("angular2/src/testing/utils"); + var render_1 = require("angular2/src/core/render/render"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var RootTestComponent = (function() { + function RootTestComponent() {} + return RootTestComponent; + })(); + exports.RootTestComponent = RootTestComponent; + var ComponentFixture = (function(_super) { + __extends(ComponentFixture, _super); + function ComponentFixture() { + _super.apply(this, arguments); + } + return ComponentFixture; + })(RootTestComponent); + exports.ComponentFixture = ComponentFixture; + var ComponentFixture_ = (function(_super) { + __extends(ComponentFixture_, _super); + function ComponentFixture_(componentRef) { + _super.call(this); + this.debugElement = new debug_element_1.DebugElement_(view_ref_1.internalView(componentRef.hostView), 0); + this._componentParentView = view_ref_1.internalView(componentRef.hostView); + this._componentRef = componentRef; + } + ComponentFixture_.prototype.detectChanges = function() { + this._componentParentView.changeDetector.detectChanges(); + this._componentParentView.changeDetector.checkNoChanges(); + }; + ComponentFixture_.prototype.destroy = function() { + this._componentRef.dispose(); + }; + return ComponentFixture_; + })(ComponentFixture); + exports.ComponentFixture_ = ComponentFixture_; + var _nextRootElementId = 0; + var TestComponentBuilder = (function() { + function TestComponentBuilder(_injector) { + this._injector = _injector; + this._bindingsOverrides = new Map(); + this._directiveOverrides = new Map(); + this._templateOverrides = new Map(); + this._viewBindingsOverrides = new Map(); + this._viewOverrides = new Map(); + } + TestComponentBuilder.prototype._clone = function() { + var clone = new TestComponentBuilder(this._injector); + clone._viewOverrides = collection_1.MapWrapper.clone(this._viewOverrides); + clone._directiveOverrides = collection_1.MapWrapper.clone(this._directiveOverrides); + clone._templateOverrides = collection_1.MapWrapper.clone(this._templateOverrides); + return clone; + }; + TestComponentBuilder.prototype.overrideTemplate = function(componentType, template) { + var clone = this._clone(); + clone._templateOverrides.set(componentType, template); + return clone; + }; + TestComponentBuilder.prototype.overrideView = function(componentType, view) { + var clone = this._clone(); + clone._viewOverrides.set(componentType, view); + return clone; + }; + TestComponentBuilder.prototype.overrideDirective = function(componentType, from, to) { + var clone = this._clone(); + var overridesForComponent = clone._directiveOverrides.get(componentType); + if (!lang_1.isPresent(overridesForComponent)) { + clone._directiveOverrides.set(componentType, new Map()); + overridesForComponent = clone._directiveOverrides.get(componentType); + } + overridesForComponent.set(from, to); + return clone; + }; + TestComponentBuilder.prototype.overrideProviders = function(type, providers) { + var clone = this._clone(); + clone._bindingsOverrides.set(type, providers); + return clone; + }; + TestComponentBuilder.prototype.overrideBindings = function(type, providers) { + return this.overrideProviders(type, providers); + }; + TestComponentBuilder.prototype.overrideViewProviders = function(type, providers) { + var clone = this._clone(); + clone._viewBindingsOverrides.set(type, providers); + return clone; + }; + TestComponentBuilder.prototype.overrideViewBindings = function(type, providers) { + return this.overrideViewProviders(type, providers); + }; + TestComponentBuilder.prototype.createAsync = function(rootComponentType) { + var mockDirectiveResolver = this._injector.get(directive_resolver_1.DirectiveResolver); + var mockViewResolver = this._injector.get(view_resolver_1.ViewResolver); + this._viewOverrides.forEach(function(view, type) { + return mockViewResolver.setView(type, view); + }); + this._templateOverrides.forEach(function(template, type) { + return mockViewResolver.setInlineTemplate(type, template); + }); + this._directiveOverrides.forEach(function(overrides, component) { + overrides.forEach(function(to, from) { + mockViewResolver.overrideViewDirective(component, from, to); + }); + }); + this._bindingsOverrides.forEach(function(bindings, type) { + return mockDirectiveResolver.setBindingsOverride(type, bindings); + }); + this._viewBindingsOverrides.forEach(function(bindings, type) { + return mockDirectiveResolver.setViewBindingsOverride(type, bindings); + }); + var rootElId = "root" + _nextRootElementId++; + var rootEl = utils_1.el("
"); + var doc = this._injector.get(render_1.DOCUMENT); + var oldRoots = dom_adapter_1.DOM.querySelectorAll(doc, '[id^=root]'); + for (var i = 0; i < oldRoots.length; i++) { + dom_adapter_1.DOM.remove(oldRoots[i]); + } + dom_adapter_1.DOM.appendChild(doc.body, rootEl); + return this._injector.get(dynamic_component_loader_1.DynamicComponentLoader).loadAsRoot(rootComponentType, "#" + rootElId, this._injector).then(function(componentRef) { + return new ComponentFixture_(componentRef); + }); + }; + TestComponentBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [di_1.Injector])], TestComponentBuilder); + return TestComponentBuilder; + })(); + exports.TestComponentBuilder = TestComponentBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/serializer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/core/di", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/core/metadata/view"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var di_1 = require("angular2/src/core/di"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var view_1 = require("angular2/src/core/metadata/view"); + exports.PRIMITIVE = String; + var Serializer = (function() { + function Serializer(_protoViewStore, _renderViewStore) { + this._protoViewStore = _protoViewStore; + this._renderViewStore = _renderViewStore; + } + Serializer.prototype.serialize = function(obj, type) { + var _this = this; + if (!lang_1.isPresent(obj)) { + return null; + } + if (lang_1.isArray(obj)) { + return obj.map(function(v) { + return _this.serialize(v, type); + }); + } + if (type == exports.PRIMITIVE) { + return obj; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.serialize(obj); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.serializeRenderViewRef(obj); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.serializeRenderFragmentRef(obj); + } else if (type == api_2.WebWorkerElementRef) { + return this._serializeWorkerElementRef(obj); + } else if (type == api_2.WebWorkerTemplateCmd) { + return serializeTemplateCmd(obj); + } else if (type === api_1.RenderComponentTemplate) { + return this._serializeRenderTemplate(obj); + } else if (type === view_1.ViewEncapsulation) { + return lang_1.serializeEnum(obj); + } else { + throw new exceptions_1.BaseException("No serializer for " + type.toString()); + } + }; + Serializer.prototype.deserialize = function(map, type, data) { + var _this = this; + if (!lang_1.isPresent(map)) { + return null; + } + if (lang_1.isArray(map)) { + var obj = []; + map.forEach(function(val) { + return obj.push(_this.deserialize(val, type, data)); + }); + return obj; + } + if (type == exports.PRIMITIVE) { + return map; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.deserialize(map); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.deserializeRenderViewRef(map); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.deserializeRenderFragmentRef(map); + } else if (type == api_2.WebWorkerElementRef) { + return this._deserializeWorkerElementRef(map); + } else if (type == api_2.WebWorkerTemplateCmd) { + return deserializeTemplateCmd(map); + } else if (type === api_1.RenderComponentTemplate) { + return this._deserializeRenderTemplate(map); + } else if (type === view_1.ViewEncapsulation) { + return view_1.VIEW_ENCAPSULATION_VALUES[map]; + } else { + throw new exceptions_1.BaseException("No deserializer for " + type.toString()); + } + }; + Serializer.prototype.mapToObject = function(map, type) { + var _this = this; + var object = {}; + var serialize = lang_1.isPresent(type); + map.forEach(function(value, key) { + if (serialize) { + object[key] = _this.serialize(value, type); + } else { + object[key] = value; + } + }); + return object; + }; + Serializer.prototype.objectToMap = function(obj, type, data) { + var _this = this; + if (lang_1.isPresent(type)) { + var map = new collection_1.Map(); + collection_1.StringMapWrapper.forEach(obj, function(val, key) { + map.set(key, _this.deserialize(val, type, data)); + }); + return map; + } else { + return collection_1.MapWrapper.createFromStringMap(obj); + } + }; + Serializer.prototype.allocateRenderViews = function(fragmentCount) { + this._renderViewStore.allocate(fragmentCount); + }; + Serializer.prototype._serializeWorkerElementRef = function(elementRef) { + return { + 'renderView': this.serialize(elementRef.renderView, api_1.RenderViewRef), + 'boundElementIndex': elementRef.boundElementIndex + }; + }; + Serializer.prototype._deserializeWorkerElementRef = function(map) { + return new api_2.WebWorkerElementRef(this.deserialize(map['renderView'], api_1.RenderViewRef), map['boundElementIndex']); + }; + Serializer.prototype._serializeRenderTemplate = function(obj) { + return { + 'id': obj.id, + 'shortId': obj.shortId, + 'encapsulation': this.serialize(obj.encapsulation, view_1.ViewEncapsulation), + 'commands': this.serialize(obj.commands, api_2.WebWorkerTemplateCmd), + 'styles': this.serialize(obj.styles, exports.PRIMITIVE) + }; + }; + Serializer.prototype._deserializeRenderTemplate = function(map) { + return new api_1.RenderComponentTemplate(map['id'], map['shortId'], this.deserialize(map['encapsulation'], view_1.ViewEncapsulation), this.deserialize(map['commands'], api_2.WebWorkerTemplateCmd), this.deserialize(map['styles'], exports.PRIMITIVE)); + }; + Serializer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [render_proto_view_ref_store_1.RenderProtoViewRefStore, render_view_with_fragments_store_1.RenderViewWithFragmentsStore])], Serializer); + return Serializer; + })(); + exports.Serializer = Serializer; + function serializeTemplateCmd(cmd) { + return cmd.visit(RENDER_TEMPLATE_CMD_SERIALIZER, null); + } + function deserializeTemplateCmd(data) { + return RENDER_TEMPLATE_CMD_DESERIALIZERS[data['deserializerIndex']](data); + } + var RenderTemplateCmdSerializer = (function() { + function RenderTemplateCmdSerializer() {} + RenderTemplateCmdSerializer.prototype.visitText = function(cmd, context) { + return { + 'deserializerIndex': 0, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'value': cmd.value + }; + }; + RenderTemplateCmdSerializer.prototype.visitNgContent = function(cmd, context) { + return { + 'deserializerIndex': 1, + 'index': cmd.index, + 'ngContentIndex': cmd.ngContentIndex + }; + }; + RenderTemplateCmdSerializer.prototype.visitBeginElement = function(cmd, context) { + return { + 'deserializerIndex': 2, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndElement = function(context) { + return {'deserializerIndex': 3}; + }; + RenderTemplateCmdSerializer.prototype.visitBeginComponent = function(cmd, context) { + return { + 'deserializerIndex': 4, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'templateId': cmd.templateId + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndComponent = function(context) { + return {'deserializerIndex': 5}; + }; + RenderTemplateCmdSerializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var _this = this; + var children = cmd.children.map(function(child) { + return child.visit(_this, null); + }); + return { + 'deserializerIndex': 6, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'isMerged': cmd.isMerged, + 'children': children + }; + }; + return RenderTemplateCmdSerializer; + })(); + var RENDER_TEMPLATE_CMD_SERIALIZER = new RenderTemplateCmdSerializer(); + var RENDER_TEMPLATE_CMD_DESERIALIZERS = [function(data) { + return new api_2.WebWorkerTextCmd(data['isBound'], data['ngContentIndex'], data['value']); + }, function(data) { + return new api_2.WebWorkerNgContentCmd(data['index'], data['ngContentIndex']); + }, function(data) { + return new api_2.WebWorkerBeginElementCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames']); + }, function(data) { + return new api_2.WebWorkerEndElementCmd(); + }, function(data) { + return new api_2.WebWorkerBeginComponentCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['templateId']); + }, function(data) { + return new api_2.WebWorkerEndComponentCmd(); + }, function(data) { + return new api_2.WebWorkerEmbeddedTemplateCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['isMerged'], data['children'].map(function(childData) { + return deserializeTemplateCmd(childData); + })); + }]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/test_injector", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/mock/animation_builder_mock", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/compiler/xhr", "angular2/src/core/zone/ng_zone", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/mock/directive_resolver_mock", "angular2/src/mock/view_resolver_mock", "angular2/src/mock/mock_location_strategy", "angular2/src/router/location_strategy", "angular2/src/mock/ng_zone_mock", "angular2/src/testing/test_component_builder", "angular2/src/core/di", "angular2/src/core/debug", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/render/api", "angular2/src/core/render/render", "angular2/src/core/application_tokens", "angular2/src/web_workers/shared/serializer", "angular2/src/testing/utils", "angular2/src/compiler/compiler", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var animation_builder_mock_1 = require("angular2/src/mock/animation_builder_mock"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var directive_resolver_mock_1 = require("angular2/src/mock/directive_resolver_mock"); + var view_resolver_mock_1 = require("angular2/src/mock/view_resolver_mock"); + var mock_location_strategy_1 = require("angular2/src/mock/mock_location_strategy"); + var location_strategy_1 = require("angular2/src/router/location_strategy"); + var ng_zone_mock_1 = require("angular2/src/mock/ng_zone_mock"); + var test_component_builder_1 = require("angular2/src/testing/test_component_builder"); + var di_2 = require("angular2/src/core/di"); + var debug_1 = require("angular2/src/core/debug"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var api_1 = require("angular2/src/core/render/api"); + var render_1 = require("angular2/src/core/render/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var utils_1 = require("angular2/src/testing/utils"); + var compiler_1 = require("angular2/src/compiler/compiler"); + var dom_renderer_1 = require("angular2/src/core/render/dom/dom_renderer"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + function _getRootProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector})]; + } + function _getAppBindings() { + var appDoc; + try { + appDoc = dom_adapter_1.DOM.defaultDoc(); + } catch (e) { + appDoc = null; + } + return [compiler_1.compilerProviders(), di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(true, false, true)}), di_1.provide(render_1.DOCUMENT, {useValue: appDoc}), di_1.provide(render_1.DomRenderer, {useClass: dom_renderer_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), di_1.provide(application_tokens_1.APP_ID, {useValue: 'a'}), render_1.DomSharedStylesHost, di_1.provide(render_1.SharedStylesHost, {useExisting: render_1.DomSharedStylesHost}), view_pool_1.AppViewPool, di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, serializer_1.Serializer, debug_1.ELEMENT_PROBE_PROVIDERS, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 500}), proto_view_factory_1.ProtoViewFactory, di_1.provide(directive_resolver_1.DirectiveResolver, {useClass: directive_resolver_mock_1.MockDirectiveResolver}), di_1.provide(view_resolver_1.ViewResolver, {useClass: view_resolver_mock_1.MockViewResolver}), di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), utils_1.Log, di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_}), pipe_resolver_1.PipeResolver, di_1.provide(exceptions_1.ExceptionHandler, {useValue: new exceptions_1.ExceptionHandler(dom_adapter_1.DOM)}), di_1.provide(location_strategy_1.LocationStrategy, {useClass: mock_location_strategy_1.MockLocationStrategy}), di_1.provide(xhr_1.XHR, {useClass: dom_adapter_1.DOM.getXHR()}), test_component_builder_1.TestComponentBuilder, di_1.provide(ng_zone_1.NgZone, {useClass: ng_zone_mock_1.MockNgZone}), di_1.provide(animation_builder_1.AnimationBuilder, {useClass: animation_builder_mock_1.MockAnimationBuilder}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + })]; + } + function createTestInjector(providers) { + var rootInjector = di_2.Injector.resolveAndCreate(_getRootProviders()); + return rootInjector.resolveAndCreateChild(collection_1.ListWrapper.concat(_getAppBindings(), providers)); + } + exports.createTestInjector = createTestInjector; + function inject(tokens, fn) { + return new FunctionWithParamTokens(tokens, fn, false); + } + exports.inject = inject; + function injectAsync(tokens, fn) { + return new FunctionWithParamTokens(tokens, fn, true); + } + exports.injectAsync = injectAsync; + var FunctionWithParamTokens = (function() { + function FunctionWithParamTokens(_tokens, _fn, isAsync) { + this._tokens = _tokens; + this._fn = _fn; + this.isAsync = isAsync; + } + FunctionWithParamTokens.prototype.execute = function(injector) { + var params = this._tokens.map(function(t) { + return injector.get(t); + }); + return lang_1.FunctionWrapper.apply(this._fn, params); + }; + FunctionWithParamTokens.prototype.hasToken = function(token) { + return this._tokens.indexOf(token) > -1; + }; + return FunctionWithParamTokens; + })(); + exports.FunctionWithParamTokens = FunctionWithParamTokens; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/testing/testing", ["angular2/src/facade/lang", "angular2/src/testing/test_injector", "angular2/src/testing/test_injector", "angular2/src/testing/matchers"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var test_injector_1 = require("angular2/src/testing/test_injector"); + var test_injector_2 = require("angular2/src/testing/test_injector"); + exports.inject = test_injector_2.inject; + exports.injectAsync = test_injector_2.injectAsync; + var matchers_1 = require("angular2/src/testing/matchers"); + exports.expect = matchers_1.expect; + var _global = (typeof window === 'undefined' ? lang_1.global : window); + exports.afterEach = _global.afterEach; + exports.describe = _global.describe; + exports.ddescribe = _global.fdescribe; + exports.fdescribe = _global.fdescribe; + exports.xdescribe = _global.xdescribe; + var jsmBeforeEach = _global.beforeEach; + var jsmIt = _global.it; + var jsmIIt = _global.fit; + var jsmXIt = _global.xit; + var testProviders; + var injector; + jsmBeforeEach(function() { + testProviders = []; + injector = null; + }); + function beforeEachProviders(fn) { + jsmBeforeEach(function() { + var providers = fn(); + if (!providers) + return ; + testProviders = testProviders.concat(providers); + if (injector !== null) { + throw new Error('beforeEachProviders was called after the injector had ' + 'been used in a beforeEach or it block. This invalidates the ' + 'test injector'); + } + }); + } + exports.beforeEachProviders = beforeEachProviders; + function _isPromiseLike(input) { + return input && !!(input.then); + } + function _it(jsmFn, name, testFn, testTimeOut) { + var timeOut = testTimeOut; + if (testFn instanceof test_injector_1.FunctionWithParamTokens) { + if (testFn.isAsync) { + jsmFn(name, function(done) { + if (!injector) { + injector = test_injector_1.createTestInjector(testProviders); + } + var returned = testFn.execute(injector); + if (_isPromiseLike(returned)) { + returned.then(done, done.fail); + } else { + done.fail('Error: injectAsync was expected to return a promise, but the ' + ' returned value was: ' + returned); + } + }, timeOut); + } else { + jsmFn(name, function() { + if (!injector) { + injector = test_injector_1.createTestInjector(testProviders); + } + var returned = testFn.execute(injector); + if (_isPromiseLike(returned)) { + throw new Error('inject returned a promise. Did you mean to use injectAsync?'); + } + ; + }); + } + } else { + jsmFn(name, testFn, timeOut); + } + } + function beforeEach(fn) { + if (fn instanceof test_injector_1.FunctionWithParamTokens) { + if (fn.isAsync) { + jsmBeforeEach(function(done) { + if (!injector) { + injector = test_injector_1.createTestInjector(testProviders); + } + var returned = fn.execute(injector); + if (_isPromiseLike(returned)) { + returned.then(done, done.fail); + } else { + done.fail('Error: injectAsync was expected to return a promise, but the ' + ' returned value was: ' + returned); + } + }); + } else { + jsmBeforeEach(function() { + if (!injector) { + injector = test_injector_1.createTestInjector(testProviders); + } + var returned = fn.execute(injector); + if (_isPromiseLike(returned)) { + throw new Error('inject returned a promise. Did you mean to use injectAsync?'); + } + ; + }); + } + } else { + if (fn.length === 0) { + jsmBeforeEach(function() { + fn(); + }); + } else { + jsmBeforeEach(function(done) { + fn(done); + }); + } + } + } + exports.beforeEach = beforeEach; + function it(name, fn, timeOut) { + if (timeOut === void 0) { + timeOut = null; + } + return _it(jsmIt, name, fn, timeOut); + } + exports.it = it; + function xit(name, fn, timeOut) { + if (timeOut === void 0) { + timeOut = null; + } + return _it(jsmXIt, name, fn, timeOut); + } + exports.xit = xit; + function iit(name, fn, timeOut) { + if (timeOut === void 0) { + timeOut = null; + } + return _it(jsmIIt, name, fn, timeOut); + } + exports.iit = iit; + function fit(name, fn, timeOut) { + if (timeOut === void 0) { + timeOut = null; + } + return _it(jsmIIt, name, fn, timeOut); + } + exports.fit = fit; + global.define = __define; + return module.exports; +}); + +System.register("angular2/testing", ["angular2/src/testing/testing", "angular2/src/testing/test_component_builder", "angular2/src/testing/test_injector", "angular2/src/testing/fake_async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/testing/testing")); + var test_component_builder_1 = require("angular2/src/testing/test_component_builder"); + exports.ComponentFixture = test_component_builder_1.ComponentFixture; + exports.RootTestComponent = test_component_builder_1.RootTestComponent; + exports.TestComponentBuilder = test_component_builder_1.TestComponentBuilder; + __export(require("angular2/src/testing/test_injector")); + __export(require("angular2/src/testing/fake_async")); + global.define = __define; + return module.exports; +}); + +//# sourceMappingURL=testing.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/testing.js.map b/2.0.0-alpha.46/testing.js.map new file mode 100644 index 0000000000..fdecc3ef68 --- /dev/null +++ b/2.0.0-alpha.46/testing.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../dev/es5/angular2/src/router/location_strategy.js","../dev/es5/angular2/src/compiler/xhr_mock.js","../dev/es5/angular2/src/mock/mock_location_strategy.js","../dev/es5/angular2/src/mock/view_resolver_mock.js","../dev/es5/angular2/mock.js","../dev/es5/angular2/src/mock/animation_builder_mock.js","../dev/es5/angular2/src/mock/directive_resolver_mock.js","../dev/es5/angular2/src/mock/ng_zone_mock.js","../dev/es5/angular2/src/testing/utils.js","../dev/es5/angular2/src/web_workers/shared/api.js","../dev/es5/angular2/src/web_workers/shared/render_proto_view_ref_store.js","../dev/es5/angular2/src/web_workers/shared/render_view_with_fragments_store.js","../dev/es5/angular2/src/testing/matchers.js","../dev/es5/angular2/src/testing/fake_async.js","../dev/es5/angular2/src/testing/test_component_builder.js","../dev/es5/angular2/src/web_workers/shared/serializer.js","../dev/es5/angular2/src/testing/test_injector.js","../dev/es5/angular2/src/testing/testing.js","../dev/es5/angular2/testing.js"],"names":[],"mappings":";AAAA,KAAK,SAAS,AAAC,CAAC,uCAAsC,CAAG,GAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAnG,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AAezB,AAAI,IAAA,CAAA,gBAAe,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAChC,WAAS,iBAAe,CAAC,AAAC,CAAE,GAC5B;AAAA,AACA,SAAO,iBAAe,CAAC;EAC3B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AAC3C,SAAS,qBAAmB,CAAE,MAAK,CAAG;AAClC,SAAO,CAAA,CAAC,MAAK,OAAO,EAAI,EAAA,CAAA,EAAK,CAAA,MAAK,UAAU,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAA,EAAK,IAAE,CAAC,EAAI,EAAC,GAAE,EAAI,OAAK,CAAC,EAAI,OAAK,CAAC;EACzF;AAAA,AACA,QAAM,qBAAqB,EAAI,qBAAmB,CAAC;AAzBnD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAyByB;AC1B5C,KAAK,SAAS,AAAC,CAAC,gCAA+B,CAAG,EAAC,2BAA0B,CAAE,iCAA+B,CAAE,2BAAyB,CAAE,iCAA+B,CAAE,4BAA0B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAhP,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAClD,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC7B,YAAQ,AAAC,CAAC,OAAM,CAAG,OAAK,CAAC,CAAC;AAC1B,WAAS,QAAM,CAAC,AAAC,CAAE;AACf,WAAK,MAAM,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;AAC7B,SAAG,cAAc,EAAI,GAAC,CAAC;AACvB,SAAG,aAAa,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAC1C,SAAG,UAAU,EAAI,GAAC,CAAC;IACvB;AAAA,AACA,UAAM,UAAU,IAAI,EAAI,UAAU,GAAE,CAAG;AACnC,AAAI,QAAA,CAAA,OAAM,EAAI,IAAI,gBAAc,AAAC,CAAC,GAAE,CAAC,CAAC;AACtC,SAAG,UAAU,KAAK,AAAC,CAAC,OAAM,CAAC,CAAC;AAC5B,WAAO,CAAA,OAAM,WAAW,AAAC,EAAC,CAAC;IAC/B,CAAC;AACD,UAAM,UAAU,OAAO,EAAI,UAAU,GAAE,CAAG,CAAA,QAAO,CAAG;AAChD,AAAI,QAAA,CAAA,WAAU,EAAI,IAAI,aAAW,AAAC,CAAC,GAAE,CAAG,SAAO,CAAC,CAAC;AACjD,SAAG,cAAc,KAAK,AAAC,CAAC,WAAU,CAAC,CAAC;IACxC,CAAC;AACD,UAAM,UAAU,KAAK,EAAI,UAAU,GAAE,CAAG,CAAA,QAAO,CAAG;AAAE,SAAG,aAAa,IAAI,AAAC,CAAC,GAAE,CAAG,SAAO,CAAC,CAAC;IAAE,CAAC;AAC3F,UAAM,UAAU,MAAM,EAAI,UAAS,AAAC,CAAE;AAClC,SAAI,IAAG,UAAU,OAAO,IAAM,EAAA,CAAG;AAC7B,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,8BAA6B,CAAC,CAAC;MACxE;AAAA,AACA,OAAG;AACC,WAAG,gBAAgB,AAAC,CAAC,IAAG,UAAU,MAAM,AAAC,EAAC,CAAC,CAAC;MAChD,QAAS,IAAG,UAAU,OAAO,EAAI,EAAA,EAAE;AACnC,SAAG,+BAA+B,AAAC,EAAC,CAAC;IACzC,CAAC;AACD,UAAM,UAAU,+BAA+B,EAAI,UAAS,AAAC,CAAE;AAC3D,SAAI,IAAG,cAAc,OAAO,IAAM,EAAA;AAC9B,eAAM;AAAA,AACN,QAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,UAAS,GAAA,CAAA,CAAA,EAAI,EAAA,CAAG,CAAA,CAAA,EAAI,CAAA,IAAG,cAAc,OAAO,CAAG,CAAA,CAAA,EAAE,CAAG;AAChD,AAAI,UAAA,CAAA,WAAU,EAAI,CAAA,IAAG,cAAc,CAAE,CAAA,CAAC,CAAC;AACvC,WAAG,KAAK,AAAC,CAAC,WAAU,IAAI,CAAC,CAAC;MAC9B;AAAA,AACA,UAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,wBAAuB,EAAI,CAAA,IAAG,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC,CAAC;IACpF,CAAC;AACD,UAAM,UAAU,gBAAgB,EAAI,UAAU,OAAM,CAAG;AACnD,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,OAAM,IAAI,CAAC;AACrB,SAAI,IAAG,cAAc,OAAO,EAAI,EAAA,CAAG;AAC/B,AAAI,UAAA,CAAA,WAAU,EAAI,CAAA,IAAG,cAAc,CAAE,CAAA,CAAC,CAAC;AACvC,WAAI,WAAU,IAAI,GAAK,IAAE,CAAG;AACxB,qBAAW,YAAY,OAAO,AAAC,CAAC,IAAG,cAAc,CAAG,YAAU,CAAC,CAAC;AAChE,gBAAM,SAAS,AAAC,CAAC,WAAU,SAAS,CAAC,CAAC;AACtC,iBAAM;QACV;AAAA,MACJ;AAAA,AACA,SAAI,IAAG,aAAa,IAAI,AAAC,CAAC,GAAE,CAAC,CAAG;AAC5B,AAAI,UAAA,CAAA,QAAO,EAAI,CAAA,IAAG,aAAa,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;AACzC,cAAM,SAAS,AAAC,CAAC,MAAK,eAAe,AAAC,CAAC,QAAO,CAAC,CAAC,CAAC;AACjD,eAAM;MACV;AAAA,AACA,UAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,qBAAoB,EAAI,IAAE,CAAC,CAAC;IACrE,CAAC;AACD,SAAO,QAAM,CAAC;EAClB,CAAC,AAAC,CAAC,KAAI,IAAI,CAAC,CAAC;AACb,QAAM,QAAQ,EAAI,QAAM,CAAC;AACzB,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC/B,WAAS,gBAAc,CAAE,GAAE,CAAG;AAC1B,SAAG,IAAI,EAAI,IAAE,CAAC;AACd,SAAG,UAAU,EAAI,CAAA,OAAM,eAAe,UAAU,AAAC,EAAC,CAAC;IACvD;AAAA,AACA,kBAAc,UAAU,SAAS,EAAI,UAAU,QAAO,CAAG;AACrD,SAAI,MAAK,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAG;AAC1B,WAAG,UAAU,OAAO,AAAC,CAAC,iBAAgB,EAAI,CAAA,IAAG,IAAI,CAAG,KAAG,CAAC,CAAC;MAC7D,KACK;AACD,WAAG,UAAU,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAC;MACpC;AAAA,IACJ,CAAC;AACD,kBAAc,UAAU,WAAW,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,UAAU,QAAQ,CAAC;IAAE,CAAC;AACrF,SAAO,gBAAc,CAAC;EAC1B,CAAC,AAAC,EAAC,CAAC;AACJ,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC5B,WAAS,aAAW,CAAE,GAAE,CAAG,CAAA,QAAO,CAAG;AACjC,SAAG,IAAI,EAAI,IAAE,CAAC;AACd,SAAG,SAAS,EAAI,SAAO,CAAC;IAC5B;AAAA,AACA,SAAO,aAAW,CAAC;EACvB,CAAC,AAAC,EAAC,CAAC;AAzFJ,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAyFgB;AC1FnC,KAAK,SAAS,AAAC,CAAC,0CAAyC,CAAG,EAAC,2BAA0B,CAAE,wCAAsC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAzK,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAClD,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,OAAM,AAAC,CAAC,uCAAsC,CAAC,CAAC;AAC1E,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC1C,YAAQ,AAAC,CAAC,oBAAmB,CAAG,OAAK,CAAC,CAAC;AACvC,WAAS,qBAAmB,CAAC,AAAC,CAAE;AAC5B,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACjB,SAAG,iBAAiB,EAAI,IAAE,CAAC;AAC3B,SAAG,aAAa,EAAI,IAAE,CAAC;AACvB,SAAG,cAAc,EAAI,GAAC,CAAC;AACvB,SAAG,WAAW,EAAI,GAAC,CAAC;AAEpB,SAAG,SAAS,EAAI,IAAI,CAAA,OAAM,aAAa,AAAC,EAAC,CAAC;IAC9C;AAAA,AACA,uBAAmB,UAAU,iBAAiB,EAAI,UAAU,GAAE,CAAG;AAC7D,SAAG,aAAa,EAAI,IAAE,CAAC;AACvB,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG,KAAG,CAAC,CAAC;IAC3D,CAAC;AACD,uBAAmB,UAAU,KAAK,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,aAAa,CAAC;IAAE,CAAC;AAC/E,uBAAmB,UAAU,mBAAmB,EAAI,UAAU,QAAO,CAAG;AAAE,WAAO,SAAO,CAAC;IAAE,CAAC;AAC5F,uBAAmB,UAAU,eAAe,EAAI,UAAU,QAAO,CAAG;AAChE,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG,EAAE,KAAI,CAAG,SAAO,CAAE,CAAC,CAAC;IAC1E,CAAC;AACD,uBAAmB,UAAU,UAAU,EAAI,UAAU,GAAE,CAAG,CAAA,KAAI,CAAG,CAAA,IAAG,CAAG,CAAA,KAAI,CAAG;AAC1E,SAAG,cAAc,EAAI,MAAI,CAAC;AAC1B,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,IAAG,EAAI,EAAC,KAAI,OAAO,EAAI,EAAA,CAAA,CAAI,EAAC,GAAE,EAAI,MAAI,CAAC,EAAI,GAAC,CAAC,CAAC;AACxD,SAAG,aAAa,EAAI,IAAE,CAAC;AACvB,SAAG,WAAW,KAAK,AAAC,CAAC,GAAE,CAAC,CAAC;IAC7B,CAAC;AACD,uBAAmB,UAAU,WAAW,EAAI,UAAU,EAAC,CAAG;AAAE,YAAM,kBAAkB,UAAU,AAAC,CAAC,IAAG,SAAS,CAAG,GAAC,CAAC,CAAC;IAAE,CAAC;AACrH,uBAAmB,UAAU,YAAY,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,iBAAiB,CAAC;IAAE,CAAC;AAC1F,uBAAmB,UAAU,KAAK,EAAI,UAAS,AAAC,CAAE;AAC9C,SAAI,IAAG,WAAW,OAAO,EAAI,EAAA,CAAG;AAC5B,WAAG,WAAW,IAAI,AAAC,EAAC,CAAC;AACrB,AAAI,UAAA,CAAA,OAAM,EAAI,CAAA,IAAG,WAAW,OAAO,EAAI,EAAA,CAAA,CAAI,CAAA,IAAG,WAAW,CAAE,IAAG,WAAW,OAAO,EAAI,EAAA,CAAC,EAAI,GAAC,CAAC;AAC3F,WAAG,iBAAiB,AAAC,CAAC,OAAM,CAAC,CAAC;MAClC;AAAA,IACJ,CAAC;AACD,uBAAmB,UAAU,QAAQ,EAAI,UAAS,AAAC,CAAE;AAAE,UAAM,kBAAgB,CAAC;IAAE,CAAC;AACjF,SAAO,qBAAmB,CAAC;EAC/B,CAAC,AAAC,CAAC,mBAAkB,iBAAiB,CAAC,CAAC;AACxC,QAAM,qBAAqB,EAAI,qBAAmB,CAAC;AA7CnD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA6C8B;AC9CjD,KAAK,SAAS,AAAC,CAAC,sCAAqC,CAAG,EAAC,gCAA+B,CAAE,2BAAyB,CAAE,iCAA+B,CAAE,6BAA2B,CAAE,yCAAuC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAApQ,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,4BAAiB,CAAC,CAAC;AAC5C,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AACvE,AAAI,IAAA,CAAA,gBAAe,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AACtC,YAAQ,AAAC,CAAC,gBAAe,CAAG,OAAK,CAAC,CAAC;AACnC,WAAS,iBAAe,CAAC,AAAC,CAAE;AACxB,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AAEjB,SAAG,OAAO,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAEpC,SAAG,iBAAiB,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAE9C,SAAG,WAAW,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAExC,SAAG,oBAAoB,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;IACrD;AAAA,AAOA,mBAAe,UAAU,QAAQ,EAAI,UAAU,SAAQ,CAAG,CAAA,IAAG,CAAG;AAC5D,SAAG,mBAAmB,AAAC,CAAC,SAAQ,CAAC,CAAC;AAClC,SAAG,OAAO,IAAI,AAAC,CAAC,SAAQ,CAAG,KAAG,CAAC,CAAC;IACpC,CAAC;AAOD,mBAAe,UAAU,kBAAkB,EAAI,UAAU,SAAQ,CAAG,CAAA,QAAO,CAAG;AAC1E,SAAG,mBAAmB,AAAC,CAAC,SAAQ,CAAC,CAAC;AAClC,SAAG,iBAAiB,IAAI,AAAC,CAAC,SAAQ,CAAG,SAAO,CAAC,CAAC;IAClD,CAAC;AAQD,mBAAe,UAAU,sBAAsB,EAAI,UAAU,SAAQ,CAAG,CAAA,IAAG,CAAG,CAAA,EAAC,CAAG;AAC9E,SAAG,mBAAmB,AAAC,CAAC,SAAQ,CAAC,CAAC;AAClC,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,IAAG,oBAAoB,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AACvD,SAAI,MAAK,QAAQ,AAAC,CAAC,SAAQ,CAAC,CAAG;AAC3B,gBAAQ,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAClC,WAAG,oBAAoB,IAAI,AAAC,CAAC,SAAQ,CAAG,UAAQ,CAAC,CAAC;MACtD;AAAA,AACA,cAAQ,IAAI,AAAC,CAAC,IAAG,CAAG,GAAC,CAAC,CAAC;IAC3B,CAAC;AAYD,mBAAe,UAAU,QAAQ,EAAI,UAAU,SAAQ,CAAG;AACtD,AAAI,QAAA,CAAA,IAAG,EAAI,CAAA,IAAG,WAAW,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AACzC,SAAI,MAAK,UAAU,AAAC,CAAC,IAAG,CAAC;AACrB,aAAO,KAAG,CAAC;AAAA,AACf,SAAG,EAAI,CAAA,IAAG,OAAO,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AACjC,SAAI,MAAK,QAAQ,AAAC,CAAC,IAAG,CAAC,CAAG;AACtB,WAAG,EAAI,CAAA,MAAK,UAAU,QAAQ,KAAK,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;MACzD;AAAA,AACI,QAAA,CAAA,UAAS,EAAI,CAAA,IAAG,WAAW,CAAC;AAChC,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,IAAG,oBAAoB,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AACvD,SAAI,MAAK,UAAU,AAAC,CAAC,SAAQ,CAAC,CAAA,EAAK,CAAA,MAAK,UAAU,AAAC,CAAC,UAAS,CAAC,CAAG;AAC7D,iBAAS,EAAI,CAAA,YAAW,YAAY,MAAM,AAAC,CAAC,IAAG,WAAW,CAAC,CAAC;AAC5D,gBAAQ,QAAQ,AAAC,CAAC,SAAU,EAAC,CAAG,CAAA,IAAG,CAAG;AAClC,AAAI,YAAA,CAAA,QAAO,EAAI,CAAA,UAAS,QAAQ,AAAC,CAAC,IAAG,CAAC,CAAC;AACvC,aAAI,QAAO,GAAK,EAAC,CAAA,CAAG;AAChB,gBAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,sBAAqB,EAAI,CAAA,MAAK,UAAU,AAAC,CAAC,IAAG,CAAC,CAAA,CAAI,iCAA+B,CAAA,CAAI,CAAA,MAAK,UAAU,AAAC,CAAC,SAAQ,CAAC,CAAC,CAAC;UAC1J;AAAA,AACA,mBAAS,CAAE,QAAO,CAAC,EAAI,GAAC,CAAC;QAC7B,CAAC,CAAC;AACF,WAAG,EAAI,IAAI,CAAA,UAAS,aAAa,AAAC,CAAC;AAAE,iBAAO,CAAG,CAAA,IAAG,SAAS;AAAG,oBAAU,CAAG,CAAA,IAAG,YAAY;AAAG,mBAAS,CAAG,WAAS;AAAA,QAAE,CAAC,CAAC;MAC1H;AAAA,AACI,QAAA,CAAA,cAAa,EAAI,CAAA,IAAG,iBAAiB,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AACzD,SAAI,MAAK,UAAU,AAAC,CAAC,cAAa,CAAC,CAAG;AAClC,WAAG,EAAI,IAAI,CAAA,UAAS,aAAa,AAAC,CAAC;AAAE,iBAAO,CAAG,eAAa;AAAG,oBAAU,CAAG,KAAG;AAAG,mBAAS,CAAG,CAAA,IAAG,WAAW;AAAA,QAAE,CAAC,CAAC;MACpH;AAAA,AACA,SAAG,WAAW,IAAI,AAAC,CAAC,SAAQ,CAAG,KAAG,CAAC,CAAC;AACpC,WAAO,KAAG,CAAC;IACf,CAAC;AAWD,mBAAe,UAAU,mBAAmB,EAAI,UAAU,SAAQ,CAAG;AACjE,AAAI,QAAA,CAAA,MAAK,EAAI,CAAA,IAAG,WAAW,IAAI,AAAC,CAAC,SAAQ,CAAC,CAAC;AAC3C,SAAI,MAAK,UAAU,AAAC,CAAC,MAAK,CAAC,CAAG;AAC1B,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,gBAAe,EAAI,CAAA,MAAK,UAAU,AAAC,CAAC,SAAQ,CAAC,CAAA,CAAI,mEAAiE,CAAC,CAAC;MAC7J;AAAA,IACJ,CAAC;AACD,SAAO,iBAAe,CAAC;EAC3B,CAAC,AAAC,CAAC,eAAc,aAAa,CAAC,CAAC;AAChC,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AApH3C,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAoH0B;ACrH7C,KAAK,SAAS,AAAC,CAAC,eAAc,CAAG,EAAC,0CAAyC,CAAE,wCAAsC,CAAE,uCAAqC,CAAE,iCAA+B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAArO,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,SAAS,SAAO,CAAE,CAAA,CAAG;AACjB,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAC,OAAM,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,cAAM,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,EACtE;AAAA,AACA,SAAO,AAAC,CAAC,OAAM,AAAC,CAAC,0CAAkC,CAAC,CAAC,CAAC;AACtD,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,OAAM,AAAC,CAAC,uCAA+B,CAAC,CAAC;AACnE,QAAM,iBAAiB,EAAI,CAAA,mBAAkB,iBAAiB,CAAC;AAC/D,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,sCAAqC,CAAC,CAAC;AAC1E,QAAM,iBAAiB,EAAI,CAAA,oBAAmB,iBAAiB,CAAC;AAChE,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC1D,QAAM,QAAQ,EAAI,CAAA,UAAS,QAAQ,CAAC;AATpC,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AASY;ACV/B,KAAK,SAAS,AAAC,CAAC,0CAAyC,CAAG,EAAC,sBAAqB,CAAE,yCAAuC,CAAE,6CAA2C,CAAE,iCAA+B,CAAE,uCAAqC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA1R,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;AAAA,AACjI,WAAQ,SAAQ,OAAO;AACnB,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,OAAK,CAAC,CAAC;AAAA,AAC1F,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,CAAG,KAAK,EAAA,CAAC;QAAE,CAAG,KAAK,EAAA,CAAC,CAAC;AAAA,AACvG,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,KAAG,CAAC,CAAC;AAAA,IACzG;EACJ,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AAC3E,AAAI,IAAA,CAAA,uBAAsB,EAAI,CAAA,OAAM,AAAC,CAAC,4CAA2C,CAAC,CAAC;AACnF,AAAI,IAAA,CAAA,WAAU,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC3D,AAAI,IAAA,CAAA,iBAAgB,EAAI,CAAA,OAAM,AAAC,CAAC,sCAAqC,CAAC,CAAC;AACvE,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC1C,YAAQ,AAAC,CAAC,oBAAmB,CAAG,OAAK,CAAC,CAAC;AACvC,WAAS,qBAAmB,CAAC,AAAC,CAAE;AAC5B,WAAK,KAAK,AAAC,CAAC,IAAG,CAAG,KAAG,CAAC,CAAC;IAC3B;AAAA,AACA,uBAAmB,UAAU,IAAI,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,IAAI,wBAAsB,AAAC,EAAC,CAAC;IAAE,CAAC;AAC1F,uBAAmB,EAAI,CAAA,UAAS,AAAC,CAAC,CAC9B,IAAG,WAAW,AAAC,EAAC,CAChB,CAAA,UAAS,AAAC,CAAC,mBAAkB,CAAG,GAAC,CAAC,CACtC,CAAG,qBAAmB,CAAC,CAAC;AACxB,SAAO,qBAAmB,CAAC;EAC/B,CAAC,AAAC,CAAC,mBAAkB,iBAAiB,CAAC,CAAC;AACxC,QAAM,qBAAqB,EAAI,qBAAmB,CAAC;AACnD,AAAI,IAAA,CAAA,uBAAsB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC7C,YAAQ,AAAC,CAAC,uBAAsB,CAAG,OAAK,CAAC,CAAC;AAC1C,WAAS,wBAAsB,CAAC,AAAC,CAAE;AAC/B,WAAK,KAAK,AAAC,CAAC,IAAG,CAAG,KAAG,CAAC,CAAC;IAC3B;AAAA,AACA,0BAAsB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG;AAAE,WAAO,IAAI,cAAY,AAAC,CAAC,OAAM,CAAG,CAAA,IAAG,KAAK,CAAC,CAAC;IAAE,CAAC;AAC9G,SAAO,wBAAsB,CAAC;EAClC,CAAC,AAAC,CAAC,uBAAsB,oBAAoB,CAAC,CAAC;AAC/C,AAAI,IAAA,CAAA,sBAAqB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC5C,YAAQ,AAAC,CAAC,sBAAqB,CAAG,OAAK,CAAC,CAAC;AACzC,WAAS,uBAAqB,CAAC,AAAC,CAAE;AAC9B,WAAK,MAAM,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;IACjC;AAAA,AACA,yBAAqB,UAAU,6BAA6B,EAAI,UAAS,AAAC,CAAE;AAAE,SAAG,yBAAyB,EAAI,MAAI,CAAC;IAAE,CAAC;AACtH,SAAO,uBAAqB,CAAC;EACjC,CAAC,AAAC,CAAC,iBAAgB,eAAe,CAAC,CAAC;AACpC,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AACnC,YAAQ,AAAC,CAAC,aAAY,CAAG,OAAK,CAAC,CAAC;AAChC,WAAS,cAAY,CAAE,OAAM,CAAG,CAAA,IAAG,CAAG;AAClC,WAAK,KAAK,AAAC,CAAC,IAAG,CAAG,QAAM,CAAG,KAAG,CAAG,IAAI,uBAAqB,AAAC,EAAC,CAAC,CAAC;IAClE;AAAA,AACA,gBAAY,UAAU,KAAK,EAAI,UAAU,QAAO,CAAG;AAAE,SAAG,UAAU,EAAI,SAAO,CAAC;IAAE,CAAC;AACjF,gBAAY,UAAU,MAAM,EAAI,UAAS,AAAC,CAAE;AACxC,SAAG,UAAU,AAAC,CAAC,CAAA,CAAC,CAAC;AACjB,SAAG,UAAU,EAAI,KAAG,CAAC;IACzB,CAAC;AACD,SAAO,cAAY,CAAC;EACxB,CAAC,AAAC,CAAC,WAAU,UAAU,CAAC,CAAC;AA7DzB,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA6D8B;AC9DjD,KAAK,SAAS,AAAC,CAAC,2CAA0C,CAAG,EAAC,gCAA+B,CAAE,2BAAyB,CAAE,6BAA2B,CAAE,8CAA4C,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA7O,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,4BAAiB,CAAC,CAAC;AAC5C,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAA4C,CAAC,CAAC;AACjF,AAAI,IAAA,CAAA,qBAAoB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC3C,YAAQ,AAAC,CAAC,qBAAoB,CAAG,OAAK,CAAC,CAAC;AACxC,WAAS,sBAAoB,CAAC,AAAC,CAAE;AAC7B,WAAK,MAAM,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;AAC7B,SAAG,mBAAmB,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAChD,SAAG,sBAAsB,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;IACvD;AAAA,AACA,wBAAoB,UAAU,QAAQ,EAAI,UAAU,IAAG,CAAG;AACtD,AAAI,QAAA,CAAA,EAAC,EAAI,CAAA,MAAK,UAAU,QAAQ,KAAK,AAAC,CAAC,IAAG,CAAG,KAAG,CAAC,CAAC;AAClD,AAAI,QAAA,CAAA,iBAAgB,EAAI,CAAA,IAAG,mBAAmB,IAAI,AAAC,CAAC,IAAG,CAAC,CAAC;AACzD,AAAI,QAAA,CAAA,qBAAoB,EAAI,CAAA,IAAG,sBAAsB,IAAI,AAAC,CAAC,IAAG,CAAC,CAAC;AAChE,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,EAAC,UAAU,CAAC;AAC5B,SAAI,MAAK,UAAU,AAAC,CAAC,iBAAgB,CAAC,CAAG;AACrC,gBAAQ,EAAI,CAAA,EAAC,UAAU,OAAO,AAAC,CAAC,iBAAgB,CAAC,CAAC;MACtD;AAAA,AACA,SAAI,EAAC,WAAa,CAAA,UAAS,kBAAkB,CAAG;AAC5C,AAAI,UAAA,CAAA,aAAY,EAAI,CAAA,EAAC,cAAc,CAAC;AACpC,WAAI,MAAK,UAAU,AAAC,CAAC,qBAAoB,CAAC,CAAG;AACzC,sBAAY,EAAI,CAAA,EAAC,cAAc,OAAO,AAAC,CAAC,qBAAoB,CAAC,CAAC;QAClE;AAAA,AACA,aAAO,IAAI,CAAA,UAAS,kBAAkB,AAAC,CAAC;AACpC,iBAAO,CAAG,CAAA,EAAC,SAAS;AACpB,eAAK,CAAG,CAAA,EAAC,OAAO;AAChB,gBAAM,CAAG,CAAA,EAAC,QAAQ;AAClB,aAAG,CAAG,CAAA,EAAC,KAAK;AACZ,iBAAO,CAAG,CAAA,EAAC,SAAS;AACpB,iBAAO,CAAG,CAAA,EAAC,SAAS;AACpB,gBAAM,CAAG,CAAA,EAAC,QAAQ;AAClB,wBAAc,CAAG,CAAA,EAAC,gBAAgB;AAClC,kBAAQ,CAAG,UAAQ;AACnB,sBAAY,CAAG,cAAY;AAAA,QAC/B,CAAC,CAAC;MACN;AAAA,AACA,WAAO,IAAI,CAAA,UAAS,kBAAkB,AAAC,CAAC;AACpC,eAAO,CAAG,CAAA,EAAC,SAAS;AACpB,aAAK,CAAG,CAAA,EAAC,OAAO;AAChB,cAAM,CAAG,CAAA,EAAC,QAAQ;AAClB,WAAG,CAAG,CAAA,EAAC,KAAK;AACZ,gBAAQ,CAAG,UAAQ;AACnB,eAAO,CAAG,CAAA,EAAC,SAAS;AACpB,eAAO,CAAG,CAAA,EAAC,SAAS;AACpB,cAAM,CAAG,CAAA,EAAC,QAAQ;AAAA,MACtB,CAAC,CAAC;IACN,CAAC;AAID,wBAAoB,UAAU,oBAAoB,EAAI,UAAU,IAAG,CAAG,CAAA,QAAO,CAAG;AAC5E,SAAG,mBAAmB,IAAI,AAAC,CAAC,IAAG,CAAG,SAAO,CAAC,CAAC;IAC/C,CAAC;AAID,wBAAoB,UAAU,wBAAwB,EAAI,UAAU,IAAG,CAAG,CAAA,YAAW,CAAG;AACpF,SAAG,sBAAsB,IAAI,AAAC,CAAC,IAAG,CAAG,aAAW,CAAC,CAAC;IACtD,CAAC;AACD,wBAAoB,UAAU,qBAAqB,EAAI,UAAU,IAAG,CAAG,CAAA,QAAO,CAAG;AAC7E,SAAG,mBAAmB,IAAI,AAAC,CAAC,IAAG,CAAG,SAAO,CAAC,CAAC;IAC/C,CAAC;AACD,wBAAoB,UAAU,yBAAyB,EAAI,UAAU,IAAG,CAAG,CAAA,YAAW,CAAG;AACrF,SAAG,sBAAsB,IAAI,AAAC,CAAC,IAAG,CAAG,aAAW,CAAC,CAAC;IACtD,CAAC;AACD,SAAO,sBAAoB,CAAC;EAChC,CAAC,AAAC,CAAC,oBAAmB,kBAAkB,CAAC,CAAC;AAC1C,QAAM,sBAAsB,EAAI,sBAAoB,CAAC;AAzErD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAyE+B;AC1ElD,KAAK,SAAS,AAAC,CAAC,gCAA+B,CAAG,EAAC,gCAA+B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA5H,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AACzD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAChC,YAAQ,AAAC,CAAC,UAAS,CAAG,OAAK,CAAC,CAAC;AAC7B,WAAS,WAAS,CAAC,AAAC,CAAE;AAClB,WAAK,KAAK,AAAC,CAAC,IAAG,CAAG,EAAE,oBAAmB,CAAG,MAAI,CAAE,CAAC,CAAC;IACtD;AAAA,AACA,aAAS,UAAU,IAAI,EAAI,UAAU,EAAC,CAAG;AAAE,WAAO,CAAA,EAAC,AAAC,EAAC,CAAC;IAAE,CAAC;AACzD,aAAS,UAAU,kBAAkB,EAAI,UAAU,EAAC,CAAG;AAAE,WAAO,CAAA,EAAC,AAAC,EAAC,CAAC;IAAE,CAAC;AACvE,aAAS,UAAU,oBAAoB,EAAI,UAAU,EAAC,CAAG,CAAA,gBAAe,CAAG;AACvE,SAAI,gBAAe,IAAM,KAAK,EAAA,CAAG;AAAE,uBAAe,EAAI,MAAI,CAAC;MAAE;AAAA,AAC7D,SAAG,aAAa,EAAI,GAAC,CAAC;IAC1B,CAAC;AACD,aAAS,UAAU,iBAAiB,EAAI,UAAS,AAAC,CAAE;AAAE,SAAG,aAAa,AAAC,EAAC,CAAC;IAAE,CAAC;AAC5E,SAAO,WAAS,CAAC;EACrB,CAAC,AAAC,CAAC,SAAQ,OAAO,CAAC,CAAC;AACpB,QAAM,WAAW,EAAI,WAAS,CAAC;AApB/B,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAoBoB;ACrBvC,KAAK,SAAS,AAAC,CAAC,4BAA2B,CAAG,EAAC,gCAA+B,CAAE,oCAAkC,CAAE,2BAAyB,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAvL,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,OAAM,AAAC,CAAC,mCAAkC,CAAC,CAAC;AAChE,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,GAAE,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACnB,WAAS,IAAE,CAAC,AAAC,CAAE;AACX,SAAG,QAAQ,EAAI,GAAC,CAAC;IACrB;AAAA,AACA,MAAE,UAAU,IAAI,EAAI,UAAU,KAAI,CAAG;AAAE,SAAG,QAAQ,KAAK,AAAC,CAAC,KAAI,CAAC,CAAC;IAAE,CAAC;AAClE,MAAE,UAAU,GAAG,EAAI,UAAU,KAAI,CAAG;AAChC,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,WAAO,UAAU,EAAC,CAAG,CAAA,EAAC,CAAG,CAAA,EAAC,CAAG,CAAA,EAAC,CAAG,CAAA,EAAC,CAAG;AACjC,WAAI,EAAC,IAAM,KAAK,EAAA,CAAG;AAAE,WAAC,EAAI,KAAG,CAAC;QAAE;AAAA,AAChC,WAAI,EAAC,IAAM,KAAK,EAAA,CAAG;AAAE,WAAC,EAAI,KAAG,CAAC;QAAE;AAAA,AAChC,WAAI,EAAC,IAAM,KAAK,EAAA,CAAG;AAAE,WAAC,EAAI,KAAG,CAAC;QAAE;AAAA,AAChC,WAAI,EAAC,IAAM,KAAK,EAAA,CAAG;AAAE,WAAC,EAAI,KAAG,CAAC;QAAE;AAAA,AAChC,WAAI,EAAC,IAAM,KAAK,EAAA,CAAG;AAAE,WAAC,EAAI,KAAG,CAAC;QAAE;AAAA,AAChC,YAAI,QAAQ,KAAK,AAAC,CAAC,KAAI,CAAC,CAAC;MAC7B,CAAC;IACL,CAAC;AACD,MAAE,UAAU,MAAM,EAAI,UAAS,AAAC,CAAE;AAAE,SAAG,QAAQ,EAAI,GAAC,CAAC;IAAE,CAAC;AACxD,MAAE,UAAU,OAAO,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,QAAQ,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;IAAE,CAAC;AACtE,SAAO,IAAE,CAAC;EACd,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,IAAI,EAAI,IAAE,CAAC;AACjB,AAAI,IAAA,CAAA,gBAAe,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAChC,WAAS,iBAAe,CAAE,EAAC,CAAG;AAC1B,SAAI,MAAK,UAAU,AAAC,CAAC,EAAC,CAAC,CAAG;AACtB,WAAG,IAAI,EAAI,GAAC,CAAC;MACjB,KACK;AACD,WAAG,IAAI,EAAI,CAAA,MAAK,UAAU,AAAC,CAAC,aAAY,IAAI,CAAC,CAAA,CAAI,CAAA,aAAY,IAAI,aAAa,AAAC,EAAC,CAAA,CAAI,GAAC,CAAC;MAC1F;AAAA,IACJ;AAAA,AACA,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,YAAU,CAAG;AAC3D,QAAE,CAAG,UAAS,AAAC,CAAE;AAAE,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,SAAQ,CAAC,CAAA,CAAI,EAAC,CAAA,CAAC;MAAE;AAC5D,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,YAAU,CAAG;AAC3D,QAAE,CAAG,UAAS,AAAC,CAAE;AACb,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,aAAY,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAAK,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,SAAQ,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAC1E,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,aAAY,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAAK,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAA,EAAK,EAAC,CAAA,CAAC;MAChF;AACA,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,SAAO,CAAG;AACxD,QAAE,CAAG,UAAS,AAAC,CAAE;AAAE,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,MAAK,CAAC,CAAA,CAAI,EAAC,CAAA,CAAC;MAAE;AACzD,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,OAAK,CAAG;AACtD,QAAE,CAAG,UAAS,AAAC,CAAE;AAAE,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,SAAQ,CAAC,CAAA,CAAI,EAAC,CAAA,CAAC;MAAE;AAC5D,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,WAAS,CAAG;AAC1D,QAAE,CAAG,UAAS,AAAC,CAAE;AACb,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,aAAY,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAAK,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,MAAK,CAAC,CAAA,EAAK,EAAC,CAAA,CAAC;MACjF;AACA,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,SAAO,CAAG;AACxD,QAAE,CAAG,UAAS,AAAC,CAAE;AACb,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,aAAY,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAAK,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,WAAU,CAAC,CAAA,CAAI,EAAC,CAAA,CAAC;MACrF;AACA,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,SAAO,CAAG;AACxD,QAAE,CAAG,UAAS,AAAC,CAAE;AAAE,aAAO,CAAA,IAAG,UAAU,GAAK,CAAA,IAAG,KAAK,CAAA,EAAK,CAAA,IAAG,OAAO,CAAC;MAAE;AACtE,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAK,eAAe,AAAC,CAAC,gBAAe,UAAU,CAAG,kBAAgB,CAAG;AAIjE,QAAE,CAAG,UAAS,AAAC,CAAE;AACb,aAAO,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,UAAS,CAAC,CAAA,CAAI,EAAC,CAAA,CAAA,EAAK,CAAA,IAAG,IAAI,QAAQ,AAAC,CAAC,MAAK,CAAC,CAAA,EAAK,EAAC,CAAA,CAAC;MAC9E;AACA,eAAS,CAAG,KAAG;AACf,iBAAW,CAAG,KAAG;AAAA,IACrB,CAAC,CAAC;AACF,SAAO,iBAAe,CAAC;EAC3B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AAC3C,QAAM,iBAAiB,EAAI,IAAI,iBAAe,AAAC,CAAC,IAAG,CAAC,CAAC;AACrD,SAAS,cAAY,CAAE,OAAM,CAAG,CAAA,SAAQ,CAAG;AACvC,gBAAY,IAAI,cAAc,AAAC,CAAC,OAAM,CAAG,CAAA,aAAY,IAAI,YAAY,AAAC,CAAC,SAAQ,CAAC,CAAC,CAAC;EACtF;AAAA,AACA,QAAM,cAAc,EAAI,cAAY,CAAC;AACrC,SAAS,GAAC,CAAE,IAAG,CAAG;AACd,SAAO,CAAA,aAAY,IAAI,WAAW,AAAC,CAAC,aAAY,IAAI,QAAQ,AAAC,CAAC,aAAY,IAAI,eAAe,AAAC,CAAC,IAAG,CAAC,CAAC,CAAC,CAAC;EAC1G;AAAA,AACA,QAAM,GAAG,EAAI,GAAC,CAAC;AACf,AAAI,IAAA,CAAA,iBAAgB,EAAI,EAAC,GAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,KAAG,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAG,IAAE,CAAC,CAAC;AACzG,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,MAAK,cAAc,OAAO,AAAC,CAAC,KAAI,EAAI,CAAA,iBAAgB,KAAK,AAAC,CAAC,IAAG,CAAC,CAAA,CAAI,IAAE,CAAC,CAAC;AACxF,SAAS,eAAa,CAAE,KAAI,CAAG;AAC3B,SAAO,CAAA,MAAK,cAAc,OAAO,AAAC,CAAC,MAAK,cAAc,iBAAiB,AAAC,CAAC,KAAI,CAAG,WAAS,CAAG,UAAU,KAAI,CAAG;AAAE,WAAO,EAAC,IAAG,EAAI,CAAA,KAAI,CAAE,CAAA,CAAC,CAAC,CAAC;IAAE,CAAC,CAAC,CAAC;EAChJ;AAAA,AACA,QAAM,eAAe,EAAI,eAAa,CAAC;AACvC,SAAS,aAAW,CAAE,GAAE,CAAG;AACvB,MAAE,EAAI,CAAA,MAAK,cAAc,WAAW,AAAC,CAAC,GAAE,CAAG,OAAK,CAAG,IAAE,CAAC,CAAC;AACvD,MAAE,EAAI,CAAA,MAAK,cAAc,WAAW,AAAC,CAAC,GAAE,CAAG,OAAK,CAAG,IAAE,CAAC,CAAC;AACvD,MAAE,EAAI,CAAA,MAAK,cAAc,WAAW,AAAC,CAAC,GAAE,CAAG,KAAG,CAAG,IAAE,CAAC,CAAC;AACrD,MAAE,EAAI,CAAA,MAAK,cAAc,WAAW,AAAC,CAAC,GAAE,CAAG,MAAI,CAAG,IAAE,CAAC,CAAC;AACtD,MAAE,EAAI,CAAA,MAAK,cAAc,iBAAiB,AAAC,CAAC,GAAE,CAAG,kCAAgC,CAAG,UAAU,KAAI,CAAG;AAAE,WAAO,EAAC,QAAO,EAAI,CAAA,KAAI,CAAE,CAAA,CAAC,CAAA,CAAI,MAAI,CAAC,CAAC;IAAE,CAAC,CAAC;AAC/I,MAAE,EAAI,CAAA,MAAK,cAAc,iBAAiB,AAAC,CAAC,GAAE,CAAG,sBAAoB,CAAG,UAAU,KAAI,CAAG;AAAE,WAAO,EAAC,GAAE,EAAI,CAAA,KAAI,CAAE,CAAA,CAAC,CAAA,CAAI,MAAI,CAAA,CAAI,CAAA,KAAI,CAAE,CAAA,CAAC,CAAA,CAAI,MAAI,CAAC,CAAC;IAAE,CAAC,CAAC;AACjJ,SAAO,IAAE,CAAC;EACd;AAAA,AACA,QAAM,aAAa,EAAI,aAAW,CAAC;AACnC,AAAI,IAAA,CAAA,mBAAkB,EAAI,EAAC,IAAG,CAAG,KAAG,CAAG,QAAM,CAAC,CAAC;AAC/C,SAAS,iBAAe,CAAE,EAAC,CAAG;AAC1B,AAAI,MAAA,CAAA,MAAK,EAAI,GAAC,CAAC;AACf,OAAI,aAAY,IAAI,cAAc,AAAC,CAAC,EAAC,CAAC,CAAG;AACrC,AAAI,QAAA,CAAA,OAAM,EAAI,CAAA,aAAY,IAAI,QAAQ,AAAC,CAAC,EAAC,CAAC,YAAY,AAAC,EAAC,CAAC;AAEzD,WAAK,GAAK,CAAA,GAAE,EAAI,QAAM,CAAC;AAEvB,AAAI,QAAA,CAAA,YAAW,EAAI,CAAA,aAAY,IAAI,aAAa,AAAC,CAAC,EAAC,CAAC,CAAC;AACrD,AAAI,QAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,iBAAW,QAAQ,AAAC,CAAC,SAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,aAAO,CAAA,IAAG,KAAK,AAAC,CAAC,CAAA,CAAC,CAAC;MAAE,CAAC,CAAC;AAC9D,iBAAW,YAAY,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACnC,UAAS,GAAA,CAAA,CAAA,EAAI,EAAA,CAAG,CAAA,CAAA,EAAI,CAAA,IAAG,OAAO,CAAG,CAAA,CAAA,EAAE,CAAG;AAClC,AAAI,UAAA,CAAA,GAAE,EAAI,CAAA,IAAG,CAAE,CAAA,CAAC,CAAC;AACjB,AAAI,UAAA,CAAA,QAAO,EAAI,CAAA,YAAW,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;AACpC,WAAI,CAAC,MAAK,SAAS,AAAC,CAAC,QAAO,CAAC,CAAG;AAC5B,eAAK,GAAK,CAAA,GAAE,EAAI,IAAE,CAAC;QACvB,KACK;AACD,eAAK,GAAK,CAAA,GAAE,EAAI,IAAE,CAAA,CAAI,MAAI,CAAA,CAAI,SAAO,CAAA,CAAI,KAAG,CAAC;QACjD;AAAA,MACJ;AAAA,AACA,WAAK,GAAK,IAAE,CAAC;AAEb,AAAI,QAAA,CAAA,YAAW,EAAI,CAAA,aAAY,IAAI,kBAAkB,AAAC,CAAC,EAAC,CAAC,CAAC;AAC1D,AAAI,QAAA,CAAA,QAAO,EAAI,CAAA,MAAK,UAAU,AAAC,CAAC,YAAW,CAAC,CAAA,CAAI,CAAA,aAAY,IAAI,WAAW,AAAC,CAAC,YAAW,CAAC,CAAA,CAAI,GAAC,CAAC;AAC/F,UAAS,GAAA,CAAA,CAAA,EAAI,EAAA,CAAG,CAAA,CAAA,EAAI,CAAA,QAAO,OAAO,CAAG,CAAA,CAAA,EAAE,CAAG;AACtC,aAAK,GAAK,CAAA,gBAAe,AAAC,CAAC,QAAO,CAAE,CAAA,CAAC,CAAC,CAAC;MAC3C;AAAA,AAEA,SAAI,CAAC,YAAW,YAAY,SAAS,AAAC,CAAC,mBAAkB,CAAG,QAAM,CAAC,CAAG;AAClE,aAAK,GAAK,CAAA,IAAG,EAAI,QAAM,CAAA,CAAI,IAAE,CAAC;MAClC;AAAA,IACJ,KACK,KAAI,aAAY,IAAI,cAAc,AAAC,CAAC,EAAC,CAAC,CAAG;AAC1C,WAAK,GAAK,CAAA,MAAK,EAAI,CAAA,aAAY,IAAI,UAAU,AAAC,CAAC,EAAC,CAAC,CAAA,CAAI,MAAI,CAAC;IAC9D,KACK;AACD,WAAK,GAAK,CAAA,aAAY,IAAI,QAAQ,AAAC,CAAC,EAAC,CAAC,CAAC;IAC3C;AAAA,AACA,SAAO,OAAK,CAAC;EACjB;AAAA,AACA,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AA3J3C,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA2Ja;AC5JhC,KAAK,SAAS,AAAC,CAAC,qCAAoC,CAAG,EAAC,0BAAyB,CAAE,uBAAqB,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAlJ,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,QAAM,cAAc,EAAI,CAAA,MAAK,WAAW,AAAC,CAAC,GAAI,CAAA,IAAG,YAAY,AAAC,CAAC,uBAAsB,CAAC,CAAC,CAAC;AACxF,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACnC,WAAS,oBAAkB,CAAE,UAAS,CAAG,CAAA,iBAAgB,CAAG;AACxD,SAAG,WAAW,EAAI,WAAS,CAAC;AAC5B,SAAG,kBAAkB,EAAI,kBAAgB,CAAC;IAC9C;AAAA,AACA,SAAO,oBAAkB,CAAC;EAC9B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,oBAAoB,EAAI,oBAAkB,CAAC;AACjD,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACpC,WAAS,qBAAmB,CAAC,AAAC,CAAE,GAChC;AAAA,AACA,uBAAmB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AAAE,WAAO,KAAG,CAAC;IAAE,CAAC;AACnF,SAAO,qBAAmB,CAAC;EAC/B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,qBAAqB,EAAI,qBAAmB,CAAC;AACnD,AAAI,IAAA,CAAA,gBAAe,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAChC,WAAS,iBAAe,CAAE,OAAM,CAAG,CAAA,cAAa,CAAG,CAAA,KAAI,CAAG;AACtD,SAAG,QAAQ,EAAI,QAAM,CAAC;AACtB,SAAG,eAAe,EAAI,eAAa,CAAC;AACpC,SAAG,MAAM,EAAI,MAAI,CAAC;IACtB;AAAA,AACA,mBAAe,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AAC3D,WAAO,CAAA,OAAM,UAAU,AAAC,CAAC,IAAG,CAAG,QAAM,CAAC,CAAC;IAC3C,CAAC;AACD,SAAO,iBAAe,CAAC;EAC3B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AAC3C,AAAI,IAAA,CAAA,qBAAoB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACrC,WAAS,sBAAoB,CAAE,KAAI,CAAG,CAAA,cAAa,CAAG;AAClD,SAAG,MAAM,EAAI,MAAI,CAAC;AAClB,SAAG,eAAe,EAAI,eAAa,CAAC;IACxC;AAAA,AACA,wBAAoB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AAChE,WAAO,CAAA,OAAM,eAAe,AAAC,CAAC,IAAG,CAAG,QAAM,CAAC,CAAC;IAChD,CAAC;AACD,SAAO,sBAAoB,CAAC;EAChC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,sBAAsB,EAAI,sBAAoB,CAAC;AACrD,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACxC,WAAS,yBAAuB,CAAE,OAAM,CAAG,CAAA,cAAa,CAAG,CAAA,IAAG,CAAG,CAAA,iBAAgB,CAAG,CAAA,mBAAkB,CAAG;AACrG,SAAG,QAAQ,EAAI,QAAM,CAAC;AACtB,SAAG,eAAe,EAAI,eAAa,CAAC;AACpC,SAAG,KAAK,EAAI,KAAG,CAAC;AAChB,SAAG,kBAAkB,EAAI,kBAAgB,CAAC;AAC1C,SAAG,oBAAoB,EAAI,oBAAkB,CAAC;IAClD;AAAA,AACA,2BAAuB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AACnE,WAAO,CAAA,OAAM,kBAAkB,AAAC,CAAC,IAAG,CAAG,QAAM,CAAC,CAAC;IACnD,CAAC;AACD,SAAO,yBAAuB,CAAC;EACnC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,yBAAyB,EAAI,yBAAuB,CAAC;AAC3D,AAAI,IAAA,CAAA,sBAAqB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACtC,WAAS,uBAAqB,CAAC,AAAC,CAAE,GAClC;AAAA,AACA,yBAAqB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AACjE,WAAO,CAAA,OAAM,gBAAgB,AAAC,CAAC,OAAM,CAAC,CAAC;IAC3C,CAAC;AACD,SAAO,uBAAqB,CAAC;EACjC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,uBAAuB,EAAI,uBAAqB,CAAC;AACvD,AAAI,IAAA,CAAA,0BAAyB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC1C,WAAS,2BAAyB,CAAE,OAAM,CAAG,CAAA,cAAa,CAAG,CAAA,IAAG,CAAG,CAAA,iBAAgB,CAAG,CAAA,mBAAkB,CAAG,CAAA,UAAS,CAAG;AACnH,SAAG,QAAQ,EAAI,QAAM,CAAC;AACtB,SAAG,eAAe,EAAI,eAAa,CAAC;AACpC,SAAG,KAAK,EAAI,KAAG,CAAC;AAChB,SAAG,kBAAkB,EAAI,kBAAgB,CAAC;AAC1C,SAAG,oBAAoB,EAAI,oBAAkB,CAAC;AAC9C,SAAG,WAAW,EAAI,WAAS,CAAC;IAChC;AAAA,AACA,6BAAyB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AACrE,WAAO,CAAA,OAAM,oBAAoB,AAAC,CAAC,IAAG,CAAG,QAAM,CAAC,CAAC;IACrD,CAAC;AACD,SAAO,2BAAyB,CAAC;EACrC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,2BAA2B,EAAI,2BAAyB,CAAC;AAC/D,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACxC,WAAS,yBAAuB,CAAC,AAAC,CAAE,GACpC;AAAA,AACA,2BAAuB,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AACnE,WAAO,CAAA,OAAM,kBAAkB,AAAC,CAAC,OAAM,CAAC,CAAC;IAC7C,CAAC;AACD,SAAO,yBAAuB,CAAC;EACnC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,yBAAyB,EAAI,yBAAuB,CAAC;AAC3D,AAAI,IAAA,CAAA,4BAA2B,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC5C,WAAS,6BAA2B,CAAE,OAAM,CAAG,CAAA,cAAa,CAAG,CAAA,IAAG,CAAG,CAAA,iBAAgB,CAAG,CAAA,mBAAkB,CAAG,CAAA,QAAO,CAAG,CAAA,QAAO,CAAG;AAC7H,SAAG,QAAQ,EAAI,QAAM,CAAC;AACtB,SAAG,eAAe,EAAI,eAAa,CAAC;AACpC,SAAG,KAAK,EAAI,KAAG,CAAC;AAChB,SAAG,kBAAkB,EAAI,kBAAgB,CAAC;AAC1C,SAAG,oBAAoB,EAAI,oBAAkB,CAAC;AAC9C,SAAG,SAAS,EAAI,SAAO,CAAC;AACxB,SAAG,SAAS,EAAI,SAAO,CAAC;IAC5B;AAAA,AACA,+BAA2B,UAAU,MAAM,EAAI,UAAU,OAAM,CAAG,CAAA,OAAM,CAAG;AACvE,WAAO,CAAA,OAAM,sBAAsB,AAAC,CAAC,IAAG,CAAG,QAAM,CAAC,CAAC;IACvD,CAAC;AACD,SAAO,6BAA2B,CAAC;EACvC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,6BAA6B,EAAI,6BAA2B,CAAC;AAvGnE,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAuGW;ACxG9B,KAAK,SAAS,AAAC,CAAC,6DAA4D,CAAG,EAAC,sBAAqB,CAAE,+BAA6B,CAAE,sCAAoC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAApN,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;AAAA,AACjI,WAAQ,SAAQ,OAAO;AACnB,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,OAAK,CAAC,CAAC;AAAA,AAC1F,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,CAAG,KAAK,EAAA,CAAC;QAAE,CAAG,KAAK,EAAA,CAAC,CAAC;AAAA,AACvG,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,KAAG,CAAC,CAAC;AAAA,IACzG;EACJ,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,QAAQ,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,SAAQ,CAAG;AACrE,SAAO,UAAU,MAAK,CAAG,CAAA,GAAE,CAAG;AAAE,cAAQ,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,WAAS,CAAC,CAAC;IAAE,CAAA;EACxE,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,8BAA6B,CAAC,CAAC;AACnD,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,qCAAoC,CAAC,CAAC;AAC1D,AAAI,IAAA,CAAA,uBAAsB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACvC,WAAS,wBAAsB,CAAE,WAAU,CAAG;AAC1C,SAAG,eAAe,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAC/B,SAAG,mBAAmB,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AACnC,SAAG,WAAW,EAAI,EAAA,CAAC;AACnB,SAAG,aAAa,EAAI,YAAU,CAAC;IACnC;AAAA,AACA,0BAAsB,UAAU,SAAS,EAAI,UAAS,AAAC,CAAE;AACrD,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,WAAW,EAAE,CAAC;AAC7B,AAAI,QAAA,CAAA,MAAK,EAAI,IAAI,4BAA0B,AAAC,CAAC,KAAI,CAAC,CAAC;AACnD,SAAG,MAAM,AAAC,CAAC,MAAK,CAAG,MAAI,CAAC,CAAC;AACzB,WAAO,OAAK,CAAC;IACjB,CAAC;AACD,0BAAsB,UAAU,MAAM,EAAI,UAAU,GAAE,CAAG,CAAA,KAAI,CAAG;AAC5D,SAAG,mBAAmB,IAAI,AAAC,CAAC,GAAE,CAAG,MAAI,CAAC,CAAC;AACvC,SAAG,eAAe,IAAI,AAAC,CAAC,KAAI,CAAG,IAAE,CAAC,CAAC;IACvC,CAAC;AACD,0BAAsB,UAAU,YAAY,EAAI,UAAU,KAAI,CAAG;AAC7D,SAAI,KAAI,GAAK,KAAG,CAAG;AACf,aAAO,KAAG,CAAC;MACf;AAAA,AACA,WAAO,CAAA,IAAG,eAAe,IAAI,AAAC,CAAC,KAAI,CAAC,CAAC;IACzC,CAAC;AACD,0BAAsB,UAAU,UAAU,EAAI,UAAU,GAAE,CAAG;AACzD,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,IAAG,aAAa,CAAG;AACnB,aAAO,CAAA,GAAE,UAAU,CAAC;MACxB,KACK;AACD,aAAO,CAAA,IAAG,mBAAmB,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;MAC3C;AAAA,IACJ,CAAC;AACD,0BAAsB,EAAI,CAAA,UAAS,AAAC,CAAC,CACjC,IAAG,WAAW,AAAC,EAAC,CAChB,CAAA,OAAM,AAAC,CAAC,CAAA,CAAG,CAAA,IAAG,OAAO,AAAC,CAAC,KAAI,cAAc,CAAC,CAAC,CAC3C,CAAA,UAAS,AAAC,CAAC,mBAAkB,CAAG,EAAC,MAAK,CAAC,CAAC,CAC5C,CAAG,wBAAsB,CAAC,CAAC;AAC3B,SAAO,wBAAsB,CAAC;EAClC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,wBAAwB,EAAI,wBAAsB,CAAC;AACzD,AAAI,IAAA,CAAA,2BAA0B,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AACjD,YAAQ,AAAC,CAAC,2BAA0B,CAAG,OAAK,CAAC,CAAC;AAC9C,WAAS,4BAA0B,CAAE,SAAQ,CAAG;AAC5C,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACjB,SAAG,UAAU,EAAI,UAAQ,CAAC;IAC9B;AAAA,AACA,SAAO,4BAA0B,CAAC;EACtC,CAAC,AAAC,CAAC,KAAI,mBAAmB,CAAC,CAAC;AAC5B,QAAM,4BAA4B,EAAI,4BAA0B,CAAC;AAxEjE,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAwEmC;ACzEtD,KAAK,SAAS,AAAC,CAAC,kEAAiE,CAAG,EAAC,sBAAqB,CAAE,+BAA6B,CAAE,sCAAoC,CAAE,iCAA+B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA1P,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;AAAA,AACjI,WAAQ,SAAQ,OAAO;AACnB,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,OAAK,CAAC,CAAC;AAAA,AAC1F,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,CAAG,KAAK,EAAA,CAAC;QAAE,CAAG,KAAK,EAAA,CAAC,CAAC;AAAA,AACvG,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,KAAG,CAAC,CAAC;AAAA,IACzG;EACJ,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,QAAQ,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,SAAQ,CAAG;AACrE,SAAO,UAAU,MAAK,CAAG,CAAA,GAAE,CAAG;AAAE,cAAQ,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,WAAS,CAAC,CAAC;IAAE,CAAA;EACxE,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,8BAA6B,CAAC,CAAC;AACnD,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,qCAAoC,CAAC,CAAC;AAC1D,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,4BAA2B,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC5C,WAAS,6BAA2B,CAAE,WAAU,CAAG;AAC/C,SAAG,WAAW,EAAI,EAAA,CAAC;AACnB,SAAG,aAAa,EAAI,YAAU,CAAC;AAC/B,SAAG,eAAe,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAC/B,SAAG,cAAc,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAC9B,SAAG,eAAe,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;IACnC;AAAA,AACA,+BAA2B,UAAU,SAAS,EAAI,UAAU,aAAY,CAAG;AACvE,AAAI,QAAA,CAAA,YAAW,EAAI,CAAA,IAAG,WAAW,CAAC;AAClC,AAAI,QAAA,CAAA,OAAM,EAAI,IAAI,uBAAqB,AAAC,CAAC,IAAG,WAAW,EAAE,CAAC,CAAC;AAC3D,AAAI,QAAA,CAAA,YAAW,EAAI,CAAA,YAAW,YAAY,mBAAmB,AAAC,CAAC,aAAY,CAAC,CAAC;AAC7E,UAAS,GAAA,CAAA,CAAA,EAAI,EAAA,CAAG,CAAA,CAAA,EAAI,cAAY,CAAG,CAAA,CAAA,EAAE,CAAG;AACpC,mBAAW,CAAE,CAAA,CAAC,EAAI,IAAI,2BAAyB,AAAC,CAAC,IAAG,WAAW,EAAE,CAAC,CAAC;MACvE;AAAA,AACI,QAAA,CAAA,uBAAsB,EAAI,IAAI,CAAA,KAAI,wBAAwB,AAAC,CAAC,OAAM,CAAG,aAAW,CAAC,CAAC;AACtF,SAAG,MAAM,AAAC,CAAC,uBAAsB,CAAG,aAAW,CAAC,CAAC;AACjD,WAAO,wBAAsB,CAAC;IAClC,CAAC;AACD,+BAA2B,UAAU,MAAM,EAAI,UAAU,IAAG,CAAG,CAAA,UAAS,CAAG;AACvE,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAG,eAAe,IAAI,AAAC,CAAC,UAAS,CAAG,CAAA,IAAG,QAAQ,CAAC,CAAC;AACjD,SAAG,cAAc,IAAI,AAAC,CAAC,IAAG,QAAQ,CAAG,WAAS,CAAC,CAAC;AAChD,eAAS,EAAE,CAAC;AACZ,SAAG,aAAa,QAAQ,AAAC,CAAC,SAAU,GAAE,CAAG;AACrC,YAAI,eAAe,IAAI,AAAC,CAAC,UAAS,CAAG,IAAE,CAAC,CAAC;AACzC,YAAI,cAAc,IAAI,AAAC,CAAC,GAAE,CAAG,WAAS,CAAC,CAAC;AACxC,iBAAS,EAAE,CAAC;MAChB,CAAC,CAAC;AACF,SAAG,eAAe,IAAI,AAAC,CAAC,IAAG,QAAQ,CAAG,CAAA,IAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;AACD,+BAA2B,UAAU,OAAO,EAAI,UAAU,IAAG,CAAG;AAC5D,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAG,WAAW,AAAC,CAAC,IAAG,CAAC,CAAC;AACrB,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,IAAG,eAAe,IAAI,AAAC,CAAC,IAAG,CAAC,CAAC;AAC7C,cAAQ,QAAQ,AAAC,CAAC,SAAU,QAAO,CAAG;AAAE,YAAI,WAAW,AAAC,CAAC,QAAO,CAAC,CAAC;MAAE,CAAC,CAAC;AACtE,SAAG,eAAe,OAAO,AAAC,CAAC,IAAG,CAAC,CAAC;IACpC,CAAC;AACD,+BAA2B,UAAU,WAAW,EAAI,UAAU,GAAE,CAAG;AAC/D,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,cAAc,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;AACvC,SAAG,cAAc,OAAO,AAAC,CAAC,GAAE,CAAC,CAAC;AAC9B,SAAG,eAAe,OAAO,AAAC,CAAC,KAAI,CAAC,CAAC;IACrC,CAAC;AACD,+BAA2B,UAAU,uBAAuB,EAAI,UAAU,OAAM,CAAG;AAC/E,WAAO,CAAA,IAAG,kCAAkC,AAAC,CAAC,OAAM,CAAC,CAAC;IAC1D,CAAC;AACD,+BAA2B,UAAU,2BAA2B,EAAI,UAAU,WAAU,CAAG;AACvF,WAAO,CAAA,IAAG,kCAAkC,AAAC,CAAC,WAAU,CAAC,CAAC;IAC9D,CAAC;AACD,+BAA2B,UAAU,yBAAyB,EAAI,UAAU,GAAE,CAAG;AAC7E,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACA,WAAO,CAAA,IAAG,UAAU,AAAC,CAAC,GAAE,CAAC,CAAC;IAC9B,CAAC;AACD,+BAA2B,UAAU,6BAA6B,EAAI,UAAU,GAAE,CAAG;AACjF,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACA,WAAO,CAAA,IAAG,UAAU,AAAC,CAAC,GAAE,CAAC,CAAC;IAC9B,CAAC;AACD,+BAA2B,UAAU,UAAU,EAAI,UAAU,GAAE,CAAG;AAC9D,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,CAAC,IAAG,eAAe,IAAI,AAAC,CAAC,GAAE,CAAC,CAAG;AAC/B,aAAO,KAAG,CAAC;MACf;AAAA,AACA,WAAO,CAAA,IAAG,eAAe,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;IACvC,CAAC;AACD,+BAA2B,UAAU,kCAAkC,EAAI,UAAU,GAAE,CAAG;AACtF,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,IAAG,aAAa,CAAG;AACnB,aAAO,CAAA,GAAE,UAAU,AAAC,EAAC,CAAC;MAC1B,KACK;AACD,aAAO,CAAA,IAAG,cAAc,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;MACtC;AAAA,IACJ,CAAC;AACD,+BAA2B,UAAU,2BAA2B,EAAI,UAAU,IAAG,CAAG;AAChF,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAI,IAAG,GAAK,KAAG,CAAG;AACd,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,IAAG,aAAa,CAAG;AACnB,aAAO;AACH,kBAAQ,CAAG,CAAA,IAAG,QAAQ,UAAU,AAAC,EAAC;AAClC,uBAAa,CAAG,CAAA,IAAG,aAAa,IAAI,AAAC,CAAC,SAAU,GAAE,CAAG;AAAE,iBAAO,CAAA,GAAE,UAAU,AAAC,EAAC,CAAC;UAAE,CAAC;AAAA,QACpF,CAAC;MACL,KACK;AACD,aAAO;AACH,kBAAQ,CAAG,CAAA,IAAG,cAAc,IAAI,AAAC,CAAC,IAAG,QAAQ,CAAC;AAC9C,uBAAa,CAAG,CAAA,IAAG,aAAa,IAAI,AAAC,CAAC,SAAU,GAAE,CAAG;AAAE,iBAAO,CAAA,KAAI,cAAc,IAAI,AAAC,CAAC,GAAE,CAAC,CAAC;UAAE,CAAC;AAAA,QACjG,CAAC;MACL;AAAA,IACJ,CAAC;AACD,+BAA2B,UAAU,6BAA6B,EAAI,UAAU,GAAE,CAAG;AACjF,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAI,GAAE,GAAK,KAAG,CAAG;AACb,aAAO,KAAG,CAAC;MACf;AAAA,AACI,QAAA,CAAA,OAAM,EAAI,CAAA,IAAG,yBAAyB,AAAC,CAAC,GAAE,CAAE,SAAQ,CAAC,CAAC,CAAC;AAC3D,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,GAAE,CAAE,cAAa,CAAC,IAAI,AAAC,CAAC,SAAU,GAAE,CAAG;AAAE,aAAO,CAAA,KAAI,6BAA6B,AAAC,CAAC,GAAE,CAAC,CAAC;MAAE,CAAC,CAAC;AAC3G,WAAO,IAAI,CAAA,KAAI,wBAAwB,AAAC,CAAC,OAAM,CAAG,UAAQ,CAAC,CAAC;IAChE,CAAC;AACD,+BAA2B,EAAI,CAAA,UAAS,AAAC,CAAC,CACtC,IAAG,WAAW,AAAC,EAAC,CAChB,CAAA,OAAM,AAAC,CAAC,CAAA,CAAG,CAAA,IAAG,OAAO,AAAC,CAAC,KAAI,cAAc,CAAC,CAAC,CAC3C,CAAA,UAAS,AAAC,CAAC,mBAAkB,CAAG,EAAC,MAAK,CAAC,CAAC,CAC5C,CAAG,6BAA2B,CAAC,CAAC;AAChC,SAAO,6BAA2B,CAAC;EACvC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,6BAA6B,EAAI,6BAA2B,CAAC;AACnE,AAAI,IAAA,CAAA,sBAAqB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAC5C,YAAQ,AAAC,CAAC,sBAAqB,CAAG,OAAK,CAAC,CAAC;AACzC,WAAS,uBAAqB,CAAE,SAAQ,CAAG;AACvC,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACjB,SAAG,UAAU,EAAI,UAAQ,CAAC;IAC9B;AAAA,AACA,yBAAqB,UAAU,UAAU,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,UAAU,CAAC;IAAE,CAAC;AACnF,yBAAqB,YAAY,EAAI,UAAU,GAAE,CAAG;AAChD,WAAO,IAAI,uBAAqB,AAAC,CAAC,GAAE,CAAC,CAAC;IAC1C,CAAC;AACD,SAAO,uBAAqB,CAAC;EACjC,CAAC,AAAC,CAAC,KAAI,cAAc,CAAC,CAAC;AACvB,QAAM,uBAAuB,EAAI,uBAAqB,CAAC;AACvD,AAAI,IAAA,CAAA,0BAAyB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AAChD,YAAQ,AAAC,CAAC,0BAAyB,CAAG,OAAK,CAAC,CAAC;AAC7C,WAAS,2BAAyB,CAAE,SAAQ,CAAG;AAC3C,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACjB,SAAG,UAAU,EAAI,UAAQ,CAAC;IAC9B;AAAA,AACA,6BAAyB,UAAU,UAAU,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,UAAU,CAAC;IAAE,CAAC;AACvF,6BAAyB,YAAY,EAAI,UAAU,GAAE,CAAG;AACpD,WAAO,IAAI,2BAAyB,AAAC,CAAC,GAAE,CAAC,CAAC;IAC9C,CAAC;AACD,SAAO,2BAAyB,CAAC;EACrC,CAAC,AAAC,CAAC,KAAI,kBAAkB,CAAC,CAAC;AAC3B,QAAM,2BAA2B,EAAI,2BAAyB,CAAC;AApK/D,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAoKwC;ACrK3D,KAAK,SAAS,AAAC,CAAC,+BAA8B,CAAG,EAAC,mCAAkC,CAAE,2BAAyB,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAzJ,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,OAAM,AAAC,CAAC,mCAAkC,CAAC,CAAC;AAChE,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,OAAM,EAAI,EAAC,MAAO,OAAK,CAAA,GAAM,YAAU,CAAA,CAAI,CAAA,MAAK,OAAO,EAAI,OAAK,CAAC,CAAC;AACtE,QAAM,OAAO,EAAI,CAAA,OAAM,OAAO,CAAC;AAK/B,IAAE,UAAU,CAAE,iBAAgB,CAAC,EAAI,UAAS,AAAC,CAAE;AAC3C,AAAI,MAAA,CAAA,CAAA,EAAI,KAAG,CAAC;AACZ,OAAI,CAAC,CAAA,CAAG;AACJ,WAAO,CAAA,EAAC,EAAI,EAAA,CAAC;IACjB;AAAA,AACI,MAAA,CAAA,GAAE,EAAI,GAAC,CAAC;AACZ,IAAA,QAAQ,AAAC,CAAC,SAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,QAAE,KAAK,AAAC,CAAC,CAAA,EAAI,IAAE,CAAA,CAAI,EAAA,CAAC,CAAC;IAAE,CAAC,CAAC;AACrD,SAAO,CAAA,IAAG,EAAI,CAAA,GAAE,KAAK,AAAC,CAAC,GAAE,CAAC,CAAA,CAAI,KAAG,CAAC;EACtC,CAAC;AACD,QAAM,WAAW,AAAC,CAAC,SAAS,AAAC,CAAE;AAC3B,UAAM,YAAY,AAAC,CAAC;AAEhB,YAAM,CAAG,UAAU,IAAG,CAAG,CAAA,qBAAoB,CAAG;AAC5C,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,QAAO,CAAG;AACjC,iBAAO,EAAE,IAAG,CAAG,CAAA,IAAG,OAAO,AAAC,CAAC,MAAK,CAAG,SAAO,CAAG,EAAC,UAAS,CAAC,CAAC,CAAE,CAAC;UAChE,CACJ,CAAC;AACD,eAAS,WAAS,CAAE,MAAK,CAAG,CAAA,QAAO,CAAG;AAClC,aAAI,MAAK,WAAa,IAAE,CAAG;AACvB,AAAI,cAAA,CAAA,IAAG,EAAI,CAAA,MAAK,KAAK,IAAM,CAAA,QAAO,KAAK,CAAC;AACxC,eAAI,IAAG,CAAG;AACN,mBAAK,QAAQ,AAAC,CAAC,SAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,mBAAG,EAAI,CAAA,IAAG,GAAK,CAAA,IAAG,OAAO,AAAC,CAAC,CAAA,CAAG,CAAA,QAAO,IAAI,AAAC,CAAC,CAAA,CAAC,CAAC,CAAC;cAAE,CAAC,CAAC;YACvF;AAAA,AACA,iBAAO,KAAG,CAAC;UACf,KACK;AACD,iBAAO,UAAQ,CAAC;UACpB;AAAA,QACJ;AAAA,MACJ;AACA,gBAAU,CAAG,UAAS,AAAC,CAAE;AACrB,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,aAAY,CAAG;AACtC,AAAI,cAAA,CAAA,IAAG,EAAI,CAAA,MAAO,OAAK,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,OAAK,KAAK,CAAA,GAAM,WAAS,CAAC;AAC1E,iBAAO;AAAE,iBAAG,CAAG,KAAG;AAAG,gBAAI,QAAM,EAAI;AAAE,qBAAO,CAAA,WAAU,EAAI,OAAK,CAAA,CAAI,mBAAiB,CAAC;cAAE;AAAA,YAAE,CAAC;UAC9F,CACJ,CAAC;MACL;AACA,qBAAe,CAAG,UAAS,AAAC,CAAE;AAC1B,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,aAAY,CAAG;AACtC,AAAI,cAAA,CAAA,IAAG,EAAI,CAAA,MAAO,OAAK,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAK,WAAa,cAAY,CAAC;AACxE,iBAAO;AACH,iBAAG,CAAG,KAAG;AACT,gBAAI,QAAM,EAAI;AACV,qBAAO,CAAA,WAAU,EAAI,OAAK,CAAA,CAAI,yBAAuB,CAAA,CAAI,cAAY,CAAC;cAC1E;AAAA,YACJ,CAAC;UACL,CACJ,CAAC;MACL;AACA,eAAS,CAAG,UAAS,AAAC,CAAE;AACpB,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,YAAW,CAAG;AACrC,AAAI,cAAA,CAAA,UAAS,EAAI,CAAA,WAAU,AAAC,CAAC,MAAK,CAAC,CAAC;AACpC,iBAAO;AACH,iBAAG,CAAG,CAAA,UAAS,GAAK,aAAW;AAC/B,gBAAI,QAAM,EAAI;AAAE,qBAAO,CAAA,WAAU,EAAI,WAAS,CAAA,CAAI,mBAAiB,CAAA,CAAI,aAAW,CAAC;cAAE;AAAA,YACzF,CAAC;UACL,CACJ,CAAC;MACL;AACA,mBAAa,CAAG,UAAS,AAAC,CAAE;AACxB,aAAO;AAAE,gBAAM,CAAG,CAAA,UAAS,AAAC,CAAC,KAAI,CAAC;AAAG,wBAAc,CAAG,CAAA,UAAS,AAAC,CAAC,IAAG,CAAC;AAAA,QAAE,CAAC;AACxE,eAAS,WAAS,CAAE,KAAI,CAAG;AACvB,eAAO,UAAU,MAAK,CAAG,CAAA,SAAQ,CAAG;AAChC,iBAAO;AACH,iBAAG,CAAG,CAAA,aAAY,IAAI,SAAS,AAAC,CAAC,MAAK,CAAG,UAAQ,CAAC,CAAA,EAAK,EAAC,KAAI;AAC5D,gBAAI,QAAM,EAAI;AACV,qBAAO,CAAA,WAAU,EAAI,CAAA,MAAK,UAAU,CAAA,CAAI,IAAE,CAAA,CAAI,EAAC,KAAI,EAAI,OAAK,EAAI,GAAC,CAAC,CAAA,CAAI,8BAA4B,CAAA,CAAI,UAAQ,CAAA,CAAI,KAAG,CAAC;cAC1H;AAAA,YACJ,CAAC;UACL,CAAC;QACL;AAAA,MACJ;AACA,mBAAa,CAAG,UAAS,AAAC,CAAE;AACxB,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,YAAW,CAAG;AACrC,AAAI,cAAA,CAAA,YAAW,EAAI,CAAA,MAAK,SAAS,AAAC,EAAC,CAAC;AACpC,iBAAO;AACH,iBAAG,CAAG,CAAA,YAAW,QAAQ,AAAC,CAAC,YAAW,CAAC,CAAA,CAAI,EAAC,CAAA;AAC5C,gBAAI,QAAM,EAAI;AAAE,qBAAO,CAAA,WAAU,EAAI,aAAW,CAAA,CAAI,eAAa,CAAA,CAAI,aAAW,CAAC;cAAE;AAAA,YACvF,CAAC;UACL,CACJ,CAAC;MACL;AACA,qBAAe,CAAG,UAAS,AAAC,CAAE;AAC1B,aAAO,EACH,OAAM,CAAG,UAAU,MAAK,CAAG,CAAA,YAAW,CAAG;AACrC,cAAI;AACA,mBAAK,AAAC,EAAC,CAAC;AACR,mBAAO;AACH,mBAAG,CAAG,MAAI;AACV,kBAAI,QAAM,EAAI;AAAE,uBAAO,2CAAyC,CAAC;gBAAE;AAAA,cACvE,CAAC;YACL,CACA,OAAO,CAAA,CAAG;AACN,AAAI,gBAAA,CAAA,YAAW,EAAI,CAAA,CAAA,SAAS,AAAC,EAAC,CAAC;AAC/B,mBAAO;AACH,mBAAG,CAAG,CAAA,YAAW,QAAQ,AAAC,CAAC,YAAW,CAAC,CAAA,CAAI,EAAC,CAAA;AAC5C,kBAAI,QAAM,EAAI;AAAE,uBAAO,CAAA,WAAU,EAAI,aAAW,CAAA,CAAI,eAAa,CAAA,CAAI,aAAW,CAAC;gBAAE;AAAA,cACvF,CAAC;YACL;AAAA,UACJ,CACJ,CAAC;MACL;AACA,gBAAU,CAAG,UAAS,AAAC,CAAE;AACrB,aAAO,EACH,OAAM,CAAG,UAAU,YAAW,CAAG,CAAA,iBAAgB,CAAG;AAChD,AAAI,cAAA,CAAA,QAAO,EAAI,CAAA,MAAK,KAAK,AAAC,CAAC,YAAW,YAAY,UAAU,CAAC,CAAC;AAC9D,AAAI,cAAA,CAAA,QAAO,EAAI,CAAA,MAAK,KAAK,AAAC,CAAC,iBAAgB,UAAU,CAAC,CAAC;AACvD,AAAI,cAAA,CAAA,aAAY,EAAI,GAAC,CAAC;AACtB,mBAAO,QAAQ,AAAC,CAAC,SAAU,CAAA,CAAG;AAC1B,iBAAI,CAAC,YAAW,YAAY,UAAU,CAAE,CAAA,CAAC;AACrC,4BAAY,KAAK,AAAC,CAAC,CAAA,CAAC,CAAC;AAAA,YAC7B,CAAC,CAAC;AACF,iBAAO;AACH,iBAAG,CAAG,CAAA,aAAY,OAAO,GAAK,EAAA;AAC9B,gBAAI,QAAM,EAAI;AACV,qBAAO,CAAA,WAAU,EAAI,aAAW,CAAA,CAAI,mCAAiC,CAAA,CACjE,CAAA,aAAY,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;cAChC;AAAA,YACJ,CAAC;UACL,CACJ,CAAC;MACL;AAAA,IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACF,SAAS,YAAU,CAAE,CAAA,CAAG;AACpB,AAAI,MAAA,CAAA,QAAO,EAAI,UAAU,CAAA,CAAG;AACxB,AAAI,QAAA,CAAA,QAAO,EAAI,CAAA,aAAY,IAAI,WAAW,AAAC,CAAC,CAAA,CAAC,CAAC;AAC9C,WAAO,CAAA,QAAO,GAAK,CAAA,QAAO,OAAO,EAAI,EAAA,CAAC;IAC1C,CAAC;AACD,OAAI,CAAA,WAAa,MAAI,CAAG;AACpB,WAAO,CAAA,CAAA,IAAI,AAAC,CAAC,WAAU,CAAC,KAAK,AAAC,CAAC,EAAC,CAAC,CAAC;IACtC;AAAA,AACA,OAAI,aAAY,IAAI,cAAc,AAAC,CAAC,CAAA,CAAC,CAAG;AACpC,WAAO,GAAC,CAAC;IACb;AAAA,AACA,OAAI,aAAY,IAAI,cAAc,AAAC,CAAC,CAAA,CAAC,CAAA,EAAK,CAAA,aAAY,IAAI,QAAQ,AAAC,CAAC,CAAA,CAAC,CAAA,EAAK,UAAQ,CAAG;AACjF,WAAO,CAAA,WAAU,AAAC,CAAC,KAAI,UAAU,MAAM,MAAM,AAAC,CAAC,aAAY,IAAI,oBAAoB,AAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IAC7F;AAAA,AACA,OAAI,aAAY,IAAI,cAAc,AAAC,CAAC,CAAA,CAAC,CAAG;AACpC,WAAO,CAAA,WAAU,AAAC,CAAC,aAAY,IAAI,iBAAiB,AAAC,CAAC,aAAY,IAAI,cAAc,AAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IAC9F;AAAA,AACA,OAAI,QAAO,AAAC,CAAC,CAAA,CAAC,CAAG;AACb,WAAO,CAAA,WAAU,AAAC,CAAC,aAAY,IAAI,iBAAiB,AAAC,CAAC,CAAA,CAAC,CAAC,CAAC;IAC7D;AAAA,AACA,SAAO,CAAA,aAAY,IAAI,QAAQ,AAAC,CAAC,CAAA,CAAC,CAAC;EACvC;AA9JA,AA8JA,OA9JK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA8JgB;AC/JnC,KAAK,SAAS,AAAC,CAAC,iCAAgC,CAAG,EAAC,0BAAyB,CAAE,iCAA+B,CAAE,iCAA+B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAzL,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,UAAS,CAAC;AACd,AAAI,IAAA,CAAA,WAAU,EAAI,GAAC,CAAC;AACpB,AAAI,IAAA,CAAA,sBAAqB,EAAI,GAAC,CAAC;AAC/B,AAAI,IAAA,CAAA,cAAa,EAAI,GAAC,CAAC;AAWvB,SAAS,UAAQ,CAAE,EAAC,CAAG;AACnB,OAAI,MAAK,OAAO,KAAK,iBAAiB,CAAG;AACrC,UAAM,IAAI,MAAI,AAAC,CAAC,qCAAoC,CAAC,CAAC;IAC1D;AAAA,AACI,MAAA,CAAA,aAAY,EAAI,CAAA,MAAK,OAAO,KAAK,KAAK,AAAC,CAAC;AACxC,eAAS,CAAG,YAAU;AACtB,iBAAW,CAAG,cAAY;AAC1B,gBAAU,CAAG,aAAW;AACxB,kBAAY,CAAG,eAAa;AAC5B,sBAAgB,CAAG,mBAAiB;AACpC,qBAAe,CAAG,KAAG;AAAA,IACzB,CAAC,CAAC;AACF,SAAO,UAAS,AAAC,CAAE;AACf,AAAI,QAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,UAAS,GAAA,CAAA,EAAC,EAAI,EAAA,CAAG,CAAA,EAAC,EAAI,CAAA,SAAQ,OAAO,CAAG,CAAA,EAAC,EAAE,CAAG;AAC1C,WAAG,CAAE,EAAC,EAAI,EAAA,CAAC,EAAI,CAAA,SAAQ,CAAE,EAAC,CAAC,CAAC;MAChC;AAAA,AAEA,eAAS,EAAI,IAAI,CAAA,OAAM,yBAAyB,AAAC,EAAC,CAAC;AACnD,uBAAiB,AAAC,EAAC,CAAC;AACpB,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,aAAY,IAAI,AAAC,CAAC,SAAS,AAAC,CAAE;AACpC,AAAI,UAAA,CAAA,GAAE,EAAI,CAAA,EAAC,MAAM,AAAC,CAAC,IAAK,EAAA,CAAG,KAAG,CAAC,CAAC;AAChC,sBAAc,AAAC,EAAC,CAAC;AACjB,aAAO,IAAE,CAAC;MACd,CAAC,CAAC;AACF,SAAI,sBAAqB,OAAO,EAAI,EAAA,CAAG;AACnC,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,sBAAqB,OAAO,EAAI,yCAAuC,CAAC,CAAC;MAClH;AAAA,AACA,SAAI,cAAa,OAAO,EAAI,EAAA,CAAG;AAC3B,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,cAAa,OAAO,EAAI,gCAA8B,CAAC,CAAC;MACjG;AAAA,AACA,eAAS,EAAI,KAAG,CAAC;AACjB,iBAAW,YAAY,MAAM,AAAC,CAAC,WAAU,CAAC,CAAC;AAC3C,WAAO,IAAE,CAAC;IACd,CAAC;EACL;AAAA,AACA,QAAM,UAAU,EAAI,UAAQ,CAAC;AAE7B,SAAS,mBAAiB,CAAC,AAAC,CAAE;AAC1B,eAAW,YAAY,MAAM,AAAC,CAAC,WAAU,CAAC,CAAC;AAC3C,eAAW,YAAY,MAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AACtD,eAAW,YAAY,MAAM,AAAC,CAAC,cAAa,CAAC,CAAC;EAClD;AAAA,AACA,QAAM,mBAAmB,EAAI,mBAAiB,CAAC;AAS/C,SAAS,KAAG,CAAE,MAAK,CAAG;AAClB,OAAI,MAAK,IAAM,KAAK,EAAA,CAAG;AAAE,WAAK,EAAI,EAAA,CAAC;IAAE;AAAA,AACrC,yBAAqB,AAAC,EAAC,CAAC;AACxB,kBAAc,AAAC,EAAC,CAAC;AACjB,aAAS,KAAK,AAAC,CAAC,MAAK,CAAC,CAAC;EAC3B;AAAA,AACA,QAAM,KAAK,EAAI,KAAG,CAAC;AAInB,SAAS,gBAAc,CAAC,AAAC,CAAE;AACvB,yBAAqB,AAAC,EAAC,CAAC;AACxB,UAAO,WAAU,OAAO,EAAI,EAAA,CAAG;AAC3B,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,YAAW,YAAY,SAAS,AAAC,CAAC,WAAU,CAAG,EAAA,CAAC,CAAC;AACjE,cAAQ,AAAC,EAAC,CAAC;IACf;AAAA,EACJ;AAAA,AACA,QAAM,gBAAgB,EAAI,gBAAc,CAAC;AACzC,SAAS,YAAU,CAAE,EAAC,CAAG,CAAA,KAAI,CAAG;AAC5B,AAAI,MAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,QAAS,GAAA,CAAA,EAAC,EAAI,EAAA,CAAG,CAAA,EAAC,EAAI,CAAA,SAAQ,OAAO,CAAG,CAAA,EAAC,EAAE,CAAG;AAC1C,SAAG,CAAE,EAAC,EAAI,EAAA,CAAC,EAAI,CAAA,SAAQ,CAAE,EAAC,CAAC,CAAC;IAChC;AAAA,AACI,MAAA,CAAA,EAAC,EAAI,CAAA,WAAU,AAAC,CAAC,EAAC,CAAC,CAAC;AACxB,AAAI,MAAA,CAAA,EAAC,EAAI,CAAA,UAAS,iBAAiB,AAAC,CAAC,EAAC,CAAG,MAAI,CAAG,KAAG,CAAC,CAAC;AACrD,iBAAa,KAAK,AAAC,CAAC,EAAC,CAAC,CAAC;AACvB,aAAS,iBAAiB,AAAC,CAAC,aAAY,AAAC,CAAC,EAAC,CAAC,CAAG,MAAI,CAAC,CAAC;AACrD,SAAO,GAAC,CAAC;EACb;AAAA,AACA,SAAS,cAAY,CAAE,EAAC,CAAG;AACvB,gBAAY,AAAC,CAAC,EAAC,CAAC,CAAC;AACjB,SAAO,CAAA,UAAS,qBAAqB,AAAC,CAAC,EAAC,CAAC,CAAC;EAC9C;AAAA,AACA,SAAS,aAAW,CAAE,EAAC,CAAG,CAAA,QAAO,CAAG;AAChC,AAAI,MAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,QAAS,GAAA,CAAA,EAAC,EAAI,EAAA,CAAG,CAAA,EAAC,EAAI,CAAA,SAAQ,OAAO,CAAG,CAAA,EAAC,EAAE,CAAG;AAC1C,SAAG,CAAE,EAAC,EAAI,EAAA,CAAC,EAAI,CAAA,SAAQ,CAAE,EAAC,CAAC,CAAC;IAChC;AAAA,AACI,MAAA,CAAA,EAAC,EAAI,CAAA,WAAU,AAAC,CAAC,EAAC,CAAC,CAAC;AACxB,AAAI,MAAA,CAAA,EAAC,EAAI,CAAA,UAAS,iBAAiB,AAAC,CAAC,EAAC,CAAG,SAAO,CAAG,KAAG,CAAG,KAAG,CAAC,CAAC;AAC9D,yBAAqB,KAAK,AAAC,CAAC,EAAC,CAAC,CAAC;AAC/B,SAAO,GAAC,CAAC;EACb;AAAA,AACA,SAAS,eAAa,CAAE,EAAC,CAAG;AACxB,eAAW,YAAY,OAAO,AAAC,CAAC,sBAAqB,CAAG,GAAC,CAAC,CAAC;AAC3D,SAAO,CAAA,UAAS,qBAAqB,AAAC,CAAC,EAAC,CAAC,CAAC;EAC9C;AAAA,AACA,SAAS,YAAU,CAAE,EAAC,CAAG;AACrB,SAAO,UAAS,AAAC,CAAE;AACf,AAAI,QAAA,CAAA,IAAG,EAAI,GAAC,CAAC;AACb,UAAS,GAAA,CAAA,EAAC,EAAI,EAAA,CAAG,CAAA,EAAC,EAAI,CAAA,SAAQ,OAAO,CAAG,CAAA,EAAC,EAAE,CAAG;AAC1C,WAAG,CAAE,EAAC,EAAI,EAAA,CAAC,EAAI,CAAA,SAAQ,CAAE,EAAC,CAAC,CAAC;MAChC;AAAA,AACA,OAAC,MAAM,AAAC,CAAC,MAAK,OAAO,CAAG,KAAG,CAAC,CAAC;AAC7B,oBAAc,AAAC,EAAC,CAAC;IACrB,CAAC;EACL;AAAA,AACA,SAAS,mBAAiB,CAAE,SAAQ,CAAG;AACnC,cAAU,KAAK,AAAC,CAAC,SAAQ,CAAC,CAAC;EAC/B;AAAA,AACA,SAAS,cAAY,CAAE,EAAC,CAAG;AACvB,SAAO,UAAS,AAAC,CAAE;AAAE,iBAAW,YAAY,OAAO,AAAC,CAAC,cAAa,CAAG,GAAC,CAAC,CAAC;IAAE,CAAC;EAC/E;AAAA,AACA,SAAS,uBAAqB,CAAC,AAAC,CAAE;AAC9B,OAAI,CAAC,MAAK,OAAO,KAAK,CAAA,EAAK,EAAC,MAAK,OAAO,KAAK,iBAAiB,CAAG;AAC7D,UAAM,IAAI,MAAI,AAAC,CAAC,wEAAuE,CAAC,CAAC;IAC7F;AAAA,EACJ;AAxIA,AAwIA,OAxIK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAwIkB;ACzIrC,KAAK,SAAS,AAAC,CAAC,6CAA4C,CAAG,EAAC,sBAAqB,CAAE,2BAAyB,CAAE,iCAA+B,CAAE,8CAA4C,CAAE,yCAAuC,CAAE,oCAAkC,CAAE,oDAAkD,CAAE,6BAA2B,CAAE,kCAAgC,CAAE,oCAAkC,CAAE,wCAAsC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAArf,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,UAAU,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AACxD,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAA,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,QAAA,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,AACrD,WAAS,GAAC,CAAC,AAAC,CAAE;AAAE,SAAG,YAAY,EAAI,EAAA,CAAC;IAAE;AAAA,AACtC,IAAA,UAAU,EAAI,CAAA,CAAA,IAAM,KAAG,CAAA,CAAI,CAAA,MAAK,OAAO,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,EAAC,EAAC,UAAU,EAAI,CAAA,CAAA,UAAU,CAAG,IAAI,GAAC,AAAC,EAAT,AAAU,CAAC,CAAC;EACxF,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;AAAA,AACjI,WAAQ,SAAQ,OAAO;AACnB,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,OAAK,CAAC,CAAC;AAAA,AAC1F,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,CAAG,KAAK,EAAA,CAAC;QAAE,CAAG,KAAK,EAAA,CAAC,CAAC;AAAA,AACvG,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,KAAG,CAAC,CAAC;AAAA,IACzG;EACJ,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAA4C,CAAC,CAAC;AACjF,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AACvE,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,mCAAkC,CAAC,CAAC;AAC7D,AAAI,IAAA,CAAA,0BAAyB,EAAI,CAAA,OAAM,AAAC,CAAC,mDAAkD,CAAC,CAAC;AAC7F,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,4BAAQ,CAAC,CAAC;AAChC,AAAI,IAAA,CAAA,QAAO,EAAI,CAAA,OAAM,AAAC,CAAC,iCAAgC,CAAC,CAAC;AACzD,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,OAAM,AAAC,CAAC,mCAAkC,CAAC,CAAC;AAChE,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,uCAAsC,CAAC,CAAC;AAItE,AAAI,IAAA,CAAA,iBAAgB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACjC,WAAS,kBAAgB,CAAC,AAAC,CAAE,GAC7B;AAAA,AACA,SAAO,kBAAgB,CAAC;EAC5B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,kBAAkB,EAAI,kBAAgB,CAAC;AAC7C,AAAI,IAAA,CAAA,gBAAe,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AACtC,YAAQ,AAAC,CAAC,gBAAe,CAAG,OAAK,CAAC,CAAC;AACnC,WAAS,iBAAe,CAAC,AAAC,CAAE;AACxB,WAAK,MAAM,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;IACjC;AAAA,AACA,SAAO,iBAAe,CAAC;EAC3B,CAAC,AAAC,CAAC,iBAAgB,CAAC,CAAC;AACrB,QAAM,iBAAiB,EAAI,iBAAe,CAAC;AAC3C,AAAI,IAAA,CAAA,iBAAgB,EAAI,CAAA,CAAC,SAAU,MAAK,CAAG;AACvC,YAAQ,AAAC,CAAC,iBAAgB,CAAG,OAAK,CAAC,CAAC;AACpC,WAAS,kBAAgB,CAAE,YAAW,CAAG;AACrC,WAAK,KAAK,AAAC,CAAC,IAAG,CAAC,CAAC;AACjB,SAAG,aAAa,EAAI,IAAI,CAAA,eAAc,cAAc,AAAC,CAAC,UAAS,aAAa,AAAC,CAAC,YAAW,SAAS,CAAC,CAAG,EAAA,CAAC,CAAC;AACxG,SAAG,qBAAqB,EAAI,CAAA,UAAS,aAAa,AAAC,CAAC,YAAW,SAAS,CAAC,CAAC;AAC1E,SAAG,cAAc,EAAI,aAAW,CAAC;IACrC;AAAA,AACA,oBAAgB,UAAU,cAAc,EAAI,UAAS,AAAC,CAAE;AACpD,SAAG,qBAAqB,eAAe,cAAc,AAAC,EAAC,CAAC;AACxD,SAAG,qBAAqB,eAAe,eAAe,AAAC,EAAC,CAAC;IAC7D,CAAC;AACD,oBAAgB,UAAU,QAAQ,EAAI,UAAS,AAAC,CAAE;AAAE,SAAG,cAAc,QAAQ,AAAC,EAAC,CAAC;IAAE,CAAC;AACnF,SAAO,kBAAgB,CAAC;EAC5B,CAAC,AAAC,CAAC,gBAAe,CAAC,CAAC;AACpB,QAAM,kBAAkB,EAAI,kBAAgB,CAAC;AAC7C,AAAI,IAAA,CAAA,kBAAiB,EAAI,EAAA,CAAC;AAI1B,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACpC,WAAS,qBAAmB,CAAE,SAAQ,CAAG;AACrC,SAAG,UAAU,EAAI,UAAQ,CAAC;AAE1B,SAAG,mBAAmB,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAEnC,SAAG,oBAAoB,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAEpC,SAAG,mBAAmB,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAEnC,SAAG,uBAAuB,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;AAEvC,SAAG,eAAe,EAAI,IAAI,IAAE,AAAC,EAAC,CAAC;IACnC;AAAA,AAEA,uBAAmB,UAAU,OAAO,EAAI,UAAS,AAAC,CAAE;AAChD,AAAI,QAAA,CAAA,KAAI,EAAI,IAAI,qBAAmB,AAAC,CAAC,IAAG,UAAU,CAAC,CAAC;AACpD,UAAI,eAAe,EAAI,CAAA,YAAW,WAAW,MAAM,AAAC,CAAC,IAAG,eAAe,CAAC,CAAC;AACzE,UAAI,oBAAoB,EAAI,CAAA,YAAW,WAAW,MAAM,AAAC,CAAC,IAAG,oBAAoB,CAAC,CAAC;AACnF,UAAI,mBAAmB,EAAI,CAAA,YAAW,WAAW,MAAM,AAAC,CAAC,IAAG,mBAAmB,CAAC,CAAC;AACjF,WAAO,MAAI,CAAC;IAChB,CAAC;AAUD,uBAAmB,UAAU,iBAAiB,EAAI,UAAU,aAAY,CAAG,CAAA,QAAO,CAAG;AACjF,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,OAAO,AAAC,EAAC,CAAC;AACzB,UAAI,mBAAmB,IAAI,AAAC,CAAC,aAAY,CAAG,SAAO,CAAC,CAAC;AACrD,WAAO,MAAI,CAAC;IAChB,CAAC;AASD,uBAAmB,UAAU,aAAa,EAAI,UAAU,aAAY,CAAG,CAAA,IAAG,CAAG;AACzE,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,OAAO,AAAC,EAAC,CAAC;AACzB,UAAI,eAAe,IAAI,AAAC,CAAC,aAAY,CAAG,KAAG,CAAC,CAAC;AAC7C,WAAO,MAAI,CAAC;IAChB,CAAC;AAUD,uBAAmB,UAAU,kBAAkB,EAAI,UAAU,aAAY,CAAG,CAAA,IAAG,CAAG,CAAA,EAAC,CAAG;AAClF,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,OAAO,AAAC,EAAC,CAAC;AACzB,AAAI,QAAA,CAAA,qBAAoB,EAAI,CAAA,KAAI,oBAAoB,IAAI,AAAC,CAAC,aAAY,CAAC,CAAC;AACxE,SAAI,CAAC,MAAK,UAAU,AAAC,CAAC,qBAAoB,CAAC,CAAG;AAC1C,YAAI,oBAAoB,IAAI,AAAC,CAAC,aAAY,CAAG,IAAI,IAAE,AAAC,EAAC,CAAC,CAAC;AACvD,4BAAoB,EAAI,CAAA,KAAI,oBAAoB,IAAI,AAAC,CAAC,aAAY,CAAC,CAAC;MACxE;AAAA,AACA,0BAAoB,IAAI,AAAC,CAAC,IAAG,CAAG,GAAC,CAAC,CAAC;AACnC,WAAO,MAAI,CAAC;IAChB,CAAC;AAgBD,uBAAmB,UAAU,kBAAkB,EAAI,UAAU,IAAG,CAAG,CAAA,SAAQ,CAAG;AAC1E,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,OAAO,AAAC,EAAC,CAAC;AACzB,UAAI,mBAAmB,IAAI,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;AAC7C,WAAO,MAAI,CAAC;IAChB,CAAC;AAID,uBAAmB,UAAU,iBAAiB,EAAI,UAAU,IAAG,CAAG,CAAA,SAAQ,CAAG;AACzE,WAAO,CAAA,IAAG,kBAAkB,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;IAClD,CAAC;AAgBD,uBAAmB,UAAU,sBAAsB,EAAI,UAAU,IAAG,CAAG,CAAA,SAAQ,CAAG;AAC9E,AAAI,QAAA,CAAA,KAAI,EAAI,CAAA,IAAG,OAAO,AAAC,EAAC,CAAC;AACzB,UAAI,uBAAuB,IAAI,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;AACjD,WAAO,MAAI,CAAC;IAChB,CAAC;AAID,uBAAmB,UAAU,qBAAqB,EAAI,UAAU,IAAG,CAAG,CAAA,SAAQ,CAAG;AAC7E,WAAO,CAAA,IAAG,sBAAsB,AAAC,CAAC,IAAG,CAAG,UAAQ,CAAC,CAAC;IACtD,CAAC;AAMD,uBAAmB,UAAU,YAAY,EAAI,UAAU,iBAAgB,CAAG;AACtE,AAAI,QAAA,CAAA,qBAAoB,EAAI,CAAA,IAAG,UAAU,IAAI,AAAC,CAAC,oBAAmB,kBAAkB,CAAC,CAAC;AACtF,AAAI,QAAA,CAAA,gBAAe,EAAI,CAAA,IAAG,UAAU,IAAI,AAAC,CAAC,eAAc,aAAa,CAAC,CAAC;AACvE,SAAG,eAAe,QAAQ,AAAC,CAAC,SAAU,IAAG,CAAG,CAAA,IAAG,CAAG;AAAE,aAAO,CAAA,gBAAe,QAAQ,AAAC,CAAC,IAAG,CAAG,KAAG,CAAC,CAAC;MAAE,CAAC,CAAC;AACnG,SAAG,mBAAmB,QAAQ,AAAC,CAAC,SAAU,QAAO,CAAG,CAAA,IAAG,CAAG;AACtD,aAAO,CAAA,gBAAe,kBAAkB,AAAC,CAAC,IAAG,CAAG,SAAO,CAAC,CAAC;MAC7D,CAAC,CAAC;AACF,SAAG,oBAAoB,QAAQ,AAAC,CAAC,SAAU,SAAQ,CAAG,CAAA,SAAQ,CAAG;AAC7D,gBAAQ,QAAQ,AAAC,CAAC,SAAU,EAAC,CAAG,CAAA,IAAG,CAAG;AAAE,yBAAe,sBAAsB,AAAC,CAAC,SAAQ,CAAG,KAAG,CAAG,GAAC,CAAC,CAAC;QAAE,CAAC,CAAC;MAC3G,CAAC,CAAC;AACF,SAAG,mBAAmB,QAAQ,AAAC,CAAC,SAAU,QAAO,CAAG,CAAA,IAAG,CAAG;AACtD,aAAO,CAAA,qBAAoB,oBAAoB,AAAC,CAAC,IAAG,CAAG,SAAO,CAAC,CAAC;MACpE,CAAC,CAAC;AACF,SAAG,uBAAuB,QAAQ,AAAC,CAAC,SAAU,QAAO,CAAG,CAAA,IAAG,CAAG;AAAE,aAAO,CAAA,qBAAoB,wBAAwB,AAAC,CAAC,IAAG,CAAG,SAAO,CAAC,CAAC;MAAE,CAAC,CAAC;AACxI,AAAI,QAAA,CAAA,QAAO,EAAI,CAAA,MAAK,EAAI,CAAA,kBAAiB,EAAE,CAAC;AAC5C,AAAI,QAAA,CAAA,MAAK,EAAI,CAAA,OAAM,GAAG,AAAC,CAAC,YAAW,EAAI,SAAO,CAAA,CAAI,YAAU,CAAC,CAAC;AAC9D,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,IAAG,UAAU,IAAI,AAAC,CAAC,QAAO,SAAS,CAAC,CAAC;AAE/C,AAAI,QAAA,CAAA,QAAO,EAAI,CAAA,aAAY,IAAI,iBAAiB,AAAC,CAAC,GAAE,CAAG,aAAW,CAAC,CAAC;AACpE,UAAS,GAAA,CAAA,CAAA,EAAI,EAAA,CAAG,CAAA,CAAA,EAAI,CAAA,QAAO,OAAO,CAAG,CAAA,CAAA,EAAE,CAAG;AACtC,oBAAY,IAAI,OAAO,AAAC,CAAC,QAAO,CAAE,CAAA,CAAC,CAAC,CAAC;MACzC;AAAA,AACA,kBAAY,IAAI,YAAY,AAAC,CAAC,GAAE,KAAK,CAAG,OAAK,CAAC,CAAC;AAC/C,WAAO,CAAA,IAAG,UAAU,IAAI,AAAC,CAAC,0BAAyB,uBAAuB,CAAC,WAC7D,AAAC,CAAC,iBAAgB,CAAG,CAAA,GAAE,EAAI,SAAO,CAAG,CAAA,IAAG,UAAU,CAAC,KACzD,AAAC,CAAC,SAAU,YAAW,CAAG;AAAE,aAAO,IAAI,kBAAgB,AAAC,CAAC,YAAW,CAAC,CAAC;MAAE,CAAC,CAAC;IACtF,CAAC;AACD,uBAAmB,EAAI,CAAA,UAAS,AAAC,CAAC,CAC9B,IAAG,WAAW,AAAC,EAAC,CAChB,CAAA,UAAS,AAAC,CAAC,mBAAkB,CAAG,EAAC,IAAG,SAAS,CAAC,CAAC,CACnD,CAAG,qBAAmB,CAAC,CAAC;AACxB,SAAO,qBAAmB,CAAC;EAC/B,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,qBAAqB,EAAI,qBAAmB,CAAC;AA9NnD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA8N8B;AC/NjD,KAAK,SAAS,AAAC,CAAC,4CAA2C,CAAG,EAAC,0BAAyB,CAAE,iCAA+B,CAAE,iCAA+B,CAAE,+BAA6B,CAAE,sCAAoC,CAAE,uBAAqB,CAAE,8DAA4D,CAAE,mEAAiE,CAAE,kCAAgC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAnc,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;AAAA,AACjI,WAAQ,SAAQ,OAAO;AACnB,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,OAAK,CAAC,CAAC;AAAA,AAC1F,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,CAAG,KAAK,EAAA,CAAC;QAAE,CAAG,KAAK,EAAA,CAAC,CAAC;AAAA,AACvG,SAAK,EAAA;AAAG,aAAO,CAAA,UAAS,YAAY,AAAC,CAAC,SAAS,CAAA,CAAG,CAAA,CAAA,CAAG;AAAE,eAAO,CAAA,CAAC,CAAA,GAAK,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAC,GAAK,EAAA,CAAC;QAAE,CAAG,KAAG,CAAC,CAAC;AAAA,IACzG;EACJ,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,8BAA6B,CAAC,CAAC;AACnD,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,qCAAoC,CAAC,CAAC;AAC1D,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,6BAA4B,EAAI,CAAA,OAAM,AAAC,CAAC,6DAA4D,CAAC,CAAC;AAC1G,AAAI,IAAA,CAAA,kCAAiC,EAAI,CAAA,OAAM,AAAC,CAAC,kEAAiE,CAAC,CAAC;AACpH,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,iCAAgC,CAAC,CAAC;AAGvD,QAAM,UAAU,EAAI,OAAK,CAAC;AAC1B,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC1B,WAAS,WAAS,CAAE,eAAc,CAAG,CAAA,gBAAe,CAAG;AACnD,SAAG,gBAAgB,EAAI,gBAAc,CAAC;AACtC,SAAG,iBAAiB,EAAI,iBAAe,CAAC;IAC5C;AAAA,AACA,aAAS,UAAU,UAAU,EAAI,UAAU,GAAE,CAAG,CAAA,IAAG,CAAG;AAClD,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAI,CAAC,MAAK,UAAU,AAAC,CAAC,GAAE,CAAC,CAAG;AACxB,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,MAAK,QAAQ,AAAC,CAAC,GAAE,CAAC,CAAG;AACrB,aAAO,CAAA,GAAE,IAAI,AAAC,CAAC,SAAU,CAAA,CAAG;AAAE,eAAO,CAAA,KAAI,UAAU,AAAC,CAAC,CAAA,CAAG,KAAG,CAAC,CAAC;QAAE,CAAC,CAAC;MACrE;AAAA,AACA,SAAI,IAAG,GAAK,CAAA,OAAM,UAAU,CAAG;AAC3B,aAAO,IAAE,CAAC;MACd;AAAA,AACA,SAAI,IAAG,GAAK,CAAA,KAAI,mBAAmB,CAAG;AAClC,aAAO,CAAA,IAAG,gBAAgB,UAAU,AAAC,CAAC,GAAE,CAAC,CAAC;MAC9C,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,cAAc,CAAG;AAClC,aAAO,CAAA,IAAG,iBAAiB,uBAAuB,AAAC,CAAC,GAAE,CAAC,CAAC;MAC5D,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,kBAAkB,CAAG;AACtC,aAAO,CAAA,IAAG,iBAAiB,2BAA2B,AAAC,CAAC,GAAE,CAAC,CAAC;MAChE,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,oBAAoB,CAAG;AACxC,aAAO,CAAA,IAAG,2BAA2B,AAAC,CAAC,GAAE,CAAC,CAAC;MAC/C,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,qBAAqB,CAAG;AACzC,aAAO,CAAA,oBAAmB,AAAC,CAAC,GAAE,CAAC,CAAC;MACpC,KACK,KAAI,IAAG,IAAM,CAAA,KAAI,wBAAwB,CAAG;AAC7C,aAAO,CAAA,IAAG,yBAAyB,AAAC,CAAC,GAAE,CAAC,CAAC;MAC7C,KACK,KAAI,IAAG,IAAM,CAAA,MAAK,kBAAkB,CAAG;AACxC,aAAO,CAAA,MAAK,cAAc,AAAC,CAAC,GAAE,CAAC,CAAC;MACpC,KACK;AACD,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,oBAAmB,EAAI,CAAA,IAAG,SAAS,AAAC,EAAC,CAAC,CAAC;MAChF;AAAA,IACJ,CAAC;AACD,aAAS,UAAU,YAAY,EAAI,UAAU,GAAE,CAAG,CAAA,IAAG,CAAG,CAAA,IAAG,CAAG;AAC1D,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAI,CAAC,MAAK,UAAU,AAAC,CAAC,GAAE,CAAC,CAAG;AACxB,aAAO,KAAG,CAAC;MACf;AAAA,AACA,SAAI,MAAK,QAAQ,AAAC,CAAC,GAAE,CAAC,CAAG;AACrB,AAAI,UAAA,CAAA,GAAE,EAAI,GAAC,CAAC;AACZ,UAAE,QAAQ,AAAC,CAAC,SAAU,GAAE,CAAG;AAAE,eAAO,CAAA,GAAE,KAAK,AAAC,CAAC,KAAI,YAAY,AAAC,CAAC,GAAE,CAAG,KAAG,CAAG,KAAG,CAAC,CAAC,CAAC;QAAE,CAAC,CAAC;AACpF,aAAO,IAAE,CAAC;MACd;AAAA,AACA,SAAI,IAAG,GAAK,CAAA,OAAM,UAAU,CAAG;AAC3B,aAAO,IAAE,CAAC;MACd;AAAA,AACA,SAAI,IAAG,GAAK,CAAA,KAAI,mBAAmB,CAAG;AAClC,aAAO,CAAA,IAAG,gBAAgB,YAAY,AAAC,CAAC,GAAE,CAAC,CAAC;MAChD,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,cAAc,CAAG;AAClC,aAAO,CAAA,IAAG,iBAAiB,yBAAyB,AAAC,CAAC,GAAE,CAAC,CAAC;MAC9D,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,kBAAkB,CAAG;AACtC,aAAO,CAAA,IAAG,iBAAiB,6BAA6B,AAAC,CAAC,GAAE,CAAC,CAAC;MAClE,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,oBAAoB,CAAG;AACxC,aAAO,CAAA,IAAG,6BAA6B,AAAC,CAAC,GAAE,CAAC,CAAC;MACjD,KACK,KAAI,IAAG,GAAK,CAAA,KAAI,qBAAqB,CAAG;AACzC,aAAO,CAAA,sBAAqB,AAAC,CAAC,GAAE,CAAC,CAAC;MACtC,KACK,KAAI,IAAG,IAAM,CAAA,KAAI,wBAAwB,CAAG;AAC7C,aAAO,CAAA,IAAG,2BAA2B,AAAC,CAAC,GAAE,CAAC,CAAC;MAC/C,KACK,KAAI,IAAG,IAAM,CAAA,MAAK,kBAAkB,CAAG;AACxC,aAAO,CAAA,MAAK,0BAA0B,CAAE,GAAE,CAAC,CAAC;MAChD,KACK;AACD,YAAM,IAAI,CAAA,YAAW,cAAc,AAAC,CAAC,sBAAqB,EAAI,CAAA,IAAG,SAAS,AAAC,EAAC,CAAC,CAAC;MAClF;AAAA,IACJ,CAAC;AACD,aAAS,UAAU,YAAY,EAAI,UAAU,GAAE,CAAG,CAAA,IAAG,CAAG;AACpD,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,AAAI,QAAA,CAAA,MAAK,EAAI,GAAC,CAAC;AACf,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,MAAK,UAAU,AAAC,CAAC,IAAG,CAAC,CAAC;AACtC,QAAE,QAAQ,AAAC,CAAC,SAAU,KAAI,CAAG,CAAA,GAAE,CAAG;AAC9B,WAAI,SAAQ,CAAG;AACX,eAAK,CAAE,GAAE,CAAC,EAAI,CAAA,KAAI,UAAU,AAAC,CAAC,KAAI,CAAG,KAAG,CAAC,CAAC;QAC9C,KACK;AACD,eAAK,CAAE,GAAE,CAAC,EAAI,MAAI,CAAC;QACvB;AAAA,MACJ,CAAC,CAAC;AACF,WAAO,OAAK,CAAC;IACjB,CAAC;AAMD,aAAS,UAAU,YAAY,EAAI,UAAU,GAAE,CAAG,CAAA,IAAG,CAAG,CAAA,IAAG,CAAG;AAC1D,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,SAAI,MAAK,UAAU,AAAC,CAAC,IAAG,CAAC,CAAG;AACxB,AAAI,UAAA,CAAA,GAAE,EAAI,IAAI,CAAA,YAAW,IAAI,AAAC,EAAC,CAAC;AAChC,mBAAW,iBAAiB,QAAQ,AAAC,CAAC,GAAE,CAAG,UAAU,GAAE,CAAG,CAAA,GAAE,CAAG;AAAE,YAAE,IAAI,AAAC,CAAC,GAAE,CAAG,CAAA,KAAI,YAAY,AAAC,CAAC,GAAE,CAAG,KAAG,CAAG,KAAG,CAAC,CAAC,CAAC;QAAE,CAAC,CAAC;AACrH,aAAO,IAAE,CAAC;MACd,KACK;AACD,aAAO,CAAA,YAAW,WAAW,oBAAoB,AAAC,CAAC,GAAE,CAAC,CAAC;MAC3D;AAAA,IACJ,CAAC;AACD,aAAS,UAAU,oBAAoB,EAAI,UAAU,aAAY,CAAG;AAAE,SAAG,iBAAiB,SAAS,AAAC,CAAC,aAAY,CAAC,CAAC;IAAE,CAAC;AACtH,aAAS,UAAU,2BAA2B,EAAI,UAAU,UAAS,CAAG;AACpE,WAAO;AACH,mBAAW,CAAG,CAAA,IAAG,UAAU,AAAC,CAAC,UAAS,WAAW,CAAG,CAAA,KAAI,cAAc,CAAC;AACvE,0BAAkB,CAAG,CAAA,UAAS,kBAAkB;AAAA,MACpD,CAAC;IACL,CAAC;AACD,aAAS,UAAU,6BAA6B,EAAI,UAAU,GAAE,CAAG;AAC/D,WAAO,IAAI,CAAA,KAAI,oBAAoB,AAAC,CAAC,IAAG,YAAY,AAAC,CAAC,GAAE,CAAE,YAAW,CAAC,CAAG,CAAA,KAAI,cAAc,CAAC,CAAG,CAAA,GAAE,CAAE,mBAAkB,CAAC,CAAC,CAAC;IAC5H,CAAC;AACD,aAAS,UAAU,yBAAyB,EAAI,UAAU,GAAE,CAAG;AAC3D,WAAO;AACH,WAAG,CAAG,CAAA,GAAE,GAAG;AACX,gBAAQ,CAAG,CAAA,GAAE,QAAQ;AACrB,sBAAc,CAAG,CAAA,IAAG,UAAU,AAAC,CAAC,GAAE,cAAc,CAAG,CAAA,MAAK,kBAAkB,CAAC;AAC3E,iBAAS,CAAG,CAAA,IAAG,UAAU,AAAC,CAAC,GAAE,SAAS,CAAG,CAAA,KAAI,qBAAqB,CAAC;AACnE,eAAO,CAAG,CAAA,IAAG,UAAU,AAAC,CAAC,GAAE,OAAO,CAAG,CAAA,OAAM,UAAU,CAAC;AAAA,MAC1D,CAAC;IACL,CAAC;AACD,aAAS,UAAU,2BAA2B,EAAI,UAAU,GAAE,CAAG;AAC7D,WAAO,IAAI,CAAA,KAAI,wBAAwB,AAAC,CAAC,GAAE,CAAE,IAAG,CAAC,CAAG,CAAA,GAAE,CAAE,SAAQ,CAAC,CAAG,CAAA,IAAG,YAAY,AAAC,CAAC,GAAE,CAAE,eAAc,CAAC,CAAG,CAAA,MAAK,kBAAkB,CAAC,CAAG,CAAA,IAAG,YAAY,AAAC,CAAC,GAAE,CAAE,UAAS,CAAC,CAAG,CAAA,KAAI,qBAAqB,CAAC,CAAG,CAAA,IAAG,YAAY,AAAC,CAAC,GAAE,CAAE,QAAO,CAAC,CAAG,CAAA,OAAM,UAAU,CAAC,CAAC,CAAC;IAC5P,CAAC;AACD,aAAS,EAAI,CAAA,UAAS,AAAC,CAAC,CACpB,IAAG,WAAW,AAAC,EAAC,CAChB,CAAA,UAAS,AAAC,CAAC,mBAAkB,CAAG,EAAC,6BAA4B,wBAAwB,CAAG,CAAA,kCAAiC,6BAA6B,CAAC,CAAC,CAC5J,CAAG,WAAS,CAAC,CAAC;AACd,SAAO,WAAS,CAAC;EACrB,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,WAAW,EAAI,WAAS,CAAC;AAC/B,SAAS,qBAAmB,CAAE,GAAE,CAAG;AAC/B,SAAO,CAAA,GAAE,MAAM,AAAC,CAAC,8BAA6B,CAAG,KAAG,CAAC,CAAC;EAC1D;AAAA,AACA,SAAS,uBAAqB,CAAE,IAAG,CAAG;AAClC,SAAO,CAAA,iCAAgC,CAAE,IAAG,CAAE,mBAAkB,CAAC,CAAC,AAAC,CAAC,IAAG,CAAC,CAAC;EAC7E;AAAA,AACI,IAAA,CAAA,2BAA0B,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC3C,WAAS,4BAA0B,CAAC,AAAC,CAAE,GACvC;AAAA,AACA,8BAA0B,UAAU,UAAU,EAAI,UAAU,GAAE,CAAG,CAAA,OAAM,CAAG;AACtE,WAAO;AACH,0BAAkB,CAAG,EAAA;AACrB,gBAAQ,CAAG,CAAA,GAAE,QAAQ;AACrB,uBAAe,CAAG,CAAA,GAAE,eAAe;AACnC,cAAM,CAAG,CAAA,GAAE,MAAM;AAAA,MACrB,CAAC;IACL,CAAC;AACD,8BAA0B,UAAU,eAAe,EAAI,UAAU,GAAE,CAAG,CAAA,OAAM,CAAG;AAC3E,WAAO;AAAE,0BAAkB,CAAG,EAAA;AAAG,cAAM,CAAG,CAAA,GAAE,MAAM;AAAG,uBAAe,CAAG,CAAA,GAAE,eAAe;AAAA,MAAE,CAAC;IAC/F,CAAC;AACD,8BAA0B,UAAU,kBAAkB,EAAI,UAAU,GAAE,CAAG,CAAA,OAAM,CAAG;AAC9E,WAAO;AACH,0BAAkB,CAAG,EAAA;AACrB,gBAAQ,CAAG,CAAA,GAAE,QAAQ;AACrB,uBAAe,CAAG,CAAA,GAAE,eAAe;AACnC,aAAK,CAAG,CAAA,GAAE,KAAK;AACf,0BAAkB,CAAG,CAAA,GAAE,kBAAkB;AACzC,4BAAoB,CAAG,CAAA,GAAE,oBAAoB;AAAA,MACjD,CAAC;IACL,CAAC;AACD,8BAA0B,UAAU,gBAAgB,EAAI,UAAU,OAAM,CAAG;AAAE,WAAO,EAAE,mBAAkB,CAAG,EAAA,CAAE,CAAC;IAAE,CAAC;AACjH,8BAA0B,UAAU,oBAAoB,EAAI,UAAU,GAAE,CAAG,CAAA,OAAM,CAAG;AAChF,WAAO;AACH,0BAAkB,CAAG,EAAA;AACrB,gBAAQ,CAAG,CAAA,GAAE,QAAQ;AACrB,uBAAe,CAAG,CAAA,GAAE,eAAe;AACnC,aAAK,CAAG,CAAA,GAAE,KAAK;AACf,0BAAkB,CAAG,CAAA,GAAE,kBAAkB;AACzC,4BAAoB,CAAG,CAAA,GAAE,oBAAoB;AAC7C,mBAAW,CAAG,CAAA,GAAE,WAAW;AAAA,MAC/B,CAAC;IACL,CAAC;AACD,8BAA0B,UAAU,kBAAkB,EAAI,UAAU,OAAM,CAAG;AAAE,WAAO,EAAE,mBAAkB,CAAG,EAAA,CAAE,CAAC;IAAE,CAAC;AACnH,8BAA0B,UAAU,sBAAsB,EAAI,UAAU,GAAE,CAAG,CAAA,OAAM,CAAG;AAClF,AAAI,QAAA,CAAA,KAAI,EAAI,KAAG,CAAC;AAChB,AAAI,QAAA,CAAA,QAAO,EAAI,CAAA,GAAE,SAAS,IAAI,AAAC,CAAC,SAAU,KAAI,CAAG;AAAE,aAAO,CAAA,KAAI,MAAM,AAAC,CAAC,KAAI,CAAG,KAAG,CAAC,CAAC;MAAE,CAAC,CAAC;AACtF,WAAO;AACH,0BAAkB,CAAG,EAAA;AACrB,gBAAQ,CAAG,CAAA,GAAE,QAAQ;AACrB,uBAAe,CAAG,CAAA,GAAE,eAAe;AACnC,aAAK,CAAG,CAAA,GAAE,KAAK;AACf,0BAAkB,CAAG,CAAA,GAAE,kBAAkB;AACzC,4BAAoB,CAAG,CAAA,GAAE,oBAAoB;AAC7C,iBAAS,CAAG,CAAA,GAAE,SAAS;AACvB,iBAAS,CAAG,SAAO;AAAA,MACvB,CAAC;IACL,CAAC;AACD,SAAO,4BAA0B,CAAC;EACtC,CAAC,AAAC,EAAC,CAAC;AACJ,AAAI,IAAA,CAAA,8BAA6B,EAAI,IAAI,4BAA0B,AAAC,EAAC,CAAC;AACtE,AAAI,IAAA,CAAA,iCAAgC,EAAI,EACpC,SAAU,IAAG,CAAG;AACZ,SAAO,IAAI,CAAA,KAAI,iBAAiB,AAAC,CAAC,IAAG,CAAE,SAAQ,CAAC,CAAG,CAAA,IAAG,CAAE,gBAAe,CAAC,CAAG,CAAA,IAAG,CAAE,OAAM,CAAC,CAAC,CAAC;EAC7F,CACA,UAAU,IAAG,CAAG;AAAE,SAAO,IAAI,CAAA,KAAI,sBAAsB,AAAC,CAAC,IAAG,CAAE,OAAM,CAAC,CAAG,CAAA,IAAG,CAAE,gBAAe,CAAC,CAAC,CAAC;EAAE,CACjG,UAAU,IAAG,CAAG;AACZ,SAAO,IAAI,CAAA,KAAI,yBAAyB,AAAC,CAAC,IAAG,CAAE,SAAQ,CAAC,CAAG,CAAA,IAAG,CAAE,gBAAe,CAAC,CAAG,CAAA,IAAG,CAAE,MAAK,CAAC,CAAG,CAAA,IAAG,CAAE,mBAAkB,CAAC,CAAG,CAAA,IAAG,CAAE,qBAAoB,CAAC,CAAC,CAAC;EAC5J,CACA,UAAU,IAAG,CAAG;AAAE,SAAO,IAAI,CAAA,KAAI,uBAAuB,AAAC,EAAC,CAAC;EAAE,CAC7D,UAAU,IAAG,CAAG;AAAE,SAAO,IAAI,CAAA,KAAI,2BAA2B,AAAC,CAAC,IAAG,CAAE,SAAQ,CAAC,CAAG,CAAA,IAAG,CAAE,gBAAe,CAAC,CAAG,CAAA,IAAG,CAAE,MAAK,CAAC,CAAG,CAAA,IAAG,CAAE,mBAAkB,CAAC,CAAG,CAAA,IAAG,CAAE,qBAAoB,CAAC,CAAG,CAAA,IAAG,CAAE,YAAW,CAAC,CAAC,CAAC;EAAE,CAClM,UAAU,IAAG,CAAG;AAAE,SAAO,IAAI,CAAA,KAAI,yBAAyB,AAAC,EAAC,CAAC;EAAE,CAC/D,UAAU,IAAG,CAAG;AAAE,SAAO,IAAI,CAAA,KAAI,6BAA6B,AAAC,CAAC,IAAG,CAAE,SAAQ,CAAC,CAAG,CAAA,IAAG,CAAE,gBAAe,CAAC,CAAG,CAAA,IAAG,CAAE,MAAK,CAAC,CAAG,CAAA,IAAG,CAAE,mBAAkB,CAAC,CAAG,CAAA,IAAG,CAAE,qBAAoB,CAAC,CAAG,CAAA,IAAG,CAAE,UAAS,CAAC,CAAG,CAAA,IAAG,CAAE,UAAS,CAAC,IAAI,AAAC,CAAC,SAAU,SAAQ,CAAG;AAAE,WAAO,CAAA,sBAAqB,AAAC,CAAC,SAAQ,CAAC,CAAC;IAAE,CAAC,CAAC,CAAC;EAAE,CAChS,CAAC;AAzOD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAyOkB;AC1OrC,KAAK,SAAS,AAAC,CAAC,oCAAmC,CAAG,EAAC,sBAAqB,CAAE,yCAAuC,CAAE,2CAAyC,CAAE,8CAA4C,CAAE,0CAAwC,CAAE,sDAAoD,CAAE,iCAA+B,CAAE,yCAAuC,CAAE,8CAA4C,CAAE,yCAAuC,CAAE,oDAAkD,CAAE,4BAA0B,CAAE,iCAA+B,CAAE,oCAAkC,CAAE,oDAAkD,CAAE,4CAA0C,CAAE,uCAAqC,CAAE,2CAAyC,CAAE,wCAAsC,CAAE,iCAA+B,CAAE,8CAA4C,CAAE,uBAAqB,CAAE,0BAAwB,CAAE,iCAA+B,CAAE,2BAAyB,CAAE,qCAAmC,CAAE,wCAAsC,CAAE,8CAA4C,CAAE,+BAA6B,CAAE,kCAAgC,CAAE,uCAAqC,CAAE,6CAA2C,CAAE,6BAA2B,CAAE,iCAA+B,CAAE,4CAA0C,CAAE,oDAAkD,CAAE,wCAAsC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA1/C,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AAC3E,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,OAAM,AAAC,CAAC,0CAAyC,CAAC,CAAC;AAClF,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAA4C,CAAC,CAAC;AACjF,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,yCAAwC,CAAC,CAAC;AACrE,AAAI,IAAA,CAAA,kBAAiB,EAAI,CAAA,OAAM,AAAC,CAAC,qDAAoD,CAAC,CAAC;AACvF,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AACvE,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAA4C,CAAC,CAAC;AACjF,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,wCAAuC,CAAC,CAAC;AACvE,AAAI,IAAA,CAAA,0BAAyB,EAAI,CAAA,OAAM,AAAC,CAAC,mDAAkD,CAAC,CAAC;AAC7F,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,SAAQ,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AACzD,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,OAAM,AAAC,CAAC,mCAAkC,CAAC,CAAC;AAChE,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,mDAAkD,CAAC,CAAC;AAClF,AAAI,IAAA,CAAA,yBAAwB,EAAI,CAAA,OAAM,AAAC,CAAC,2CAA0C,CAAC,CAAC;AACpF,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,sCAAqC,CAAC,CAAC;AAC1E,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,OAAM,AAAC,CAAC,0CAAyC,CAAC,CAAC;AAClF,AAAI,IAAA,CAAA,mBAAkB,EAAI,CAAA,OAAM,AAAC,CAAC,uCAAsC,CAAC,CAAC;AAC1E,AAAI,IAAA,CAAA,cAAa,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC9D,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAAyB,CAAC,CAAC;AAClE,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,yBAAwB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC5D,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,WAAU,EAAI,CAAA,OAAM,AAAC,CAAC,oCAAmC,CAAC,CAAC;AAC/D,AAAI,IAAA,CAAA,cAAa,EAAI,CAAA,OAAM,AAAC,CAAC,uCAAsC,CAAC,CAAC;AACrE,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAA4C,CAAC,CAAC;AACjF,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,AAAC,CAAC,8BAA6B,CAAC,CAAC;AACnD,AAAI,IAAA,CAAA,QAAO,EAAI,CAAA,OAAM,AAAC,CAAC,iCAAgC,CAAC,CAAC;AACzD,AAAI,IAAA,CAAA,oBAAmB,EAAI,CAAA,OAAM,AAAC,CAAC,sCAAqC,CAAC,CAAC;AAC1E,AAAI,IAAA,CAAA,YAAW,EAAI,CAAA,OAAM,AAAC,CAAC,4CAA2C,CAAC,CAAC;AACxE,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,4BAAQ,CAAC,CAAC;AAChC,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,gCAA+B,CAAC,CAAC;AAC1D,AAAI,IAAA,CAAA,cAAa,EAAI,CAAA,OAAM,AAAC,CAAC,2CAA0C,CAAC,CAAC;AACzE,AAAI,IAAA,CAAA,0BAAyB,EAAI,CAAA,OAAM,AAAC,CAAC,mDAAkD,CAAC,CAAC;AAC7F,AAAI,IAAA,CAAA,cAAa,EAAI,CAAA,OAAM,AAAC,CAAC,uCAAsC,CAAC,CAAC;AAQrE,SAAS,kBAAgB,CAAC,AAAC,CAAE;AACzB,SAAO,EAAC,IAAG,QAAQ,AAAC,CAAC,YAAW,UAAU,CAAG,EAAE,QAAO,CAAG,CAAA,YAAW,UAAU,CAAE,CAAC,CAAC,CAAC;EACvF;AAAA,AAQA,SAAS,gBAAc,CAAC,AAAC,CAAE;AACvB,AAAI,MAAA,CAAA,MAAK,CAAC;AAEV,MAAI;AACA,WAAK,EAAI,CAAA,aAAY,IAAI,WAAW,AAAC,EAAC,CAAC;IAC3C,CACA,OAAO,CAAA,CAAG;AACN,WAAK,EAAI,KAAG,CAAC;IACjB;AAAA,AACA,SAAO,EACH,UAAS,kBAAkB,AAAC,EAAC,CAC7B,CAAA,IAAG,QAAQ,AAAC,CAAC,kBAAiB,wBAAwB,CAAG,EAAE,QAAO,CAAG,IAAI,CAAA,kBAAiB,wBAAwB,AAAC,CAAC,IAAG,CAAG,MAAI,CAAG,KAAG,CAAC,CAAE,CAAC,CACxI,CAAA,IAAG,QAAQ,AAAC,CAAC,QAAO,SAAS,CAAG,EAAE,QAAO,CAAG,OAAK,CAAE,CAAC,CACpD,CAAA,IAAG,QAAQ,AAAC,CAAC,QAAO,YAAY,CAAG,EAAE,QAAO,CAAG,CAAA,cAAa,aAAa,CAAE,CAAC,CAC5E,CAAA,IAAG,QAAQ,AAAC,CAAC,KAAI,SAAS,CAAG,EAAE,WAAU,CAAG,CAAA,QAAO,YAAY,CAAE,CAAC,CAClE,CAAA,IAAG,QAAQ,AAAC,CAAC,oBAAmB,OAAO,CAAG,EAAE,QAAO,CAAG,IAAE,CAAE,CAAC,CAC3D,CAAA,QAAO,oBAAoB,CAC3B,CAAA,IAAG,QAAQ,AAAC,CAAC,QAAO,iBAAiB,CAAG,EAAE,WAAU,CAAG,CAAA,QAAO,oBAAoB,CAAE,CAAC,CACrF,CAAA,WAAU,YAAY,CACtB,CAAA,IAAG,QAAQ,AAAC,CAAC,cAAa,eAAe,CAAG,EAAE,QAAO,CAAG,CAAA,cAAa,gBAAgB,CAAE,CAAC,CACxF,CAAA,oBAAmB,oBAAoB,CACvC,CAAA,YAAW,WAAW,CACtB,CAAA,OAAM,wBAAwB,CAC9B,CAAA,IAAG,QAAQ,AAAC,CAAC,WAAU,uBAAuB,CAAG,EAAE,QAAO,CAAG,IAAE,CAAE,CAAC,CAClE,CAAA,oBAAmB,iBAAiB,CACpC,CAAA,IAAG,QAAQ,AAAC,CAAC,oBAAmB,kBAAkB,CAAG,EAAE,QAAO,CAAG,CAAA,yBAAwB,sBAAsB,CAAE,CAAC,CAClH,CAAA,IAAG,QAAQ,AAAC,CAAC,eAAc,aAAa,CAAG,EAAE,QAAO,CAAG,CAAA,oBAAmB,iBAAiB,CAAE,CAAC,CAC9F,CAAA,IAAG,QAAQ,AAAC,CAAC,kBAAiB,gBAAgB,CAAG,EAAE,QAAO,CAAG,CAAA,kBAAiB,uBAAuB,CAAE,CAAC,CACxG,CAAA,IAAG,QAAQ,AAAC,CAAC,kBAAiB,gBAAgB,CAAG,EAAE,QAAO,CAAG,CAAA,kBAAiB,uBAAuB,CAAE,CAAC,CACxG,CAAA,OAAM,IAAI,CACV,CAAA,IAAG,QAAQ,AAAC,CAAC,0BAAyB,uBAAuB,CAAG,EAAE,QAAO,CAAG,CAAA,0BAAyB,wBAAwB,CAAE,CAAC,CAChI,CAAA,eAAc,aAAa,CAC3B,CAAA,IAAG,QAAQ,AAAC,CAAC,YAAW,iBAAiB,CAAG,EAAE,QAAO,CAAG,IAAI,CAAA,YAAW,iBAAiB,AAAC,CAAC,aAAY,IAAI,CAAC,CAAE,CAAC,CAC9G,CAAA,IAAG,QAAQ,AAAC,CAAC,mBAAkB,iBAAiB,CAAG,EAAE,QAAO,CAAG,CAAA,wBAAuB,qBAAqB,CAAE,CAAC,CAC9G,CAAA,IAAG,QAAQ,AAAC,CAAC,KAAI,IAAI,CAAG,EAAE,QAAO,CAAG,CAAA,aAAY,IAAI,OAAO,AAAC,EAAC,CAAE,CAAC,CAChE,CAAA,wBAAuB,qBAAqB,CAC5C,CAAA,IAAG,QAAQ,AAAC,CAAC,SAAQ,OAAO,CAAG,EAAE,QAAO,CAAG,CAAA,cAAa,WAAW,CAAE,CAAC,CACtE,CAAA,IAAG,QAAQ,AAAC,CAAC,mBAAkB,iBAAiB,CAAG,EAAE,QAAO,CAAG,CAAA,wBAAuB,qBAAqB,CAAE,CAAC,CAC9G,CAAA,eAAc,aAAa,CAC3B,IAAI,CAAA,IAAG,SAAS,AAAC,CAAC,eAAc,sBAAsB,CAAG;AAAE,aAAO,CAAG,CAAA,eAAc,gBAAgB;AAAG,UAAI,CAAG,KAAG;AAAA,IAAE,CAAC,CACvH,CAAC;EACL;AAAA,AACA,SAAS,mBAAiB,CAAE,SAAQ,CAAG;AACnC,AAAI,MAAA,CAAA,YAAW,EAAI,CAAA,IAAG,SAAS,iBAAiB,AAAC,CAAC,iBAAgB,AAAC,EAAC,CAAC,CAAC;AACtE,SAAO,CAAA,YAAW,sBAAsB,AAAC,CAAC,YAAW,YAAY,OAAO,AAAC,CAAC,eAAc,AAAC,EAAC,CAAG,UAAQ,CAAC,CAAC,CAAC;EAC5G;AAAA,AACA,QAAM,mBAAmB,EAAI,mBAAiB,CAAC;AA8B/C,SAAS,OAAK,CAAE,MAAK,CAAG,CAAA,EAAC,CAAG;AACxB,SAAO,IAAI,wBAAsB,AAAC,CAAC,MAAK,CAAG,GAAC,CAAG,MAAI,CAAC,CAAC;EACzD;AAAA,AACA,QAAM,OAAO,EAAI,OAAK,CAAC;AACvB,SAAS,YAAU,CAAE,MAAK,CAAG,CAAA,EAAC,CAAG;AAC7B,SAAO,IAAI,wBAAsB,AAAC,CAAC,MAAK,CAAG,GAAC,CAAG,KAAG,CAAC,CAAC;EACxD;AAAA,AACA,QAAM,YAAY,EAAI,YAAU,CAAC;AACjC,AAAI,IAAA,CAAA,uBAAsB,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AACvC,WAAS,wBAAsB,CAAE,OAAM,CAAG,CAAA,GAAE,CAAG,CAAA,OAAM,CAAG;AACpD,SAAG,QAAQ,EAAI,QAAM,CAAC;AACtB,SAAG,IAAI,EAAI,IAAE,CAAC;AACd,SAAG,QAAQ,EAAI,QAAM,CAAC;IAC1B;AAAA,AAIA,0BAAsB,UAAU,QAAQ,EAAI,UAAU,QAAO,CAAG;AAC5D,AAAI,QAAA,CAAA,MAAK,EAAI,CAAA,IAAG,QAAQ,IAAI,AAAC,CAAC,SAAU,CAAA,CAAG;AAAE,aAAO,CAAA,QAAO,IAAI,AAAC,CAAC,CAAA,CAAC,CAAC;MAAE,CAAC,CAAC;AACvE,WAAO,CAAA,MAAK,gBAAgB,MAAM,AAAC,CAAC,IAAG,IAAI,CAAG,OAAK,CAAC,CAAC;IACzD,CAAC;AACD,0BAAsB,UAAU,SAAS,EAAI,UAAU,KAAI,CAAG;AAAE,WAAO,CAAA,IAAG,QAAQ,QAAQ,AAAC,CAAC,KAAI,CAAC,CAAA,CAAI,EAAC,CAAA,CAAC;IAAE,CAAC;AAC1G,SAAO,wBAAsB,CAAC;EAClC,CAAC,AAAC,EAAC,CAAC;AACJ,QAAM,wBAAwB,EAAI,wBAAsB,CAAC;AA1JzD,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA0JqB;AC3JxC,KAAK,SAAS,AAAC,CAAC,8BAA6B,CAAG,EAAC,0BAAyB,CAAE,qCAAmC,CAAE,qCAAmC,CAAE,gCAA8B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA9N,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AAGzB,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,AAAC,CAAC,0BAAyB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,oCAAgB,CAAC,CAAC;AAChD,AAAI,IAAA,CAAA,eAAc,EAAI,CAAA,OAAM,AAAC,CAAC,oCAAgB,CAAC,CAAC;AAChD,QAAM,OAAO,EAAI,CAAA,eAAc,OAAO,CAAC;AACvC,QAAM,YAAY,EAAI,CAAA,eAAc,YAAY,CAAC;AACjD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,OAAM,AAAC,CAAC,+BAAW,CAAC,CAAC;AACtC,QAAM,OAAO,EAAI,CAAA,UAAS,OAAO,CAAC;AAClC,AAAI,IAAA,CAAA,OAAM,EAAI,EAAC,MAAO,OAAK,CAAA,GAAM,YAAU,CAAA,CAAI,CAAA,MAAK,OAAO,EAAI,OAAK,CAAC,CAAC;AACtE,QAAM,UAAU,EAAI,CAAA,OAAM,UAAU,CAAC;AACrC,QAAM,SAAS,EAAI,CAAA,OAAM,SAAS,CAAC;AACnC,QAAM,UAAU,EAAI,CAAA,OAAM,UAAU,CAAC;AACrC,QAAM,UAAU,EAAI,CAAA,OAAM,UAAU,CAAC;AACrC,QAAM,UAAU,EAAI,CAAA,OAAM,UAAU,CAAC;AACrC,AAAI,IAAA,CAAA,aAAY,EAAI,CAAA,OAAM,WAAW,CAAC;AACtC,AAAI,IAAA,CAAA,KAAI,EAAI,CAAA,OAAM,GAAG,CAAC;AACtB,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,IAAI,CAAC;AACxB,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,OAAM,IAAI,CAAC;AACxB,AAAI,IAAA,CAAA,aAAY,CAAC;AACjB,AAAI,IAAA,CAAA,QAAO,CAAC;AAEZ,cAAY,AAAC,CAAC,SAAS,AAAC,CAAE;AACtB,gBAAY,EAAI,GAAC,CAAC;AAClB,WAAO,EAAI,KAAG,CAAC;EACnB,CAAC,CAAC;AAcF,SAAS,oBAAkB,CAAE,EAAC,CAAG;AAC7B,gBAAY,AAAC,CAAC,SAAS,AAAC,CAAE;AACtB,AAAI,QAAA,CAAA,SAAQ,EAAI,CAAA,EAAC,AAAC,EAAC,CAAC;AACpB,SAAI,CAAC,SAAQ;AACT,eAAM;AAAA,AACV,kBAAY,EAAI,CAAA,aAAY,OAAO,AAAC,CAAC,SAAQ,CAAC,CAAC;AAC/C,SAAI,QAAO,IAAM,KAAG,CAAG;AACnB,YAAM,IAAI,MAAI,AAAC,CAAC,wDAAuD,EACnE,+DAA6D,CAAA,CAC7D,gBAAc,CAAC,CAAC;MACxB;AAAA,IACJ,CAAC,CAAC;EACN;AAAA,AACA,QAAM,oBAAoB,EAAI,oBAAkB,CAAC;AACjD,SAAS,eAAa,CAAE,KAAI,CAAG;AAC3B,SAAO,CAAA,KAAI,GAAK,EAAC,CAAC,CAAC,KAAI,KAAK,CAAC,CAAC;EAClC;AAAA,AACA,SAAS,IAAE,CAAE,KAAI,CAAG,CAAA,IAAG,CAAG,CAAA,MAAK,CAAG,CAAA,WAAU,CAAG;AAC3C,AAAI,MAAA,CAAA,OAAM,EAAI,YAAU,CAAC;AACzB,OAAI,MAAK,WAAa,CAAA,eAAc,wBAAwB,CAAG;AAG3D,SAAI,MAAK,QAAQ,CAAG;AAChB,YAAI,AAAC,CAAC,IAAG,CAAG,UAAU,IAAG,CAAG;AACxB,aAAI,CAAC,QAAO,CAAG;AACX,mBAAO,EAAI,CAAA,eAAc,mBAAmB,AAAC,CAAC,aAAY,CAAC,CAAC;UAChE;AAAA,AACI,YAAA,CAAA,QAAO,EAAI,CAAA,MAAK,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAC;AACvC,aAAI,cAAa,AAAC,CAAC,QAAO,CAAC,CAAG;AAC1B,mBAAO,KAAK,AAAC,CAAC,IAAG,CAAG,CAAA,IAAG,KAAK,CAAC,CAAC;UAClC,KACK;AACD,eAAG,KAAK,AAAC,CAAC,+DAA8D,EACpE,wBAAsB,CAAA,CAAI,SAAO,CAAC,CAAC;UAC3C;AAAA,QACJ,CAAG,QAAM,CAAC,CAAC;MACf,KACK;AACD,YAAI,AAAC,CAAC,IAAG,CAAG,UAAS,AAAC,CAAE;AACpB,aAAI,CAAC,QAAO,CAAG;AACX,mBAAO,EAAI,CAAA,eAAc,mBAAmB,AAAC,CAAC,aAAY,CAAC,CAAC;UAChE;AAAA,AACI,YAAA,CAAA,QAAO,EAAI,CAAA,MAAK,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAC;AACvC,aAAI,cAAa,AAAC,CAAC,QAAO,CAAC,CAAG;AAC1B,gBAAM,IAAI,MAAI,AAAC,CAAC,6DAA4D,CAAC,CAAC;UAClF;AAAA,AACA,UAAA;QACJ,CAAC,CAAC;MACN;AAAA,IACJ,KACK;AAED,UAAI,AAAC,CAAC,IAAG,CAAG,OAAK,CAAG,QAAM,CAAC,CAAC;IAChC;AAAA,EACJ;AAAA,AACA,SAAS,WAAS,CAAE,EAAC,CAAG;AACpB,OAAI,EAAC,WAAa,CAAA,eAAc,wBAAwB,CAAG;AAGvD,SAAI,EAAC,QAAQ,CAAG;AACZ,oBAAY,AAAC,CAAC,SAAU,IAAG,CAAG;AAC1B,aAAI,CAAC,QAAO,CAAG;AACX,mBAAO,EAAI,CAAA,eAAc,mBAAmB,AAAC,CAAC,aAAY,CAAC,CAAC;UAChE;AAAA,AACI,YAAA,CAAA,QAAO,EAAI,CAAA,EAAC,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAC;AACnC,aAAI,cAAa,AAAC,CAAC,QAAO,CAAC,CAAG;AAC1B,mBAAO,KAAK,AAAC,CAAC,IAAG,CAAG,CAAA,IAAG,KAAK,CAAC,CAAC;UAClC,KACK;AACD,eAAG,KAAK,AAAC,CAAC,+DAA8D,EACpE,wBAAsB,CAAA,CAAI,SAAO,CAAC,CAAC;UAC3C;AAAA,QACJ,CAAC,CAAC;MACN,KACK;AACD,oBAAY,AAAC,CAAC,SAAS,AAAC,CAAE;AACtB,aAAI,CAAC,QAAO,CAAG;AACX,mBAAO,EAAI,CAAA,eAAc,mBAAmB,AAAC,CAAC,aAAY,CAAC,CAAC;UAChE;AAAA,AACI,YAAA,CAAA,QAAO,EAAI,CAAA,EAAC,QAAQ,AAAC,CAAC,QAAO,CAAC,CAAC;AACnC,aAAI,cAAa,AAAC,CAAC,QAAO,CAAC,CAAG;AAC1B,gBAAM,IAAI,MAAI,AAAC,CAAC,6DAA4D,CAAC,CAAC;UAClF;AAAA,AACA,UAAA;QACJ,CAAC,CAAC;MACN;AAAA,IACJ,KACK;AAED,SAAI,EAAC,OAAO,IAAM,EAAA,CAAG;AACjB,oBAAY,AAAC,CAAC,SAAS,AAAC,CAAE;AAAE,WAAC,AAAC,EAAC,CAAC;QAAE,CAAC,CAAC;MACxC,KACK;AACD,oBAAY,AAAC,CAAC,SAAU,IAAG,CAAG;AAAE,WAAC,AAAC,CAAC,IAAG,CAAC,CAAC;QAAE,CAAC,CAAC;MAChD;AAAA,IACJ;AAAA,EACJ;AAAA,AACA,QAAM,WAAW,EAAI,WAAS,CAAC;AAC/B,SAAS,GAAC,CAAE,IAAG,CAAG,CAAA,EAAC,CAAG,CAAA,OAAM,CAAG;AAC3B,OAAI,OAAM,IAAM,KAAK,EAAA,CAAG;AAAE,YAAM,EAAI,KAAG,CAAC;IAAE;AAAA,AAC1C,SAAO,CAAA,GAAE,AAAC,CAAC,KAAI,CAAG,KAAG,CAAG,GAAC,CAAG,QAAM,CAAC,CAAC;EACxC;AAAA,AACA,QAAM,GAAG,EAAI,GAAC,CAAC;AACf,SAAS,IAAE,CAAE,IAAG,CAAG,CAAA,EAAC,CAAG,CAAA,OAAM,CAAG;AAC5B,OAAI,OAAM,IAAM,KAAK,EAAA,CAAG;AAAE,YAAM,EAAI,KAAG,CAAC;IAAE;AAAA,AAC1C,SAAO,CAAA,GAAE,AAAC,CAAC,MAAK,CAAG,KAAG,CAAG,GAAC,CAAG,QAAM,CAAC,CAAC;EACzC;AAAA,AACA,QAAM,IAAI,EAAI,IAAE,CAAC;AACjB,SAAS,IAAE,CAAE,IAAG,CAAG,CAAA,EAAC,CAAG,CAAA,OAAM,CAAG;AAC5B,OAAI,OAAM,IAAM,KAAK,EAAA,CAAG;AAAE,YAAM,EAAI,KAAG,CAAC;IAAE;AAAA,AAC1C,SAAO,CAAA,GAAE,AAAC,CAAC,MAAK,CAAG,KAAG,CAAG,GAAC,CAAG,QAAM,CAAC,CAAC;EACzC;AAAA,AACA,QAAM,IAAI,EAAI,IAAE,CAAC;AACjB,SAAS,IAAE,CAAE,IAAG,CAAG,CAAA,EAAC,CAAG,CAAA,OAAM,CAAG;AAC5B,OAAI,OAAM,IAAM,KAAK,EAAA,CAAG;AAAE,YAAM,EAAI,KAAG,CAAC;IAAE;AAAA,AAC1C,SAAO,CAAA,GAAE,AAAC,CAAC,MAAK,CAAG,KAAG,CAAG,GAAC,CAAG,QAAM,CAAC,CAAC;EACzC;AAAA,AACA,QAAM,IAAI,EAAI,IAAE,CAAC;AA9JjB,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AA8Je;AC/JlC,KAAK,SAAS,AAAC,CAAC,kBAAiB,CAAG,EAAC,8BAA6B,CAAE,8CAA4C,CAAE,qCAAmC,CAAE,kCAAgC,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAAjO,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,SAAS,SAAO,CAAE,CAAA,CAAG;AACjB,QAAS,GAAA,CAAA,CAAA,CAAA,EAAK,EAAA;AAAG,SAAI,CAAC,OAAM,eAAe,AAAC,CAAC,CAAA,CAAC;AAAG,cAAM,CAAE,CAAA,CAAC,EAAI,CAAA,CAAA,CAAE,CAAA,CAAC,CAAC;AAAA,EACtE;AAAA,AASA,SAAO,AAAC,CAAC,OAAM,AAAC,CAAC,8BAAsB,CAAC,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,wBAAuB,EAAI,CAAA,OAAM,AAAC,CAAC,6CAAqC,CAAC,CAAC;AAC9E,QAAM,iBAAiB,EAAI,CAAA,wBAAuB,iBAAiB,CAAC;AACpE,QAAM,kBAAkB,EAAI,CAAA,wBAAuB,kBAAkB,CAAC;AACtE,QAAM,qBAAqB,EAAI,CAAA,wBAAuB,qBAAqB,CAAC;AAC5E,SAAO,AAAC,CAAC,OAAM,AAAC,CAAC,oCAA4B,CAAC,CAAC,CAAC;AAChD,SAAO,AAAC,CAAC,OAAM,AAAC,CAAC,iCAAyB,CAAC,CAAC,CAAC;AAjB7C,OAAK,OAAO,EAAI,SAAO,CAAC;AACxB,OAAO,CAAA,MAAK,QAAQ,CAAC;AAAJ,CAAC,CAAC;AAiBe","file":"dist/js/bundle/testing.js"} \ No newline at end of file diff --git a/2.0.0-alpha.46/web_worker/ui.dev.js b/2.0.0-alpha.46/web_worker/ui.dev.js new file mode 100644 index 0000000000..3936a33f98 --- /dev/null +++ b/2.0.0-alpha.46/web_worker/ui.dev.js @@ -0,0 +1,35828 @@ +/** + @license +Copyright 2014-2015 Google, Inc. http://angularjs.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + */ + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + +// TODO(vicb): remove '!isFirefox' when the bug gets fixed: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1162013 +if (hasNativePromise && !isFirefox) { + // When available use a native Promise to schedule microtasks. + // When not available, es6-promise fallback will be used + var resolvedPromise = Promise.resolve(); + es6Promise._setScheduler(function(fn) { + resolvedPromise.then(fn); + }); +} + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"es6-promise":17}],5:[function(require,module,exports){ +(function (global){ +'use strict'; + +var fnPatch = require('./functions'); +var promisePatch = require('./promise'); +var mutationObserverPatch = require('./mutation-observer'); +var definePropertyPatch = require('./define-property'); +var registerElementPatch = require('./register-element'); +var webSocketPatch = require('./websocket'); +var eventTargetPatch = require('./event-target'); +var propertyDescriptorPatch = require('./property-descriptor'); +var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); + +function apply() { + fnPatch.patchSetClearFunction(global, [ + 'timeout', + 'interval', + 'immediate' + ]); + + fnPatch.patchRequestAnimationFrame(global, [ + 'requestAnimationFrame', + 'mozRequestAnimationFrame', + 'webkitRequestAnimationFrame' + ]); + + fnPatch.patchFunction(global, [ + 'alert', + 'prompt' + ]); + + eventTargetPatch.apply(); + + propertyDescriptorPatch.apply(); + + promisePatch.apply(); + + mutationObserverPatch.patchClass('MutationObserver'); + mutationObserverPatch.patchClass('WebKitMutationObserver'); + + definePropertyPatch.apply(); + + registerElementPatch.apply(); + + geolocationPatch.apply(); + + fileReaderPatch.apply(); +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(require,module,exports){ +'use strict'; + +var keys = require('../keys'); + +// might need similar for object.freeze +// i regret nothing + +var _defineProperty = Object.defineProperty; +var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); + +function apply() { + Object.defineProperty = function (obj, prop, desc) { + if (isUnconfigurable(obj, prop)) { + throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); + } + if (prop !== 'prototype') { + desc = rewriteDescriptor(obj, prop, desc); + } + return _defineProperty(obj, prop, desc); + }; + + Object.defineProperties = function (obj, props) { + Object.keys(props).forEach(function (prop) { + Object.defineProperty(obj, prop, props[prop]); + }); + return obj; + }; + + Object.create = function (obj, proto) { + if (typeof proto === 'object') { + Object.keys(proto).forEach(function (prop) { + proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); + }); + } + return _create(obj, proto); + }; + + Object.getOwnPropertyDescriptor = function (obj, prop) { + var desc = _getOwnPropertyDescriptor(obj, prop); + if (isUnconfigurable(obj, prop)) { + desc.configurable = false; + } + return desc; + }; +}; + +function _redefineProperty(obj, prop, desc) { + desc = rewriteDescriptor(obj, prop, desc); + return _defineProperty(obj, prop, desc); +}; + +function isUnconfigurable (obj, prop) { + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; +} + +function rewriteDescriptor (obj, prop, desc) { + desc.configurable = true; + if (!desc.configurable) { + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); + } + obj[unconfigurablesKey][prop] = true; + } + return desc; +} + +module.exports = { + apply: apply, + _redefineProperty: _redefineProperty +}; + + + +},{"../keys":3}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + // patched properties depend on addEventListener, so this needs to come first + if (global.EventTarget) { + utils.patchEventTargetMethods(global.EventTarget.prototype); + + // Note: EventTarget is not available in all browsers, + // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget + } else { + var apis = [ + 'ApplicationCache', + 'EventSource', + 'FileReader', + 'InputMethodContext', + 'MediaController', + 'MessagePort', + 'Node', + 'Performance', + 'SVGElementInstance', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebKitNamedFlow', + 'Worker', + 'WorkerGlobalScope', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload' + ]; + + apis.forEach(function(api) { + var proto = global[api] && global[api].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (proto && proto.addEventListener) { + utils.patchEventTargetMethods(proto); + } + }); + + // Patch the methods on `window` instead of `Window.prototype` + // `Window` is not accessible on Android 4.3 + if (typeof(window) !== 'undefined') { + utils.patchEventTargetMethods(window); + } + } +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":16}],9:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function patchSetClearFunction(obj, fnNames) { + fnNames.map(function (name) { + return name[0].toUpperCase() + name.substr(1); + }).forEach(function (name) { + var setName = 'set' + name; + var delegate = obj[setName]; + + if (delegate) { + var clearName = 'clear' + name; + var ids = {}; + + var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce; + + global.zone[setName] = function (fn) { + var id, fnRef = fn; + arguments[0] = function () { + delete ids[id]; + return fnRef.apply(this, arguments); + }; + var args = bindArgs(arguments); + id = delegate.apply(obj, args); + ids[id] = true; + return id; + }; + + obj[setName] = function () { + return global.zone[setName].apply(this, arguments); + }; + + var clearDelegate = obj[clearName]; + + global.zone[clearName] = function (id) { + if (ids[id]) { + delete ids[id]; + global.zone.dequeueTask(); + } + return clearDelegate.apply(this, arguments); + }; + + obj[clearName] = function () { + return global.zone[clearName].apply(this, arguments); + }; + } + }); +}; + + +/** + * requestAnimationFrame is typically recursively called from within the callback function + * that it executes. To handle this case, only fork a zone if this is executed + * within the root zone. + */ +function patchRequestAnimationFrame(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + global.zone[name] = function (fn) { + var callZone = global.zone.isRootZone() ? global.zone.fork() : global.zone; + if (fn) { + arguments[0] = function () { + return callZone.run(fn, this, arguments); + }; + } + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchSetFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + + if (delegate) { + global.zone[name] = function (fn) { + arguments[0] = function () { + return fn.apply(this, arguments); + }; + var args = utils.bindArgumentsOnce(arguments); + return delegate.apply(obj, args); + }; + + obj[name] = function () { + return zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + global.zone[name] = function () { + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + }); +}; + + +module.exports = { + patchSetClearFunction: patchSetClearFunction, + patchSetFunction: patchSetFunction, + patchRequestAnimationFrame: patchRequestAnimationFrame, + patchFunction: patchFunction +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + if (global.navigator && global.navigator.geolocation) { + utils.patchPrototype(global.navigator.geolocation, [ + 'getCurrentPosition', + 'watchPosition' + ]); + } +} + +module.exports = { + apply: apply +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],11:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function (fn) { + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); + // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks + this[creationZoneKey] = global.zone; + }; + + var instance = new OriginalClass(function () {}); + + global[className].prototype.disconnect = function () { + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; + } + return result; + }; + + global[className].prototype.observe = function () { + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; + } + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); + }; + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof global[className].prototype !== undefined) { + return; + } + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } +}; + +module.exports = { + patchClass: patchClass +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3}],12:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +/* + * Patches a function that returns a Promise-like instance. + * + * This function must be used when either: + * - Native Promises are not available, + * - The function returns a Promise-like object. + * + * This is required because zones rely on a Promise monkey patch that could not be applied when + * Promise is not natively available or when the returned object is not an instance of Promise. + * + * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work + * with minimal overhead. + * + * ``` + * var boundFunction = bindPromiseFn(FunctionReturningAPromise); + * + * boundFunction.then(successHandler, errorHandler); + * ``` + */ +var bindPromiseFn; + +if (global.Promise) { + bindPromiseFn = function (delegate) { + return function() { + var delegatePromise = delegate.apply(this, arguments); + + // if the delegate returned an instance of Promise, forward it. + if (delegatePromise instanceof Promise) { + return delegatePromise; + } + + // Otherwise wrap the Promise-like in a global Promise + return new Promise(function(resolve, reject) { + delegatePromise.then(resolve, reject); + }); + }; + }; +} else { + bindPromiseFn = function (delegate) { + return function () { + return _patchThenable(delegate.apply(this, arguments)); + }; + }; +} + + +function _patchPromiseFnsOnObject(objectPath, fnNames) { + var obj = global; + + var exists = objectPath.every(function (segment) { + obj = obj[segment]; + return obj; + }); + + if (!exists) { + return; + } + + fnNames.forEach(function (name) { + var fn = obj[name]; + if (fn) { + obj[name] = bindPromiseFn(fn); + } + }); +} + +function _patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = utils.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + var ocatch = thenable.catch; + thenable.catch = function () { + var args = utils.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + return thenable; +} + + +function apply() { + // Patch .then() and .catch() on native Promises to execute callbacks in the zone where + // those functions are called. + if (global.Promise) { + utils.patchPrototype(Promise.prototype, [ + 'then', + 'catch' + ]); + + // Patch browser APIs that return a Promise + var patchFns = [ + // fetch + [[], ['fetch']], + [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']] + ]; + + patchFns.forEach(function(objPathAndFns) { + _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]); + }); + } +} + +module.exports = { + apply: apply, + bindPromiseFn: bindPromiseFn +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],13:[function(require,module,exports){ +(function (global){ +'use strict'; + +var webSocketPatch = require('./websocket'); +var utils = require('../utils'); +var keys = require('../keys'); + +var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); + +function apply() { + if (utils.isWebWorker()){ + // on WebWorker so don't apply patch + return; + } + + var supportsWebSocket = typeof WebSocket !== 'undefined'; + if (canPatchViaPropertyDescriptor()) { + // for browsers that we can patch the descriptor: Chrome & Firefox + var onEventNames = eventNames.map(function (property) { + return 'on' + property; + }); + utils.patchProperties(HTMLElement.prototype, onEventNames); + utils.patchProperties(XMLHttpRequest.prototype); + if (supportsWebSocket) { + utils.patchProperties(WebSocket.prototype); + } + } else { + // Safari, Android browsers (Jelly Bean) + patchViaCapturingAllTheEvents(); + utils.patchClass('XMLHttpRequest'); + if (supportsWebSocket) { + webSocketPatch.apply(); + } + } +} + +function canPatchViaPropertyDescriptor() { + if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { + // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 + // IDL interface attributes are not configurable + var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); + if (desc && !desc.configurable) return false; + } + + Object.defineProperty(HTMLElement.prototype, 'onclick', { + get: function () { + return true; + } + }); + var elt = document.createElement('div'); + var result = !!elt.onclick; + Object.defineProperty(HTMLElement.prototype, 'onclick', {}); + return result; +}; + +var unboundKey = keys.create('unbound'); + +// Whenever any event fires, we check the event target and all parents +// for `onwhatever` properties and replace them with zone-bound functions +// - Chrome (for now) +function patchViaCapturingAllTheEvents() { + eventNames.forEach(function (property) { + var onproperty = 'on' + property; + document.addEventListener(property, function (event) { + var elt = event.target, bound; + while (elt) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { + bound = global.zone.bind(elt[onproperty]); + bound[unboundKey] = elt[onproperty]; + elt[onproperty] = bound; + } + elt = elt.parentElement; + } + }, true); + }); +}; + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(require,module,exports){ +(function (global){ +'use strict'; + +var _redefineProperty = require('./define-property')._redefineProperty; +var utils = require("../utils"); + +function apply() { + if (utils.isWebWorker() || !('registerElement' in global.document)) { + return; + } + + var _registerElement = document.registerElement; + var callbacks = [ + 'createdCallback', + 'attachedCallback', + 'detachedCallback', + 'attributeChangedCallback' + ]; + + document.registerElement = function (name, opts) { + if (opts && opts.prototype) { + callbacks.forEach(function (callback) { + if (opts.prototype.hasOwnProperty(callback)) { + var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = global.zone.bind(descriptor.value); + _redefineProperty(opts.prototype, callback, descriptor); + } else { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + } else if (opts.prototype[callback]) { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + }); + } + + return _registerElement.apply(document, [name, opts]); + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16,"./define-property":6}],15:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +// we have to patch the instance since the proto is non-configurable +function apply() { + var WS = global.WebSocket; + utils.patchEventTargetMethods(WS.prototype); + global.WebSocket = function(a, b) { + var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); + var proxySocket; + + // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance + var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); + if (onmessageDesc && onmessageDesc.configurable === false) { + proxySocket = Object.create(socket); + ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) { + proxySocket[propName] = function() { + return socket[propName].apply(socket, arguments); + }; + }); + } else { + // we can patch the real socket + proxySocket = socket; + } + + utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']); + + return proxySocket; + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],16:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('./keys'); + +function bindArguments(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bind(args[i]); + } + } + return args; +}; + +function bindArgumentsOnce(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bindOnce(args[i]); + } + } + return args; +}; + +function patchPrototype(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + obj[name] = function () { + return delegate.apply(this, bindArguments(arguments)); + }; + } + }); +}; + +function isWebWorker() { + return (typeof document === "undefined"); +} + +function patchProperty(obj, prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop) || { + enumerable: true, + configurable: true + }; + + // A property descriptor cannot have getter/setter and be writable + // deleting the writable and value properties avoids this error: + // + // TypeError: property descriptors must not specify a value or be writable when a + // getter or setter has been specified + delete desc.writable; + delete desc.value; + + // substr(2) cuz 'onclick' -> 'click', etc + var eventName = prop.substr(2); + var _prop = '_' + prop; + + desc.set = function (fn) { + if (this[_prop]) { + this.removeEventListener(eventName, this[_prop]); + } + + if (typeof fn === 'function') { + this[_prop] = fn; + this.addEventListener(eventName, fn, false); + } else { + this[_prop] = null; + } + }; + + desc.get = function () { + return this[_prop]; + }; + + Object.defineProperty(obj, prop, desc); +}; + +function patchProperties(obj, properties) { + (properties || (function () { + var props = []; + for (var prop in obj) { + props.push(prop); + } + return props; + }()). + filter(function (propertyName) { + return propertyName.substr(0,2) === 'on'; + })). + forEach(function (eventName) { + patchProperty(obj, eventName); + }); +}; + +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + +function patchEventTargetMethods(obj) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + var fn; + //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 + if (handler.toString() !== "[object FunctionWrapper]") { + if (handler.handleEvent) { + // Have to pass in 'handler' reference as an argument here, otherwise it gets clobbered in + // IE9 by the arguments[1] assignment at end of this function. + fn = (function(handler) { + return function() { + handler.handleEvent.apply(handler, arguments); + }; + })(handler); + } else { + fn = handler; + } + + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` (= `self`) + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + return global.zone.addEventListener.apply(target, arguments); + }; + + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + var result = global.zone.removeEventListener.apply(target, arguments); + global.zone.dequeueTask(handler[originalFnKey]); + return result; + }; +}; + +var originalInstanceKey = keys.create('originalInstance'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function () { + var a = bindArguments(arguments); + switch (a.length) { + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; + default: throw new Error('what are you even doing?'); + } + }; + + var instance = new OriginalClass(); + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } + + for (prop in OriginalClass) { + if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { + global[className][prop] = OriginalClass[prop]; + } + } +}; + +module.exports = { + bindArguments: bindArguments, + bindArgumentsOnce: bindArgumentsOnce, + patchPrototype: patchPrototype, + patchProperty: patchProperty, + patchProperties: patchProperties, + patchEventTargetMethods: patchEventTargetMethods, + patchClass: patchClass, + isWebWorker: isWebWorker +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./keys":3}],17:[function(require,module,exports){ +(function (process,global){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 3.0.2 + */ + +(function() { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x === 'function' || (typeof x === 'object' && x !== null); + } + + function lib$es6$promise$utils$$isFunction(x) { + return typeof x === 'function'; + } + + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } + + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + lib$es6$promise$utils$$_isArray = Array.isArray; + } + + var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len = 0; + var lib$es6$promise$asap$$toString = {}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + + var lib$es6$promise$asap$$asap = function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg; + lib$es6$promise$asap$$len += 2; + if (lib$es6$promise$asap$$len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + } + + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn = scheduleFn; + } + + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap = asapFn; + } + + var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + // test for web worker but not in IE10 + var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && + typeof importScripts !== 'undefined' && + typeof MessageChannel !== 'undefined'; + + // node + function lib$es6$promise$asap$$useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function() { + process.nextTick(lib$es6$promise$asap$$flush); + }; + } + + // vertx + function lib$es6$promise$asap$$useVertxTimer() { + return function() { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + + function lib$es6$promise$asap$$useMutationObserver() { + var iterations = 0; + var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function() { + node.data = (iterations = ++iterations % 2); + }; + } + + // web worker + function lib$es6$promise$asap$$useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + + function lib$es6$promise$asap$$useSetTimeout() { + return function() { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + + var lib$es6$promise$asap$$queue = new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) { + var callback = lib$es6$promise$asap$$queue[i]; + var arg = lib$es6$promise$asap$$queue[i+1]; + + callback(arg); + + lib$es6$promise$asap$$queue[i] = undefined; + lib$es6$promise$asap$$queue[i+1] = undefined; + } + + lib$es6$promise$asap$$len = 0; + } + + function lib$es6$promise$asap$$attemptVertx() { + try { + var r = require; + var vertx = r('vertx'); + lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } catch(e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + + var lib$es6$promise$asap$$scheduleFlush; + // Decide what async method to use to triggering processing of queued callbacks: + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick(); + } else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver(); + } else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); + } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); + } else { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); + } + + function lib$es6$promise$$internal$$noop() {} + + var lib$es6$promise$$internal$$PENDING = void 0; + var lib$es6$promise$$internal$$FULFILLED = 1; + var lib$es6$promise$$internal$$REJECTED = 2; + + var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } catch(error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error = error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } + } + + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function(promise) { + var sealed = false; + var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + lib$es6$promise$$internal$$resolve(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function(reason) { + if (sealed) { return; } + sealed = true; + + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor === promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } else { + var then = lib$es6$promise$$internal$$getThen(maybeThenable); + + if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } else if (then === undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); + } else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + lib$es6$promise$$internal$$publish(promise); + } + + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + + promise._result = value; + promise._state = lib$es6$promise$$internal$$FULFILLED; + + if (promise._subscribers.length !== 0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + promise._state = lib$es6$promise$$internal$$REJECTED; + promise._result = reason; + + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onerror = null; + + subscribers[length] = child; + subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment; + subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection; + + if (length === 0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + + function lib$es6$promise$$internal$$publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { return; } + + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; + } + + function lib$es6$promise$$internal$$ErrorObject() { + this.error = null; + } + + var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback = lib$es6$promise$utils$$isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = lib$es6$promise$$internal$$tryCatch(callback, detail); + + if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } + + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + + } else { + value = detail; + succeeded = true; + } + + if (promise._state !== lib$es6$promise$$internal$$PENDING) { + // noop + } else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } else if (settled === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value){ + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } catch(e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator = this; + + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; + + enumerator._init(); + + if (enumerator.length === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } else { + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) { + return lib$es6$promise$utils$$isArray(input); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._init = function() { + this._result = new Array(this.length); + }; + + var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator; + + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() { + var enumerator = this; + + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { + var enumerator = this; + var c = enumerator._instanceConstructor; + + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) { + entry._onerror = null; + enumerator._settledAt(entry._state, i, entry._result); + } else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } else { + enumerator._remaining--; + enumerator._result[i] = entry; + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { + var enumerator = this; + var promise = enumerator.promise; + + if (promise._state === lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + + if (state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } else { + enumerator._result[i] = value; + } + } + + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; + + lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; + } + var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject; + + var lib$es6$promise$promise$$counter = 0; + + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + var lib$es6$promise$promise$$default = lib$es6$promise$promise$$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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {function} resolver + Useful for tooling. + @constructor + */ + function lib$es6$promise$promise$$Promise(resolver) { + this._id = lib$es6$promise$promise$$counter++; + this._state = undefined; + this._result = undefined; + this._subscribers = []; + + if (lib$es6$promise$$internal$$noop !== resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + + lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap; + + lib$es6$promise$promise$$Promise.prototype = { + constructor: lib$es6$promise$promise$$Promise, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + then: function(onFulfillment, onRejection) { + var parent = this; + var state = parent._state; + + if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + + var child = new this.constructor(lib$es6$promise$$internal$$noop); + var result = parent._result; + + if (state) { + var callback = arguments[state - 1]; + lib$es6$promise$asap$$asap(function(){ + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + + return child; + }, + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + 'catch': function(onRejection) { + return this.then(null, onRejection); + } + }; + function lib$es6$promise$polyfill$$polyfill() { + var local; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) { + return; + } + + local.Promise = lib$es6$promise$promise$$default; + } + var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill; + + var lib$es6$promise$umd$$ES6Promise = { + 'Promise': lib$es6$promise$promise$$default, + 'polyfill': lib$es6$promise$polyfill$$default + }; + + /* global define:true module:true window: true */ + if (typeof define === 'function' && define['amd']) { + define(function() { return lib$es6$promise$umd$$ES6Promise; }); + } else if (typeof module !== 'undefined' && module['exports']) { + module['exports'] = lib$es6$promise$umd$$ES6Promise; + } else if (typeof this !== 'undefined') { + this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise; + } + + lib$es6$promise$polyfill$$default(); +}).call(this); + + +}).call(this,{},typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + if (IsUndefined(metadataMap)) { + return false; + } + if (!metadataMap.delete(metadataKey)) { + return false; + } + if (metadataMap.size > 0) { + return true; + } + var targetMetadata = __Metadata__.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) { + return true; + } + __Metadata__.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) { + throw new TypeError(); + } + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) { + throw new TypeError(); + } + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = __Metadata__.get(target); + if (!targetMetadata) { + if (!create) { + return undefined; + } + targetMetadata = new _Map(); + __Metadata__.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) { + return undefined; + } + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return true; + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryHasMetadata(MetadataKey, parent, P); + } + return false; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return false; + } + return Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryGetMetadata(MetadataKey, parent, P); + } + return undefined; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return undefined; + } + return metadataMap.get(MetadataKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) { + return ownKeys; + } + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) { + return ownKeys; + } + if (ownKeys.length <= 0) { + return parentKeys; + } + var set = new _Set(); + var keys = []; + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) { + metadataMap.forEach(function (_, key) { return keys.push(key); }); + } + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray(x); + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + if (IsSymbol(value)) { + return value; + } + return String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) { + return proto; + } + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) { + return proto; + } + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) { + return proto; + } + // if the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") { + return proto; + } + // if we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) { + return proto; + } + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + function Map() { + this._keys = []; + this._values = []; + this._cache = cacheSentinel; + } + Map.prototype = { + get size() { + return this._keys.length; + }, + has: function (key) { + if (key === this._cache) { + return true; + } + if (this._find(key) >= 0) { + this._cache = key; + return true; + } + return false; + }, + get: function (key) { + var index = this._find(key); + if (index >= 0) { + this._cache = key; + return this._values[index]; + } + return undefined; + }, + set: function (key, value) { + this.delete(key); + this._keys.push(key); + this._values.push(value); + this._cache = key; + return this; + }, + delete: function (key) { + var index = this._find(key); + if (index >= 0) { + this._keys.splice(index, 1); + this._values.splice(index, 1); + this._cache = cacheSentinel; + return true; + } + return false; + }, + clear: function () { + this._keys.length = 0; + this._values.length = 0; + this._cache = cacheSentinel; + }, + forEach: function (callback, thisArg) { + var size = this.size; + for (var i = 0; i < size; ++i) { + var key = this._keys[i]; + var value = this._values[i]; + this._cache = key; + callback.call(this, value, key, this); + } + }, + _find: function (key) { + var keys = this._keys; + var size = keys.length; + for (var i = 0; i < size; ++i) { + if (keys[i] === key) { + return i; + } + } + return -1; + } + }; + return Map; + } + // naive Set shim + function CreateSetPolyfill() { + var cacheSentinel = {}; + function Set() { + this._map = new _Map(); + } + Set.prototype = { + get size() { + return this._map.length; + }, + has: function (value) { + return this._map.has(value); + }, + add: function (value) { + this._map.set(value, value); + return this; + }, + delete: function (value) { + return this._map.delete(value); + }, + clear: function () { + this._map.clear(); + }, + forEach: function (callback, thisArg) { + this._map.forEach(callback, thisArg); + } + }; + return Set; + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; + var nodeCrypto = isNode && require("crypto"); + var hasOwn = Object.prototype.hasOwnProperty; + var keys = {}; + var rootKey = CreateUniqueKey(); + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype = { + has: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return this._key in table; + } + return false; + }, + get: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return table[this._key]; + } + return undefined; + }, + set: function (target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }, + delete: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table && this._key in table) { + return delete table[this._key]; + } + return false; + }, + clear: function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + } + }; + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) { + buffer[i] = Math.random() * 255 | 0; + } + } + function GenRandomBytes(size) { + if (nodeCrypto) { + var data = nodeCrypto.randomBytes(size); + return data; + } + else if (typeof Uint8Array === "function") { + var data = new Uint8Array(size); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(data); + } + else if (typeof msCrypto !== "undefined") { + msCrypto.getRandomValues(data); + } + else { + FillRandomBytes(data, size); + } + return data; + } + else { + var data = new Array(size); + FillRandomBytes(data, size); + return data; + } + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) { + result += "-"; + } + if (byte < 16) { + result += "0"; + } + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do { + key = "@@WeakMap@@" + CreateUUID(); + } while (hasOwn.call(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) { + return undefined; + } + Object.defineProperty(target, rootKey, { value: Object.create(null) }); + } + return target[rootKey]; + } + return WeakMap; + } + // hook global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + __global.Reflect[p] = Reflect[p]; + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURLDisabled=Reflect.js.map +"format register"; +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/key_events", ["angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var di_1 = require("angular2/src/core/di"); + var modifierKeys = ['alt', 'control', 'meta', 'shift']; + var modifierKeyGetters = { + 'alt': function(event) { + return event.altKey; + }, + 'control': function(event) { + return event.ctrlKey; + }, + 'meta': function(event) { + return event.metaKey; + }, + 'shift': function(event) { + return event.shiftKey; + } + }; + var KeyEventsPlugin = (function(_super) { + __extends(KeyEventsPlugin, _super); + function KeyEventsPlugin() { + _super.call(this); + } + KeyEventsPlugin.prototype.supports = function(eventName) { + return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); + }; + KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var parsedEvent = KeyEventsPlugin.parseEventName(eventName); + var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); + }); + }; + KeyEventsPlugin.parseEventName = function(eventName) { + var parts = eventName.toLowerCase().split('.'); + var domEventName = parts.shift(); + if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { + return null; + } + var key = KeyEventsPlugin._normalizeKey(parts.pop()); + var fullKey = ''; + modifierKeys.forEach(function(modifierName) { + if (collection_1.ListWrapper.contains(parts, modifierName)) { + collection_1.ListWrapper.remove(parts, modifierName); + fullKey += modifierName + '.'; + } + }); + fullKey += key; + if (parts.length != 0 || key.length === 0) { + return null; + } + var result = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); + collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); + return result; + }; + KeyEventsPlugin.getEventFullKey = function(event) { + var fullKey = ''; + var key = dom_adapter_1.DOM.getEventKey(event); + key = key.toLowerCase(); + if (lang_1.StringWrapper.equals(key, ' ')) { + key = 'space'; + } else if (lang_1.StringWrapper.equals(key, '.')) { + key = 'dot'; + } + modifierKeys.forEach(function(modifierName) { + if (modifierName != key) { + var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); + if (modifierGetter(event)) { + fullKey += modifierName + '.'; + } + } + }); + fullKey += key; + return fullKey; + }; + KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { + return function(event) { + if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { + zone.run(function() { + return handler(event); + }); + } + }; + }; + KeyEventsPlugin._normalizeKey = function(keyName) { + switch (keyName) { + case 'esc': + return 'escape'; + default: + return keyName; + } + }; + KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); + return KeyEventsPlugin; + })(event_manager_1.EventManagerPlugin); + exports.KeyEventsPlugin = KeyEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_common", ["angular2/src/core/render/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var collection_1 = require("angular2/src/facade/collection"); + var _eventNames = { + 'pan': true, + 'panstart': true, + 'panmove': true, + 'panend': true, + 'pancancel': true, + 'panleft': true, + 'panright': true, + 'panup': true, + 'pandown': true, + 'pinch': true, + 'pinchstart': true, + 'pinchmove': true, + 'pinchend': true, + 'pinchcancel': true, + 'pinchin': true, + 'pinchout': true, + 'press': true, + 'pressup': true, + 'rotate': true, + 'rotatestart': true, + 'rotatemove': true, + 'rotateend': true, + 'rotatecancel': true, + 'swipe': true, + 'swipeleft': true, + 'swiperight': true, + 'swipeup': true, + 'swipedown': true, + 'tap': true + }; + var HammerGesturesPluginCommon = (function(_super) { + __extends(HammerGesturesPluginCommon, _super); + function HammerGesturesPluginCommon() { + _super.call(this); + } + HammerGesturesPluginCommon.prototype.supports = function(eventName) { + eventName = eventName.toLowerCase(); + return collection_1.StringMapWrapper.contains(_eventNames, eventName); + }; + return HammerGesturesPluginCommon; + })(event_manager_1.EventManagerPlugin); + exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/api", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.ON_WEB_WORKER = lang_1.CONST_EXPR(new di_1.OpaqueToken('WebWorker.onWebWorker')); + var WebWorkerElementRef = (function() { + function WebWorkerElementRef(renderView, boundElementIndex) { + this.renderView = renderView; + this.boundElementIndex = boundElementIndex; + } + return WebWorkerElementRef; + })(); + exports.WebWorkerElementRef = WebWorkerElementRef; + var WebWorkerTemplateCmd = (function() { + function WebWorkerTemplateCmd() {} + WebWorkerTemplateCmd.prototype.visit = function(visitor, context) { + return null; + }; + return WebWorkerTemplateCmd; + })(); + exports.WebWorkerTemplateCmd = WebWorkerTemplateCmd; + var WebWorkerTextCmd = (function() { + function WebWorkerTextCmd(isBound, ngContentIndex, value) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.value = value; + } + WebWorkerTextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return WebWorkerTextCmd; + })(); + exports.WebWorkerTextCmd = WebWorkerTextCmd; + var WebWorkerNgContentCmd = (function() { + function WebWorkerNgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + } + WebWorkerNgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return WebWorkerNgContentCmd; + })(); + exports.WebWorkerNgContentCmd = WebWorkerNgContentCmd; + var WebWorkerBeginElementCmd = (function() { + function WebWorkerBeginElementCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + } + WebWorkerBeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + return WebWorkerBeginElementCmd; + })(); + exports.WebWorkerBeginElementCmd = WebWorkerBeginElementCmd; + var WebWorkerEndElementCmd = (function() { + function WebWorkerEndElementCmd() {} + WebWorkerEndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + return WebWorkerEndElementCmd; + })(); + exports.WebWorkerEndElementCmd = WebWorkerEndElementCmd; + var WebWorkerBeginComponentCmd = (function() { + function WebWorkerBeginComponentCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, templateId) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.templateId = templateId; + } + WebWorkerBeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + return WebWorkerBeginComponentCmd; + })(); + exports.WebWorkerBeginComponentCmd = WebWorkerBeginComponentCmd; + var WebWorkerEndComponentCmd = (function() { + function WebWorkerEndComponentCmd() {} + WebWorkerEndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + return WebWorkerEndComponentCmd; + })(); + exports.WebWorkerEndComponentCmd = WebWorkerEndComponentCmd; + var WebWorkerEmbeddedTemplateCmd = (function() { + function WebWorkerEmbeddedTemplateCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, isMerged, children) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.isMerged = isMerged; + this.children = children; + } + WebWorkerEmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return WebWorkerEmbeddedTemplateCmd; + })(); + exports.WebWorkerEmbeddedTemplateCmd = WebWorkerEmbeddedTemplateCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_proto_view_ref_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var RenderProtoViewRefStore = (function() { + function RenderProtoViewRefStore(onWebworker) { + this._lookupByIndex = new Map(); + this._lookupByProtoView = new Map(); + this._nextIndex = 0; + this._onWebworker = onWebworker; + } + RenderProtoViewRefStore.prototype.allocate = function() { + var index = this._nextIndex++; + var result = new WebWorkerRenderProtoViewRef(index); + this.store(result, index); + return result; + }; + RenderProtoViewRefStore.prototype.store = function(ref, index) { + this._lookupByProtoView.set(ref, index); + this._lookupByIndex.set(index, ref); + }; + RenderProtoViewRefStore.prototype.deserialize = function(index) { + if (index == null) { + return null; + } + return this._lookupByIndex.get(index); + }; + RenderProtoViewRefStore.prototype.serialize = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebworker) { + return ref.refNumber; + } else { + return this._lookupByProtoView.get(ref); + } + }; + RenderProtoViewRefStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderProtoViewRefStore); + return RenderProtoViewRefStore; + })(); + exports.RenderProtoViewRefStore = RenderProtoViewRefStore; + var WebWorkerRenderProtoViewRef = (function(_super) { + __extends(WebWorkerRenderProtoViewRef, _super); + function WebWorkerRenderProtoViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + return WebWorkerRenderProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.WebWorkerRenderProtoViewRef = WebWorkerRenderProtoViewRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_view_with_fragments_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var collection_1 = require("angular2/src/facade/collection"); + var RenderViewWithFragmentsStore = (function() { + function RenderViewWithFragmentsStore(onWebWorker) { + this._nextIndex = 0; + this._onWebWorker = onWebWorker; + this._lookupByIndex = new Map(); + this._lookupByView = new Map(); + this._viewFragments = new Map(); + } + RenderViewWithFragmentsStore.prototype.allocate = function(fragmentCount) { + var initialIndex = this._nextIndex; + var viewRef = new WebWorkerRenderViewRef(this._nextIndex++); + var fragmentRefs = collection_1.ListWrapper.createGrowableSize(fragmentCount); + for (var i = 0; i < fragmentCount; i++) { + fragmentRefs[i] = new WebWorkerRenderFragmentRef(this._nextIndex++); + } + var renderViewWithFragments = new api_1.RenderViewWithFragments(viewRef, fragmentRefs); + this.store(renderViewWithFragments, initialIndex); + return renderViewWithFragments; + }; + RenderViewWithFragmentsStore.prototype.store = function(view, startIndex) { + var _this = this; + this._lookupByIndex.set(startIndex, view.viewRef); + this._lookupByView.set(view.viewRef, startIndex); + startIndex++; + view.fragmentRefs.forEach(function(ref) { + _this._lookupByIndex.set(startIndex, ref); + _this._lookupByView.set(ref, startIndex); + startIndex++; + }); + this._viewFragments.set(view.viewRef, view.fragmentRefs); + }; + RenderViewWithFragmentsStore.prototype.remove = function(view) { + var _this = this; + this._removeRef(view); + var fragments = this._viewFragments.get(view); + fragments.forEach(function(fragment) { + _this._removeRef(fragment); + }); + this._viewFragments.delete(view); + }; + RenderViewWithFragmentsStore.prototype._removeRef = function(ref) { + var index = this._lookupByView.get(ref); + this._lookupByView.delete(ref); + this._lookupByIndex.delete(index); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderViewRef = function(viewRef) { + return this._serializeRenderFragmentOrViewRef(viewRef); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderFragmentRef = function(fragmentRef) { + return this._serializeRenderFragmentOrViewRef(fragmentRef); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderViewRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderFragmentRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype._retrieve = function(ref) { + if (ref == null) { + return null; + } + if (!this._lookupByIndex.has(ref)) { + return null; + } + return this._lookupByIndex.get(ref); + }; + RenderViewWithFragmentsStore.prototype._serializeRenderFragmentOrViewRef = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebWorker) { + return ref.serialize(); + } else { + return this._lookupByView.get(ref); + } + }; + RenderViewWithFragmentsStore.prototype.serializeViewWithFragments = function(view) { + var _this = this; + if (view == null) { + return null; + } + if (this._onWebWorker) { + return { + 'viewRef': view.viewRef.serialize(), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return val.serialize(); + }) + }; + } else { + return { + 'viewRef': this._lookupByView.get(view.viewRef), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return _this._lookupByView.get(val); + }) + }; + } + }; + RenderViewWithFragmentsStore.prototype.deserializeViewWithFragments = function(obj) { + var _this = this; + if (obj == null) { + return null; + } + var viewRef = this.deserializeRenderViewRef(obj['viewRef']); + var fragments = obj['fragmentRefs'].map(function(val) { + return _this.deserializeRenderFragmentRef(val); + }); + return new api_1.RenderViewWithFragments(viewRef, fragments); + }; + RenderViewWithFragmentsStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderViewWithFragmentsStore); + return RenderViewWithFragmentsStore; + })(); + exports.RenderViewWithFragmentsStore = RenderViewWithFragmentsStore; + var WebWorkerRenderViewRef = (function(_super) { + __extends(WebWorkerRenderViewRef, _super); + function WebWorkerRenderViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderViewRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderViewRef.deserialize = function(ref) { + return new WebWorkerRenderViewRef(ref); + }; + return WebWorkerRenderViewRef; + })(api_1.RenderViewRef); + exports.WebWorkerRenderViewRef = WebWorkerRenderViewRef; + var WebWorkerRenderFragmentRef = (function(_super) { + __extends(WebWorkerRenderFragmentRef, _super); + function WebWorkerRenderFragmentRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderFragmentRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderFragmentRef.deserialize = function(ref) { + return new WebWorkerRenderFragmentRef(ref); + }; + return WebWorkerRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.WebWorkerRenderFragmentRef = WebWorkerRenderFragmentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/message_bus", ["angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_1 = require("angular2/src/facade/async"); + exports.EventEmitter = async_1.EventEmitter; + exports.Observable = async_1.Observable; + var MessageBus = (function() { + function MessageBus() {} + return MessageBus; + })(); + exports.MessageBus = MessageBus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/messaging_api", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.SETUP_CHANNEL = "ng-WebWorkerSetup"; + exports.RENDERER_CHANNEL = "ng-Renderer"; + exports.XHR_CHANNEL = "ng-XHR"; + exports.EVENT_CHANNEL = "ng-events"; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/bind", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function bind(fn, scope) { + return fn.bind(scope); + } + exports.bind = bind; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/event_serializer", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var MOUSE_EVENT_PROPERTIES = ["altKey", "button", "clientX", "clientY", "metaKey", "movementX", "movementY", "offsetX", "offsetY", "region", "screenX", "screenY", "shiftKey"]; + var KEYBOARD_EVENT_PROPERTIES = ['altkey', 'charCode', 'code', 'ctrlKey', 'isComposing', 'key', 'keyCode', 'location', 'metaKey', 'repeat', 'shiftKey', 'which']; + var EVENT_PROPERTIES = ['type', 'bubbles', 'cancelable']; + var NODES_WITH_VALUE = new collection_1.Set(["input", "select", "option", "button", "li", "meter", "progress", "param"]); + function serializeGenericEvent(e) { + return serializeEvent(e, EVENT_PROPERTIES); + } + exports.serializeGenericEvent = serializeGenericEvent; + function serializeEventWithTarget(e) { + var serializedEvent = serializeEvent(e, EVENT_PROPERTIES); + return addTarget(e, serializedEvent); + } + exports.serializeEventWithTarget = serializeEventWithTarget; + function serializeMouseEvent(e) { + return serializeEvent(e, MOUSE_EVENT_PROPERTIES); + } + exports.serializeMouseEvent = serializeMouseEvent; + function serializeKeyboardEvent(e) { + var serializedEvent = serializeEvent(e, KEYBOARD_EVENT_PROPERTIES); + return addTarget(e, serializedEvent); + } + exports.serializeKeyboardEvent = serializeKeyboardEvent; + function addTarget(e, serializedEvent) { + if (NODES_WITH_VALUE.has(e.target.tagName.toLowerCase())) { + var target = e.target; + serializedEvent['target'] = {'value': target.value}; + if (lang_1.isPresent(target.files)) { + serializedEvent['target']['files'] = target.files; + } + } + return serializedEvent; + } + function serializeEvent(e, properties) { + var serialized = {}; + for (var i = 0; i < properties.length; i++) { + var prop = properties[i]; + serialized[prop] = e[prop]; + } + return serialized; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/service_message_broker", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/web_workers/shared/serializer", "angular2/src/facade/lang", "angular2/src/web_workers/shared/message_bus", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var lang_1 = require("angular2/src/facade/lang"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var async_1 = require("angular2/src/facade/async"); + var ServiceMessageBrokerFactory = (function() { + function ServiceMessageBrokerFactory() {} + return ServiceMessageBrokerFactory; + })(); + exports.ServiceMessageBrokerFactory = ServiceMessageBrokerFactory; + var ServiceMessageBrokerFactory_ = (function(_super) { + __extends(ServiceMessageBrokerFactory_, _super); + function ServiceMessageBrokerFactory_(_messageBus, _serializer) { + _super.call(this); + this._messageBus = _messageBus; + this._serializer = _serializer; + } + ServiceMessageBrokerFactory_.prototype.createMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this._messageBus.initChannel(channel, runInZone); + return new ServiceMessageBroker_(this._messageBus, this._serializer, channel); + }; + ServiceMessageBrokerFactory_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, serializer_1.Serializer])], ServiceMessageBrokerFactory_); + return ServiceMessageBrokerFactory_; + })(ServiceMessageBrokerFactory); + exports.ServiceMessageBrokerFactory_ = ServiceMessageBrokerFactory_; + var ServiceMessageBroker = (function() { + function ServiceMessageBroker() {} + return ServiceMessageBroker; + })(); + exports.ServiceMessageBroker = ServiceMessageBroker; + var ServiceMessageBroker_ = (function(_super) { + __extends(ServiceMessageBroker_, _super); + function ServiceMessageBroker_(messageBus, _serializer, channel) { + var _this = this; + _super.call(this); + this._serializer = _serializer; + this.channel = channel; + this._methods = new collection_1.Map(); + this._sink = messageBus.to(channel); + var source = messageBus.from(channel); + async_1.ObservableWrapper.subscribe(source, function(message) { + return _this._handleMessage(message); + }); + } + ServiceMessageBroker_.prototype.registerMethod = function(methodName, signature, method, returnType) { + var _this = this; + this._methods.set(methodName, function(message) { + var serializedArgs = message.args; + var deserializedArgs = collection_1.ListWrapper.createFixedSize(signature.length); + for (var i = 0; i < signature.length; i++) { + var serializedArg = serializedArgs[i]; + deserializedArgs[i] = _this._serializer.deserialize(serializedArg, signature[i]); + } + var promise = lang_1.FunctionWrapper.apply(method, deserializedArgs); + if (lang_1.isPresent(returnType) && lang_1.isPresent(promise)) { + _this._wrapWebWorkerPromise(message.id, promise, returnType); + } + }); + }; + ServiceMessageBroker_.prototype._handleMessage = function(map) { + var message = new ReceivedMessage(map); + if (this._methods.has(message.method)) { + this._methods.get(message.method)(message); + } + }; + ServiceMessageBroker_.prototype._wrapWebWorkerPromise = function(id, promise, type) { + var _this = this; + async_1.PromiseWrapper.then(promise, function(result) { + async_1.ObservableWrapper.callNext(_this._sink, { + 'type': 'result', + 'value': _this._serializer.serialize(result, type), + 'id': id + }); + }); + }; + return ServiceMessageBroker_; + })(ServiceMessageBroker); + exports.ServiceMessageBroker_ = ServiceMessageBroker_; + var ReceivedMessage = (function() { + function ReceivedMessage(data) { + this.method = data['method']; + this.args = data['args']; + this.id = data['id']; + this.type = data['type']; + } + return ReceivedMessage; + })(); + exports.ReceivedMessage = ReceivedMessage; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/xhr_impl", ["angular2/src/core/di", "angular2/src/web_workers/shared/serializer", "angular2/src/web_workers/shared/messaging_api", "angular2/src/compiler/xhr", "angular2/src/web_workers/shared/service_message_broker", "angular2/src/web_workers/ui/bind"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + var bind_1 = require("angular2/src/web_workers/ui/bind"); + var MessageBasedXHRImpl = (function() { + function MessageBasedXHRImpl(_brokerFactory, _xhr) { + this._brokerFactory = _brokerFactory; + this._xhr = _xhr; + } + MessageBasedXHRImpl.prototype.start = function() { + var broker = this._brokerFactory.createMessageBroker(messaging_api_1.XHR_CHANNEL); + broker.registerMethod("get", [serializer_1.PRIMITIVE], bind_1.bind(this._xhr.get, this._xhr), serializer_1.PRIMITIVE); + }; + MessageBasedXHRImpl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [service_message_broker_1.ServiceMessageBrokerFactory, xhr_1.XHR])], MessageBasedXHRImpl); + return MessageBasedXHRImpl; + })(); + exports.MessageBasedXHRImpl = MessageBasedXHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/setup", ["angular2/src/web_workers/shared/messaging_api", "angular2/src/facade/async", "angular2/src/web_workers/shared/message_bus", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var async_1 = require("angular2/src/facade/async"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var WebWorkerSetup = (function() { + function WebWorkerSetup(_bus, anchorBasedAppRootUrl) { + this._bus = _bus; + this.rootUrl = anchorBasedAppRootUrl.value; + } + WebWorkerSetup.prototype.start = function() { + var _this = this; + this._bus.initChannel(messaging_api_1.SETUP_CHANNEL, false); + var sink = this._bus.to(messaging_api_1.SETUP_CHANNEL); + var source = this._bus.from(messaging_api_1.SETUP_CHANNEL); + async_1.ObservableWrapper.subscribe(source, function(message) { + if (lang_1.StringWrapper.equals(message, "ready")) { + async_1.ObservableWrapper.callNext(sink, {"rootUrl": _this.rootUrl}); + } + }); + }; + WebWorkerSetup = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, anchor_based_app_root_url_1.AnchorBasedAppRootUrl])], WebWorkerSetup); + return WebWorkerSetup; + })(); + exports.WebWorkerSetup = WebWorkerSetup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/client_message_broker", ["angular2/src/web_workers/shared/message_bus", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/web_workers/shared/serializer", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var di_1 = require("angular2/src/core/di"); + var lang_2 = require("angular2/src/facade/lang"); + var lang_3 = require("angular2/src/facade/lang"); + exports.Type = lang_3.Type; + var ClientMessageBrokerFactory = (function() { + function ClientMessageBrokerFactory() {} + return ClientMessageBrokerFactory; + })(); + exports.ClientMessageBrokerFactory = ClientMessageBrokerFactory; + var ClientMessageBrokerFactory_ = (function(_super) { + __extends(ClientMessageBrokerFactory_, _super); + function ClientMessageBrokerFactory_(_messageBus, _serializer) { + _super.call(this); + this._messageBus = _messageBus; + this._serializer = _serializer; + } + ClientMessageBrokerFactory_.prototype.createMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this._messageBus.initChannel(channel, runInZone); + return new ClientMessageBroker_(this._messageBus, this._serializer, channel); + }; + ClientMessageBrokerFactory_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, serializer_1.Serializer])], ClientMessageBrokerFactory_); + return ClientMessageBrokerFactory_; + })(ClientMessageBrokerFactory); + exports.ClientMessageBrokerFactory_ = ClientMessageBrokerFactory_; + var ClientMessageBroker = (function() { + function ClientMessageBroker() {} + return ClientMessageBroker; + })(); + exports.ClientMessageBroker = ClientMessageBroker; + var ClientMessageBroker_ = (function(_super) { + __extends(ClientMessageBroker_, _super); + function ClientMessageBroker_(messageBus, _serializer, channel) { + var _this = this; + _super.call(this); + this.channel = channel; + this._pending = new Map(); + this._sink = messageBus.to(channel); + this._serializer = _serializer; + var source = messageBus.from(channel); + async_1.ObservableWrapper.subscribe(source, function(message) { + return _this._handleMessage(message); + }); + } + ClientMessageBroker_.prototype._generateMessageId = function(name) { + var time = lang_1.stringify(lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now())); + var iteration = 0; + var id = name + time + lang_1.stringify(iteration); + while (lang_1.isPresent(this._pending[id])) { + id = "" + name + time + iteration; + iteration++; + } + return id; + }; + ClientMessageBroker_.prototype.runOnService = function(args, returnType) { + var _this = this; + var fnArgs = []; + if (lang_1.isPresent(args.args)) { + args.args.forEach(function(argument) { + if (argument.type != null) { + fnArgs.push(_this._serializer.serialize(argument.value, argument.type)); + } else { + fnArgs.push(argument.value); + } + }); + } + var promise; + var id = null; + if (returnType != null) { + var completer = async_1.PromiseWrapper.completer(); + id = this._generateMessageId(args.method); + this._pending.set(id, completer); + async_1.PromiseWrapper.catchError(completer.promise, function(err, stack) { + lang_1.print(err); + completer.reject(err, stack); + }); + promise = async_1.PromiseWrapper.then(completer.promise, function(value) { + if (_this._serializer == null) { + return value; + } else { + return _this._serializer.deserialize(value, returnType); + } + }); + } else { + promise = null; + } + var message = { + 'method': args.method, + 'args': fnArgs + }; + if (id != null) { + message['id'] = id; + } + async_1.ObservableWrapper.callNext(this._sink, message); + return promise; + }; + ClientMessageBroker_.prototype._handleMessage = function(message) { + var data = new MessageData(message); + if (lang_2.StringWrapper.equals(data.type, "result") || lang_2.StringWrapper.equals(data.type, "error")) { + var id = data.id; + if (this._pending.has(id)) { + if (lang_2.StringWrapper.equals(data.type, "result")) { + this._pending.get(id).resolve(data.value); + } else { + this._pending.get(id).reject(data.value, null); + } + this._pending.delete(id); + } + } + }; + return ClientMessageBroker_; + })(ClientMessageBroker); + exports.ClientMessageBroker_ = ClientMessageBroker_; + var MessageData = (function() { + function MessageData(data) { + this.type = collection_1.StringMapWrapper.get(data, "type"); + this.id = this._getValueIfPresent(data, "id"); + this.value = this._getValueIfPresent(data, "value"); + } + MessageData.prototype._getValueIfPresent = function(data, key) { + if (collection_1.StringMapWrapper.contains(data, key)) { + return collection_1.StringMapWrapper.get(data, key); + } else { + return null; + } + }; + return MessageData; + })(); + var FnArg = (function() { + function FnArg(value, type) { + this.value = value; + this.type = type; + } + return FnArg; + })(); + exports.FnArg = FnArg; + var UiArguments = (function() { + function UiArguments(method, args) { + this.method = method; + this.args = args; + } + return UiArguments; + })(); + exports.UiArguments = UiArguments; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function wtfInit() {} + exports.wtfInit = wtfInit; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +/** + @license + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Netflix, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var promise_1 = require("angular2/src/facade/promise"); + var lang_1 = require("angular2/src/facade/lang"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var XHRImpl = (function(_super) { + __extends(XHRImpl, _super); + function XHRImpl() { + _super.apply(this, arguments); + } + XHRImpl.prototype.get = function(url) { + var completer = promise_1.PromiseWrapper.completer(); + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'text'; + xhr.onload = function() { + var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status === 0) { + status = response ? 200 : 0; + } + if (200 <= status && status <= 300) { + completer.resolve(response); + } else { + completer.reject("Failed to load " + url, null); + } + }; + xhr.onerror = function() { + completer.reject("Failed to load " + url, null); + }; + xhr.send(); + return completer.promise; + }; + return XHRImpl; + })(xhr_1.XHR); + exports.XHRImpl = XHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/hammer_gestures", ["angular2/src/core/render/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var hammer_common_1 = require("angular2/src/core/render/dom/events/hammer_common"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var di_1 = require("angular2/src/core/di"); + var HammerGesturesPlugin = (function(_super) { + __extends(HammerGesturesPlugin, _super); + function HammerGesturesPlugin() { + _super.apply(this, arguments); + } + HammerGesturesPlugin.prototype.supports = function(eventName) { + if (!_super.prototype.supports.call(this, eventName)) + return false; + if (!lang_1.isPresent(window['Hammer'])) { + throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); + } + return true; + }; + HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + eventName = eventName.toLowerCase(); + zone.runOutsideAngular(function() { + var mc = new Hammer(element); + mc.get('pinch').set({enable: true}); + mc.get('rotate').set({enable: true}); + mc.on(eventName, function(eventObj) { + zone.run(function() { + handler(eventObj); + }); + }); + }); + }; + HammerGesturesPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HammerGesturesPlugin); + return HammerGesturesPlugin; + })(hammer_common_1.HammerGesturesPluginCommon); + exports.HammerGesturesPlugin = HammerGesturesPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/serializer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/core/di", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/core/metadata/view"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var di_1 = require("angular2/src/core/di"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var view_1 = require("angular2/src/core/metadata/view"); + exports.PRIMITIVE = String; + var Serializer = (function() { + function Serializer(_protoViewStore, _renderViewStore) { + this._protoViewStore = _protoViewStore; + this._renderViewStore = _renderViewStore; + } + Serializer.prototype.serialize = function(obj, type) { + var _this = this; + if (!lang_1.isPresent(obj)) { + return null; + } + if (lang_1.isArray(obj)) { + return obj.map(function(v) { + return _this.serialize(v, type); + }); + } + if (type == exports.PRIMITIVE) { + return obj; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.serialize(obj); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.serializeRenderViewRef(obj); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.serializeRenderFragmentRef(obj); + } else if (type == api_2.WebWorkerElementRef) { + return this._serializeWorkerElementRef(obj); + } else if (type == api_2.WebWorkerTemplateCmd) { + return serializeTemplateCmd(obj); + } else if (type === api_1.RenderComponentTemplate) { + return this._serializeRenderTemplate(obj); + } else if (type === view_1.ViewEncapsulation) { + return lang_1.serializeEnum(obj); + } else { + throw new exceptions_1.BaseException("No serializer for " + type.toString()); + } + }; + Serializer.prototype.deserialize = function(map, type, data) { + var _this = this; + if (!lang_1.isPresent(map)) { + return null; + } + if (lang_1.isArray(map)) { + var obj = []; + map.forEach(function(val) { + return obj.push(_this.deserialize(val, type, data)); + }); + return obj; + } + if (type == exports.PRIMITIVE) { + return map; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.deserialize(map); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.deserializeRenderViewRef(map); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.deserializeRenderFragmentRef(map); + } else if (type == api_2.WebWorkerElementRef) { + return this._deserializeWorkerElementRef(map); + } else if (type == api_2.WebWorkerTemplateCmd) { + return deserializeTemplateCmd(map); + } else if (type === api_1.RenderComponentTemplate) { + return this._deserializeRenderTemplate(map); + } else if (type === view_1.ViewEncapsulation) { + return view_1.VIEW_ENCAPSULATION_VALUES[map]; + } else { + throw new exceptions_1.BaseException("No deserializer for " + type.toString()); + } + }; + Serializer.prototype.mapToObject = function(map, type) { + var _this = this; + var object = {}; + var serialize = lang_1.isPresent(type); + map.forEach(function(value, key) { + if (serialize) { + object[key] = _this.serialize(value, type); + } else { + object[key] = value; + } + }); + return object; + }; + Serializer.prototype.objectToMap = function(obj, type, data) { + var _this = this; + if (lang_1.isPresent(type)) { + var map = new collection_1.Map(); + collection_1.StringMapWrapper.forEach(obj, function(val, key) { + map.set(key, _this.deserialize(val, type, data)); + }); + return map; + } else { + return collection_1.MapWrapper.createFromStringMap(obj); + } + }; + Serializer.prototype.allocateRenderViews = function(fragmentCount) { + this._renderViewStore.allocate(fragmentCount); + }; + Serializer.prototype._serializeWorkerElementRef = function(elementRef) { + return { + 'renderView': this.serialize(elementRef.renderView, api_1.RenderViewRef), + 'boundElementIndex': elementRef.boundElementIndex + }; + }; + Serializer.prototype._deserializeWorkerElementRef = function(map) { + return new api_2.WebWorkerElementRef(this.deserialize(map['renderView'], api_1.RenderViewRef), map['boundElementIndex']); + }; + Serializer.prototype._serializeRenderTemplate = function(obj) { + return { + 'id': obj.id, + 'shortId': obj.shortId, + 'encapsulation': this.serialize(obj.encapsulation, view_1.ViewEncapsulation), + 'commands': this.serialize(obj.commands, api_2.WebWorkerTemplateCmd), + 'styles': this.serialize(obj.styles, exports.PRIMITIVE) + }; + }; + Serializer.prototype._deserializeRenderTemplate = function(map) { + return new api_1.RenderComponentTemplate(map['id'], map['shortId'], this.deserialize(map['encapsulation'], view_1.ViewEncapsulation), this.deserialize(map['commands'], api_2.WebWorkerTemplateCmd), this.deserialize(map['styles'], exports.PRIMITIVE)); + }; + Serializer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [render_proto_view_ref_store_1.RenderProtoViewRefStore, render_view_with_fragments_store_1.RenderViewWithFragmentsStore])], Serializer); + return Serializer; + })(); + exports.Serializer = Serializer; + function serializeTemplateCmd(cmd) { + return cmd.visit(RENDER_TEMPLATE_CMD_SERIALIZER, null); + } + function deserializeTemplateCmd(data) { + return RENDER_TEMPLATE_CMD_DESERIALIZERS[data['deserializerIndex']](data); + } + var RenderTemplateCmdSerializer = (function() { + function RenderTemplateCmdSerializer() {} + RenderTemplateCmdSerializer.prototype.visitText = function(cmd, context) { + return { + 'deserializerIndex': 0, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'value': cmd.value + }; + }; + RenderTemplateCmdSerializer.prototype.visitNgContent = function(cmd, context) { + return { + 'deserializerIndex': 1, + 'index': cmd.index, + 'ngContentIndex': cmd.ngContentIndex + }; + }; + RenderTemplateCmdSerializer.prototype.visitBeginElement = function(cmd, context) { + return { + 'deserializerIndex': 2, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndElement = function(context) { + return {'deserializerIndex': 3}; + }; + RenderTemplateCmdSerializer.prototype.visitBeginComponent = function(cmd, context) { + return { + 'deserializerIndex': 4, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'templateId': cmd.templateId + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndComponent = function(context) { + return {'deserializerIndex': 5}; + }; + RenderTemplateCmdSerializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var _this = this; + var children = cmd.children.map(function(child) { + return child.visit(_this, null); + }); + return { + 'deserializerIndex': 6, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'isMerged': cmd.isMerged, + 'children': children + }; + }; + return RenderTemplateCmdSerializer; + })(); + var RENDER_TEMPLATE_CMD_SERIALIZER = new RenderTemplateCmdSerializer(); + var RENDER_TEMPLATE_CMD_DESERIALIZERS = [function(data) { + return new api_2.WebWorkerTextCmd(data['isBound'], data['ngContentIndex'], data['value']); + }, function(data) { + return new api_2.WebWorkerNgContentCmd(data['index'], data['ngContentIndex']); + }, function(data) { + return new api_2.WebWorkerBeginElementCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames']); + }, function(data) { + return new api_2.WebWorkerEndElementCmd(); + }, function(data) { + return new api_2.WebWorkerBeginComponentCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['templateId']); + }, function(data) { + return new api_2.WebWorkerEndComponentCmd(); + }, function(data) { + return new api_2.WebWorkerEmbeddedTemplateCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['isMerged'], data['children'].map(function(childData) { + return deserializeTemplateCmd(childData); + })); + }]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/event_dispatcher", ["angular2/src/core/render/api", "angular2/src/web_workers/ui/event_serializer", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var api_1 = require("angular2/src/core/render/api"); + var event_serializer_1 = require("angular2/src/web_workers/ui/event_serializer"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var EventDispatcher = (function() { + function EventDispatcher(_viewRef, _sink, _serializer) { + this._viewRef = _viewRef; + this._sink = _sink; + this._serializer = _serializer; + } + EventDispatcher.prototype.dispatchRenderEvent = function(elementIndex, eventName, locals) { + var e = locals.get('$event'); + var serializedEvent; + switch (e.type) { + case "click": + case "mouseup": + case "mousedown": + case "dblclick": + case "contextmenu": + case "mouseenter": + case "mouseleave": + case "mousemove": + case "mouseout": + case "mouseover": + case "show": + serializedEvent = event_serializer_1.serializeMouseEvent(e); + break; + case "keydown": + case "keypress": + case "keyup": + serializedEvent = event_serializer_1.serializeKeyboardEvent(e); + break; + case "input": + case "change": + case "blur": + serializedEvent = event_serializer_1.serializeEventWithTarget(e); + break; + case "abort": + case "afterprint": + case "beforeprint": + case "cached": + case "canplay": + case "canplaythrough": + case "chargingchange": + case "chargingtimechange": + case "close": + case "dischargingtimechange": + case "DOMContentLoaded": + case "downloading": + case "durationchange": + case "emptied": + case "ended": + case "error": + case "fullscreenchange": + case "fullscreenerror": + case "invalid": + case "languagechange": + case "levelfchange": + case "loadeddata": + case "loadedmetadata": + case "obsolete": + case "offline": + case "online": + case "open": + case "orientatoinchange": + case "pause": + case "pointerlockchange": + case "pointerlockerror": + case "play": + case "playing": + case "ratechange": + case "readystatechange": + case "reset": + case "scroll": + case "seeked": + case "seeking": + case "stalled": + case "submit": + case "success": + case "suspend": + case "timeupdate": + case "updateready": + case "visibilitychange": + case "volumechange": + case "waiting": + serializedEvent = event_serializer_1.serializeGenericEvent(e); + break; + default: + throw new exceptions_1.BaseException(eventName + " not supported on WebWorkers"); + } + var serializedLocals = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(serializedLocals, '$event', serializedEvent); + async_1.ObservableWrapper.callNext(this._sink, { + "viewRef": this._serializer.serialize(this._viewRef, api_1.RenderViewRef), + "elementIndex": elementIndex, + "eventName": eventName, + "locals": serializedLocals + }); + return false; + }; + return EventDispatcher; + })(); + exports.EventDispatcher = EventDispatcher; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/xhr_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var GenericBrowserDomAdapter = (function(_super) { + __extends(GenericBrowserDomAdapter, _super); + function GenericBrowserDomAdapter() { + var _this = this; + _super.call(this); + this._animationPrefix = null; + this._transitionEnd = null; + try { + var element = this.createElement('div', this.defaultDoc()); + if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { + this._animationPrefix = ''; + } else { + var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; + for (var i = 0; i < domPrefixes.length; i++) { + if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { + this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; + break; + } + } + } + var transEndEventNames = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { + if (lang_1.isPresent(_this.getStyle(element, key))) { + _this._transitionEnd = value; + } + }); + } catch (e) { + this._animationPrefix = null; + this._transitionEnd = null; + } + } + GenericBrowserDomAdapter.prototype.getXHR = function() { + return xhr_impl_1.XHRImpl; + }; + GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { + return el.getDistributedNodes(); + }; + GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + el.href = href == null ? baseUrl : baseUrl + '/../' + href; + }; + GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { + return true; + }; + GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { + return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); + }; + GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { + return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; + }; + GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { + return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; + }; + GenericBrowserDomAdapter.prototype.supportsAnimation = function() { + return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); + }; + return GenericBrowserDomAdapter; + })(dom_adapter_1.DomAdapter); + exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/renderer", ["angular2/src/core/di", "angular2/src/web_workers/shared/message_bus", "angular2/src/web_workers/shared/serializer", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/web_workers/shared/messaging_api", "angular2/src/web_workers/ui/bind", "angular2/src/web_workers/ui/event_dispatcher", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/web_workers/shared/service_message_broker"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var bind_1 = require("angular2/src/web_workers/ui/bind"); + var event_dispatcher_1 = require("angular2/src/web_workers/ui/event_dispatcher"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + var MessageBasedRenderer = (function() { + function MessageBasedRenderer(_brokerFactory, _bus, _serializer, _renderProtoViewRefStore, _renderViewWithFragmentsStore, _renderer) { + this._brokerFactory = _brokerFactory; + this._bus = _bus; + this._serializer = _serializer; + this._renderProtoViewRefStore = _renderProtoViewRefStore; + this._renderViewWithFragmentsStore = _renderViewWithFragmentsStore; + this._renderer = _renderer; + } + MessageBasedRenderer.prototype.start = function() { + var broker = this._brokerFactory.createMessageBroker(messaging_api_1.RENDERER_CHANNEL); + this._bus.initChannel(messaging_api_1.EVENT_CHANNEL); + broker.registerMethod("registerComponentTemplate", [api_1.RenderComponentTemplate], bind_1.bind(this._renderer.registerComponentTemplate, this._renderer)); + broker.registerMethod("createProtoView", [serializer_1.PRIMITIVE, api_2.WebWorkerTemplateCmd, serializer_1.PRIMITIVE], bind_1.bind(this._createProtoView, this)); + broker.registerMethod("createRootHostView", [api_1.RenderProtoViewRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._createRootHostView, this)); + broker.registerMethod("createView", [api_1.RenderProtoViewRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._createView, this)); + broker.registerMethod("destroyView", [api_1.RenderViewRef], bind_1.bind(this._destroyView, this)); + broker.registerMethod("attachFragmentAfterFragment", [api_1.RenderFragmentRef, api_1.RenderFragmentRef], bind_1.bind(this._renderer.attachFragmentAfterFragment, this._renderer)); + broker.registerMethod("attachFragmentAfterElement", [api_2.WebWorkerElementRef, api_1.RenderFragmentRef], bind_1.bind(this._renderer.attachFragmentAfterElement, this._renderer)); + broker.registerMethod("detachFragment", [api_1.RenderFragmentRef], bind_1.bind(this._renderer.detachFragment, this._renderer)); + broker.registerMethod("hydrateView", [api_1.RenderViewRef], bind_1.bind(this._renderer.hydrateView, this._renderer)); + broker.registerMethod("dehydrateView", [api_1.RenderViewRef], bind_1.bind(this._renderer.dehydrateView, this._renderer)); + broker.registerMethod("setText", [api_1.RenderViewRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.setText, this._renderer)); + broker.registerMethod("setElementProperty", [api_2.WebWorkerElementRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.setElementProperty, this._renderer)); + broker.registerMethod("setElementAttribute", [api_2.WebWorkerElementRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.setElementAttribute, this._renderer)); + broker.registerMethod("setElementClass", [api_2.WebWorkerElementRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.setElementClass, this._renderer)); + broker.registerMethod("setElementStyle", [api_2.WebWorkerElementRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.setElementStyle, this._renderer)); + broker.registerMethod("invokeElementMethod", [api_2.WebWorkerElementRef, serializer_1.PRIMITIVE, serializer_1.PRIMITIVE], bind_1.bind(this._renderer.invokeElementMethod, this._renderer)); + broker.registerMethod("setEventDispatcher", [api_1.RenderViewRef], bind_1.bind(this._setEventDispatcher, this)); + }; + MessageBasedRenderer.prototype._destroyView = function(viewRef) { + this._renderer.destroyView(viewRef); + this._renderViewWithFragmentsStore.remove(viewRef); + }; + MessageBasedRenderer.prototype._createProtoView = function(componentTemplateId, cmds, refIndex) { + var protoViewRef = this._renderer.createProtoView(componentTemplateId, cmds); + this._renderProtoViewRefStore.store(protoViewRef, refIndex); + }; + MessageBasedRenderer.prototype._createRootHostView = function(ref, fragmentCount, selector, startIndex) { + var renderViewWithFragments = this._renderer.createRootHostView(ref, fragmentCount, selector); + this._renderViewWithFragmentsStore.store(renderViewWithFragments, startIndex); + }; + MessageBasedRenderer.prototype._createView = function(ref, fragmentCount, startIndex) { + var renderViewWithFragments = this._renderer.createView(ref, fragmentCount); + this._renderViewWithFragmentsStore.store(renderViewWithFragments, startIndex); + }; + MessageBasedRenderer.prototype._setEventDispatcher = function(viewRef) { + var dispatcher = new event_dispatcher_1.EventDispatcher(viewRef, this._bus.to(messaging_api_1.EVENT_CHANNEL), this._serializer); + this._renderer.setEventDispatcher(viewRef, dispatcher); + }; + MessageBasedRenderer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [service_message_broker_1.ServiceMessageBrokerFactory, message_bus_1.MessageBus, serializer_1.Serializer, render_proto_view_ref_store_1.RenderProtoViewRefStore, render_view_with_fragments_store_1.RenderViewWithFragmentsStore, api_1.Renderer])], MessageBasedRenderer); + return MessageBasedRenderer; + })(); + exports.MessageBasedRenderer = MessageBasedRenderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/core/dom/generic_browser_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var generic_browser_adapter_1 = require("angular2/src/core/dom/generic_browser_adapter"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var DOM_KEY_LOCATION_NUMPAD = 3; + var _keyMap = { + '\b': 'Backspace', + '\t': 'Tab', + '\x7F': 'Delete', + '\x1B': 'Escape', + 'Del': 'Delete', + 'Esc': 'Escape', + 'Left': 'ArrowLeft', + 'Right': 'ArrowRight', + 'Up': 'ArrowUp', + 'Down': 'ArrowDown', + 'Menu': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'Win': 'OS' + }; + var _chromeNumKeyPadMap = { + 'A': '1', + 'B': '2', + 'C': '3', + 'D': '4', + 'E': '5', + 'F': '6', + 'G': '7', + 'H': '8', + 'I': '9', + 'J': '*', + 'K': '+', + 'M': '-', + 'N': '.', + 'O': '/', + '\x60': '0', + '\x90': 'NumLock' + }; + var BrowserDomAdapter = (function(_super) { + __extends(BrowserDomAdapter, _super); + function BrowserDomAdapter() { + _super.apply(this, arguments); + } + BrowserDomAdapter.prototype.parse = function(templateHtml) { + throw new Error("parse not implemented"); + }; + BrowserDomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); + }; + BrowserDomAdapter.prototype.hasProperty = function(element, name) { + return name in element; + }; + BrowserDomAdapter.prototype.setProperty = function(el, name, value) { + el[name] = value; + }; + BrowserDomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { + el[methodName].apply(el, args); + }; + BrowserDomAdapter.prototype.logError = function(error) { + if (window.console.error) { + window.console.error(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.log = function(error) { + window.console.log(error); + }; + BrowserDomAdapter.prototype.logGroup = function(error) { + if (window.console.group) { + window.console.group(error); + this.logError(error); + } else { + window.console.log(error); + } + }; + BrowserDomAdapter.prototype.logGroupEnd = function() { + if (window.console.groupEnd) { + window.console.groupEnd(); + } + }; + Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + BrowserDomAdapter.prototype.query = function(selector) { + return document.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelector = function(el, selector) { + return el.querySelector(selector); + }; + BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { + return el.querySelectorAll(selector); + }; + BrowserDomAdapter.prototype.on = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + }; + BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { + el.addEventListener(evt, listener, false); + return function() { + el.removeEventListener(evt, listener, false); + }; + }; + BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { + el.dispatchEvent(evt); + }; + BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { + var evt = document.createEvent('MouseEvent'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.createEvent = function(eventType) { + var evt = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; + }; + BrowserDomAdapter.prototype.preventDefault = function(evt) { + evt.preventDefault(); + evt.returnValue = false; + }; + BrowserDomAdapter.prototype.isPrevented = function(evt) { + return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + BrowserDomAdapter.prototype.getInnerHTML = function(el) { + return el.innerHTML; + }; + BrowserDomAdapter.prototype.getOuterHTML = function(el) { + return el.outerHTML; + }; + BrowserDomAdapter.prototype.nodeName = function(node) { + return node.nodeName; + }; + BrowserDomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + BrowserDomAdapter.prototype.type = function(node) { + return node.type; + }; + BrowserDomAdapter.prototype.content = function(node) { + if (this.hasProperty(node, "content")) { + return node.content; + } else { + return node; + } + }; + BrowserDomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + BrowserDomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + BrowserDomAdapter.prototype.parentElement = function(el) { + return el.parentNode; + }; + BrowserDomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + BrowserDomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + BrowserDomAdapter.prototype.clearNodes = function(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }; + BrowserDomAdapter.prototype.appendChild = function(el, node) { + el.appendChild(node); + }; + BrowserDomAdapter.prototype.removeChild = function(el, node) { + el.removeChild(node); + }; + BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { + el.replaceChild(newChild, oldChild); + }; + BrowserDomAdapter.prototype.remove = function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + return node; + }; + BrowserDomAdapter.prototype.insertBefore = function(el, node) { + el.parentNode.insertBefore(node, el); + }; + BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { + nodes.forEach(function(n) { + return el.parentNode.insertBefore(n, el); + }); + }; + BrowserDomAdapter.prototype.insertAfter = function(el, node) { + el.parentNode.insertBefore(node, el.nextSibling); + }; + BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { + el.innerHTML = value; + }; + BrowserDomAdapter.prototype.getText = function(el) { + return el.textContent; + }; + BrowserDomAdapter.prototype.setText = function(el, value) { + el.textContent = value; + }; + BrowserDomAdapter.prototype.getValue = function(el) { + return el.value; + }; + BrowserDomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + BrowserDomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + BrowserDomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + BrowserDomAdapter.prototype.createComment = function(text) { + return document.createComment(text); + }; + BrowserDomAdapter.prototype.createTemplate = function(html) { + var t = document.createElement('template'); + t.innerHTML = html; + return t; + }; + BrowserDomAdapter.prototype.createElement = function(tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElement(tagName); + }; + BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createElementNS(ns, tagName); + }; + BrowserDomAdapter.prototype.createTextNode = function(text, doc) { + if (doc === void 0) { + doc = document; + } + return doc.createTextNode(text); + }; + BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { + if (doc === void 0) { + doc = document; + } + var el = doc.createElement('SCRIPT'); + el.setAttribute(attrName, attrValue); + return el; + }; + BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { + if (doc === void 0) { + doc = document; + } + var style = doc.createElement('style'); + this.appendChild(style, this.createTextNode(css)); + return style; + }; + BrowserDomAdapter.prototype.createShadowRoot = function(el) { + return el.createShadowRoot(); + }; + BrowserDomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + BrowserDomAdapter.prototype.getHost = function(el) { + return el.host; + }; + BrowserDomAdapter.prototype.clone = function(node) { + return node.cloneNode(true); + }; + BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { + return element.getElementsByClassName(name); + }; + BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { + return element.getElementsByTagName(name); + }; + BrowserDomAdapter.prototype.classList = function(element) { + return Array.prototype.slice.call(element.classList, 0); + }; + BrowserDomAdapter.prototype.addClass = function(element, classname) { + element.classList.add(classname); + }; + BrowserDomAdapter.prototype.removeClass = function(element, classname) { + element.classList.remove(classname); + }; + BrowserDomAdapter.prototype.hasClass = function(element, classname) { + return element.classList.contains(classname); + }; + BrowserDomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + element.style[stylename] = stylevalue; + }; + BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { + element.style[stylename] = null; + }; + BrowserDomAdapter.prototype.getStyle = function(element, stylename) { + return element.style[stylename]; + }; + BrowserDomAdapter.prototype.tagName = function(element) { + return element.tagName; + }; + BrowserDomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = element.attributes; + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.hasAttribute(attribute); + }; + BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { + return element.getAttribute(attribute); + }; + BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { + element.setAttribute(name, value); + }; + BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { + element.setAttributeNS(ns, name, value); + }; + BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { + element.removeAttribute(attribute); + }; + BrowserDomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + BrowserDomAdapter.prototype.createHtmlDocument = function() { + return document.implementation.createHTMLDocument('fakeTitle'); + }; + BrowserDomAdapter.prototype.defaultDoc = function() { + return document; + }; + BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { + try { + return el.getBoundingClientRect(); + } catch (e) { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; + } + }; + BrowserDomAdapter.prototype.getTitle = function() { + return document.title; + }; + BrowserDomAdapter.prototype.setTitle = function(newTitle) { + document.title = newTitle || ''; + }; + BrowserDomAdapter.prototype.elementMatches = function(n, selector) { + var matches = false; + if (n instanceof HTMLElement) { + if (n.matches) { + matches = n.matches(selector); + } else if (n.msMatchesSelector) { + matches = n.msMatchesSelector(selector); + } else if (n.webkitMatchesSelector) { + matches = n.webkitMatchesSelector(selector); + } + } + return matches; + }; + BrowserDomAdapter.prototype.isTemplateElement = function(el) { + return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; + }; + BrowserDomAdapter.prototype.isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + BrowserDomAdapter.prototype.isCommentNode = function(node) { + return node.nodeType === Node.COMMENT_NODE; + }; + BrowserDomAdapter.prototype.isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + BrowserDomAdapter.prototype.hasShadowRoot = function(node) { + return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); + }; + BrowserDomAdapter.prototype.isShadowRoot = function(node) { + return node instanceof DocumentFragment; + }; + BrowserDomAdapter.prototype.importIntoDoc = function(node) { + var toImport = node; + if (this.isTemplateElement(node)) { + toImport = this.content(node); + } + return document.importNode(toImport, true); + }; + BrowserDomAdapter.prototype.adoptNode = function(node) { + return document.adoptNode(node); + }; + BrowserDomAdapter.prototype.getHref = function(el) { + return el.href; + }; + BrowserDomAdapter.prototype.getEventKey = function(event) { + var key = event.key; + if (lang_1.isBlank(key)) { + key = event.keyIdentifier; + if (lang_1.isBlank(key)) { + return 'Unidentified'; + } + if (key.startsWith('U+')) { + key = String.fromCharCode(parseInt(key.substring(2), 16)); + if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { + key = _chromeNumKeyPadMap[key]; + } + } + } + if (_keyMap.hasOwnProperty(key)) { + key = _keyMap[key]; + } + return key; + }; + BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return window; + } else if (target == "document") { + return document; + } else if (target == "body") { + return document.body; + } + }; + BrowserDomAdapter.prototype.getHistory = function() { + return window.history; + }; + BrowserDomAdapter.prototype.getLocation = function() { + return window.location; + }; + BrowserDomAdapter.prototype.getBaseHref = function() { + var href = getBaseElementHref(); + if (lang_1.isBlank(href)) { + return null; + } + return relativePath(href); + }; + BrowserDomAdapter.prototype.resetBaseElement = function() { + baseElement = null; + }; + BrowserDomAdapter.prototype.getUserAgent = function() { + return window.navigator.userAgent; + }; + BrowserDomAdapter.prototype.setData = function(element, name, value) { + this.setAttribute(element, 'data-' + name, value); + }; + BrowserDomAdapter.prototype.getData = function(element, name) { + return this.getAttribute(element, 'data-' + name); + }; + BrowserDomAdapter.prototype.getComputedStyle = function(element) { + return getComputedStyle(element); + }; + BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { + return window.requestAnimationFrame(callback); + }; + BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { + window.cancelAnimationFrame(id); + }; + BrowserDomAdapter.prototype.performanceNow = function() { + if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { + return window.performance.now(); + } else { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + } + }; + return BrowserDomAdapter; + })(generic_browser_adapter_1.GenericBrowserDomAdapter); + exports.BrowserDomAdapter = BrowserDomAdapter; + var baseElement = null; + function getBaseElementHref() { + if (lang_1.isBlank(baseElement)) { + baseElement = document.querySelector('base'); + if (lang_1.isBlank(baseElement)) { + return null; + } + } + return baseElement.getAttribute('href'); + } + var urlParsingNode = null; + function relativePath(url) { + if (lang_1.isBlank(urlParsingNode)) { + urlParsingNode = document.createElement("a"); + } + urlParsingNode.setAttribute('href', url); + return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/post_message_bus", ["angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var PostMessageBus = (function() { + function PostMessageBus(sink, source) { + this.sink = sink; + this.source = source; + } + PostMessageBus.prototype.attachToZone = function(zone) { + this.source.attachToZone(zone); + this.sink.attachToZone(zone); + }; + PostMessageBus.prototype.initChannel = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this.source.initChannel(channel, runInZone); + this.sink.initChannel(channel, runInZone); + }; + PostMessageBus.prototype.from = function(channel) { + return this.source.from(channel); + }; + PostMessageBus.prototype.to = function(channel) { + return this.sink.to(channel); + }; + PostMessageBus = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [PostMessageBusSink, PostMessageBusSource])], PostMessageBus); + return PostMessageBus; + })(); + exports.PostMessageBus = PostMessageBus; + var PostMessageBusSink = (function() { + function PostMessageBusSink(_postMessageTarget) { + this._postMessageTarget = _postMessageTarget; + this._channels = collection_1.StringMapWrapper.create(); + this._messageBuffer = []; + } + PostMessageBusSink.prototype.attachToZone = function(zone) { + var _this = this; + this._zone = zone; + this._zone.overrideOnEventDone(function() { + return _this._handleOnEventDone(); + }, false); + }; + PostMessageBusSink.prototype.initChannel = function(channel, runInZone) { + var _this = this; + if (runInZone === void 0) { + runInZone = true; + } + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + throw new exceptions_1.BaseException(channel + " has already been initialized"); + } + var emitter = new async_1.EventEmitter(); + var channelInfo = new _Channel(emitter, runInZone); + this._channels[channel] = channelInfo; + emitter.subscribe(function(data) { + var message = { + channel: channel, + message: data + }; + if (runInZone) { + _this._messageBuffer.push(message); + } else { + _this._sendMessages([message]); + } + }); + }; + PostMessageBusSink.prototype.to = function(channel) { + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + return this._channels[channel].emitter; + } else { + throw new exceptions_1.BaseException(channel + " is not set up. Did you forget to call initChannel?"); + } + }; + PostMessageBusSink.prototype._handleOnEventDone = function() { + if (this._messageBuffer.length > 0) { + this._sendMessages(this._messageBuffer); + this._messageBuffer = []; + } + }; + PostMessageBusSink.prototype._sendMessages = function(messages) { + this._postMessageTarget.postMessage(messages); + }; + return PostMessageBusSink; + })(); + exports.PostMessageBusSink = PostMessageBusSink; + var PostMessageBusSource = (function() { + function PostMessageBusSource(eventTarget) { + var _this = this; + this._channels = collection_1.StringMapWrapper.create(); + if (eventTarget) { + eventTarget.addEventListener("message", function(ev) { + return _this._handleMessages(ev); + }); + } else { + addEventListener("message", function(ev) { + return _this._handleMessages(ev); + }); + } + } + PostMessageBusSource.prototype.attachToZone = function(zone) { + this._zone = zone; + }; + PostMessageBusSource.prototype.initChannel = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + throw new exceptions_1.BaseException(channel + " has already been initialized"); + } + var emitter = new async_1.EventEmitter(); + var channelInfo = new _Channel(emitter, runInZone); + this._channels[channel] = channelInfo; + }; + PostMessageBusSource.prototype.from = function(channel) { + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + return this._channels[channel].emitter; + } else { + throw new exceptions_1.BaseException(channel + " is not set up. Did you forget to call initChannel?"); + } + }; + PostMessageBusSource.prototype._handleMessages = function(ev) { + var messages = ev.data; + for (var i = 0; i < messages.length; i++) { + this._handleMessage(messages[i]); + } + }; + PostMessageBusSource.prototype._handleMessage = function(data) { + var channel = data.channel; + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + var channelInfo = this._channels[channel]; + if (channelInfo.runInZone) { + this._zone.run(function() { + channelInfo.emitter.next(data.message); + }); + } else { + channelInfo.emitter.next(data.message); + } + } + }; + return PostMessageBusSource; + })(); + exports.PostMessageBusSource = PostMessageBusSource; + var _Channel = (function() { + function _Channel(emitter, runInZone) { + this.emitter = emitter; + this.runInZone = runInZone; + } + return _Channel; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/di_bindings", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/animate/browser_details", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/dom/browser_adapter", "angular2/src/core/render/dom/events/key_events", "angular2/src/core/render/dom/events/hammer_gestures", "angular2/src/core/linker/view_pool", "angular2/src/core/render/api", "angular2/src/compiler/app_root_url", "angular2/src/core/render/render", "angular2/src/core/application_tokens", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/facade/exceptions", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/compiler/url_resolver", "angular2/src/core/testability/testability", "angular2/src/compiler/xhr", "angular2/src/compiler/xhr_impl", "angular2/src/web_workers/shared/serializer", "angular2/src/web_workers/shared/api", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/web_workers/ui/impl", "angular2/src/web_workers/shared/message_bus", "angular2/src/web_workers/ui/renderer", "angular2/src/web_workers/ui/xhr_impl", "angular2/src/web_workers/ui/setup", "angular2/src/web_workers/shared/service_message_broker", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/core/platform_directives_and_pipes", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var key_events_1 = require("angular2/src/core/render/dom/events/key_events"); + var hammer_gestures_1 = require("angular2/src/core/render/dom/events/hammer_gestures"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var api_1 = require("angular2/src/core/render/api"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var render_1 = require("angular2/src/core/render/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var testability_1 = require("angular2/src/core/testability/testability"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/compiler/xhr_impl"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var impl_1 = require("angular2/src/web_workers/ui/impl"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var renderer_1 = require("angular2/src/web_workers/ui/renderer"); + var xhr_impl_2 = require("angular2/src/web_workers/ui/xhr_impl"); + var setup_1 = require("angular2/src/web_workers/ui/setup"); + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var common_1 = require("angular2/common"); + var _rootInjector; + var _rootProviders = [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector})]; + function _injectorProviders() { + return [di_1.provide(render_1.DOCUMENT, {useValue: dom_adapter_1.DOM.defaultDoc()}), event_manager_1.EventManager, new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: event_manager_1.DomEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: key_events_1.KeyEventsPlugin, + multi: true + }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { + useClass: hammer_gestures_1.HammerGesturesPlugin, + multi: true + }), di_1.provide(render_1.DomRenderer, {useClass: render_1.DomRenderer_}), di_1.provide(api_1.Renderer, {useExisting: render_1.DomRenderer}), application_tokens_1.APP_ID_RANDOM_PROVIDER, shared_styles_host_1.DomSharedStylesHost, di_1.provide(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), serializer_1.Serializer, di_1.provide(api_2.ON_WEB_WORKER, {useValue: false}), di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useValue: new dom_element_schema_registry_1.DomElementSchemaRegistry()}), render_view_with_fragments_store_1.RenderViewWithFragmentsStore, render_proto_view_ref_store_1.RenderProtoViewRefStore, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_1.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), directive_resolver_1.DirectiveResolver, change_detection_1.Parser, change_detection_1.Lexer, di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(dom_adapter_1.DOM); + }, + deps: [] + }), di_1.provide(xhr_1.XHR, {useValue: new xhr_impl_1.XHRImpl()}), url_resolver_1.UrlResolver, di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_1.DynamicComponentLoader_}), testability_1.Testability, anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), impl_1.WebWorkerApplication, setup_1.WebWorkerSetup, xhr_impl_2.MessageBasedXHRImpl, renderer_1.MessageBasedRenderer, di_1.provide(service_message_broker_1.ServiceMessageBrokerFactory, {useClass: service_message_broker_1.ServiceMessageBrokerFactory_}), di_1.provide(client_message_broker_1.ClientMessageBrokerFactory, {useClass: client_message_broker_1.ClientMessageBrokerFactory_}), browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder]; + } + function createInjector(zone, bus) { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + _rootProviders.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + _rootProviders.push(di_1.provide(message_bus_1.MessageBus, {useValue: bus})); + var injector = di_1.Injector.resolveAndCreate(_rootProviders); + return injector.resolveAndCreateChild(_injectorProviders()); + } + exports.createInjector = createInjector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/impl", ["angular2/src/web_workers/ui/di_bindings", "angular2/src/core/application_ref", "angular2/src/core/di", "angular2/src/core/dom/browser_adapter", "angular2/src/core/profile/wtf_init", "angular2/src/web_workers/ui/setup", "angular2/src/web_workers/ui/renderer", "angular2/src/web_workers/ui/xhr_impl", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/web_workers/shared/service_message_broker"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_bindings_1 = require("angular2/src/web_workers/ui/di_bindings"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var di_1 = require("angular2/src/core/di"); + var browser_adapter_1 = require("angular2/src/core/dom/browser_adapter"); + var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); + var setup_1 = require("angular2/src/web_workers/ui/setup"); + var renderer_1 = require("angular2/src/web_workers/ui/renderer"); + var xhr_impl_1 = require("angular2/src/web_workers/ui/xhr_impl"); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + function bootstrapUICommon(bus) { + browser_adapter_1.BrowserDomAdapter.makeCurrent(); + var zone = application_ref_1.createNgZone(); + wtf_init_1.wtfInit(); + bus.attachToZone(zone); + return zone.run(function() { + var injector = di_bindings_1.createInjector(zone, bus); + injector.get(renderer_1.MessageBasedRenderer).start(); + injector.get(xhr_impl_1.MessageBasedXHRImpl).start(); + injector.get(setup_1.WebWorkerSetup).start(); + return injector.get(WebWorkerApplication); + }); + } + exports.bootstrapUICommon = bootstrapUICommon; + var WebWorkerApplication = (function() { + function WebWorkerApplication(_clientMessageBrokerFactory, _serviceMessageBrokerFactory) { + this._clientMessageBrokerFactory = _clientMessageBrokerFactory; + this._serviceMessageBrokerFactory = _serviceMessageBrokerFactory; + } + WebWorkerApplication.prototype.createClientMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + return this._clientMessageBrokerFactory.createMessageBroker(channel, runInZone); + }; + WebWorkerApplication.prototype.createServiceMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + return this._serviceMessageBrokerFactory.createMessageBroker(channel, runInZone); + }; + WebWorkerApplication = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [client_message_broker_1.ClientMessageBrokerFactory, service_message_broker_1.ServiceMessageBrokerFactory])], WebWorkerApplication); + return WebWorkerApplication; + })(); + exports.WebWorkerApplication = WebWorkerApplication; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/ui/application", ["angular2/src/web_workers/shared/post_message_bus", "angular2/src/web_workers/ui/impl", "angular2/src/web_workers/ui/impl", "angular2/src/web_workers/shared/message_bus"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var post_message_bus_1 = require("angular2/src/web_workers/shared/post_message_bus"); + var impl_1 = require("angular2/src/web_workers/ui/impl"); + var impl_2 = require("angular2/src/web_workers/ui/impl"); + exports.WebWorkerApplication = impl_2.WebWorkerApplication; + __export(require("angular2/src/web_workers/shared/message_bus")); + function bootstrap(uri) { + var instance = spawnWebWorker(uri); + instance.app = impl_1.bootstrapUICommon(instance.bus); + return instance; + } + exports.bootstrap = bootstrap; + function spawnWebWorker(uri) { + var webWorker = new Worker(uri); + var sink = new post_message_bus_1.PostMessageBusSink(webWorker); + var source = new post_message_bus_1.PostMessageBusSource(webWorker); + var bus = new post_message_bus_1.PostMessageBus(sink, source); + return new WebWorkerInstance(null, webWorker, bus); + } + exports.spawnWebWorker = spawnWebWorker; + var WebWorkerInstance = (function() { + function WebWorkerInstance(app, worker, bus) { + this.app = app; + this.worker = worker; + this.bus = bus; + } + return WebWorkerInstance; + })(); + exports.WebWorkerInstance = WebWorkerInstance; + global.define = __define; + return module.exports; +}); + +System.register("angular2/web_worker/ui", ["angular2/src/facade/facade", "angular2/src/core/zone", "angular2/src/web_workers/ui/application", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/web_workers/shared/service_message_broker", "angular2/src/web_workers/shared/serializer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/zone")); + __export(require("angular2/src/web_workers/ui/application")); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + exports.ClientMessageBroker = client_message_broker_1.ClientMessageBroker; + exports.ClientMessageBrokerFactory = client_message_broker_1.ClientMessageBrokerFactory; + exports.FnArg = client_message_broker_1.FnArg; + exports.UiArguments = client_message_broker_1.UiArguments; + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + exports.ReceivedMessage = service_message_broker_1.ReceivedMessage; + exports.ServiceMessageBroker = service_message_broker_1.ServiceMessageBroker; + exports.ServiceMessageBrokerFactory = service_message_broker_1.ServiceMessageBrokerFactory; + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + exports.PRIMITIVE = serializer_1.PRIMITIVE; + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=ui.dev.js.map \ No newline at end of file diff --git a/2.0.0-alpha.46/web_worker/worker.dev.js b/2.0.0-alpha.46/web_worker/worker.dev.js new file mode 100644 index 0000000000..82798d620e --- /dev/null +++ b/2.0.0-alpha.46/web_worker/worker.dev.js @@ -0,0 +1,48794 @@ +/** + @license +Copyright 2014-2015 Google, Inc. http://angularjs.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + */ + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + +// TODO(vicb): remove '!isFirefox' when the bug gets fixed: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1162013 +if (hasNativePromise && !isFirefox) { + // When available use a native Promise to schedule microtasks. + // When not available, es6-promise fallback will be used + var resolvedPromise = Promise.resolve(); + es6Promise._setScheduler(function(fn) { + resolvedPromise.then(fn); + }); +} + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"es6-promise":17}],5:[function(require,module,exports){ +(function (global){ +'use strict'; + +var fnPatch = require('./functions'); +var promisePatch = require('./promise'); +var mutationObserverPatch = require('./mutation-observer'); +var definePropertyPatch = require('./define-property'); +var registerElementPatch = require('./register-element'); +var webSocketPatch = require('./websocket'); +var eventTargetPatch = require('./event-target'); +var propertyDescriptorPatch = require('./property-descriptor'); +var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); + +function apply() { + fnPatch.patchSetClearFunction(global, [ + 'timeout', + 'interval', + 'immediate' + ]); + + fnPatch.patchRequestAnimationFrame(global, [ + 'requestAnimationFrame', + 'mozRequestAnimationFrame', + 'webkitRequestAnimationFrame' + ]); + + fnPatch.patchFunction(global, [ + 'alert', + 'prompt' + ]); + + eventTargetPatch.apply(); + + propertyDescriptorPatch.apply(); + + promisePatch.apply(); + + mutationObserverPatch.patchClass('MutationObserver'); + mutationObserverPatch.patchClass('WebKitMutationObserver'); + + definePropertyPatch.apply(); + + registerElementPatch.apply(); + + geolocationPatch.apply(); + + fileReaderPatch.apply(); +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(require,module,exports){ +'use strict'; + +var keys = require('../keys'); + +// might need similar for object.freeze +// i regret nothing + +var _defineProperty = Object.defineProperty; +var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); + +function apply() { + Object.defineProperty = function (obj, prop, desc) { + if (isUnconfigurable(obj, prop)) { + throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); + } + if (prop !== 'prototype') { + desc = rewriteDescriptor(obj, prop, desc); + } + return _defineProperty(obj, prop, desc); + }; + + Object.defineProperties = function (obj, props) { + Object.keys(props).forEach(function (prop) { + Object.defineProperty(obj, prop, props[prop]); + }); + return obj; + }; + + Object.create = function (obj, proto) { + if (typeof proto === 'object') { + Object.keys(proto).forEach(function (prop) { + proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); + }); + } + return _create(obj, proto); + }; + + Object.getOwnPropertyDescriptor = function (obj, prop) { + var desc = _getOwnPropertyDescriptor(obj, prop); + if (isUnconfigurable(obj, prop)) { + desc.configurable = false; + } + return desc; + }; +}; + +function _redefineProperty(obj, prop, desc) { + desc = rewriteDescriptor(obj, prop, desc); + return _defineProperty(obj, prop, desc); +}; + +function isUnconfigurable (obj, prop) { + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; +} + +function rewriteDescriptor (obj, prop, desc) { + desc.configurable = true; + if (!desc.configurable) { + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); + } + obj[unconfigurablesKey][prop] = true; + } + return desc; +} + +module.exports = { + apply: apply, + _redefineProperty: _redefineProperty +}; + + + +},{"../keys":3}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + // patched properties depend on addEventListener, so this needs to come first + if (global.EventTarget) { + utils.patchEventTargetMethods(global.EventTarget.prototype); + + // Note: EventTarget is not available in all browsers, + // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget + } else { + var apis = [ + 'ApplicationCache', + 'EventSource', + 'FileReader', + 'InputMethodContext', + 'MediaController', + 'MessagePort', + 'Node', + 'Performance', + 'SVGElementInstance', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebKitNamedFlow', + 'Worker', + 'WorkerGlobalScope', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload' + ]; + + apis.forEach(function(api) { + var proto = global[api] && global[api].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (proto && proto.addEventListener) { + utils.patchEventTargetMethods(proto); + } + }); + + // Patch the methods on `window` instead of `Window.prototype` + // `Window` is not accessible on Android 4.3 + if (typeof(window) !== 'undefined') { + utils.patchEventTargetMethods(window); + } + } +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":16}],9:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function patchSetClearFunction(obj, fnNames) { + fnNames.map(function (name) { + return name[0].toUpperCase() + name.substr(1); + }).forEach(function (name) { + var setName = 'set' + name; + var delegate = obj[setName]; + + if (delegate) { + var clearName = 'clear' + name; + var ids = {}; + + var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce; + + global.zone[setName] = function (fn) { + var id, fnRef = fn; + arguments[0] = function () { + delete ids[id]; + return fnRef.apply(this, arguments); + }; + var args = bindArgs(arguments); + id = delegate.apply(obj, args); + ids[id] = true; + return id; + }; + + obj[setName] = function () { + return global.zone[setName].apply(this, arguments); + }; + + var clearDelegate = obj[clearName]; + + global.zone[clearName] = function (id) { + if (ids[id]) { + delete ids[id]; + global.zone.dequeueTask(); + } + return clearDelegate.apply(this, arguments); + }; + + obj[clearName] = function () { + return global.zone[clearName].apply(this, arguments); + }; + } + }); +}; + + +/** + * requestAnimationFrame is typically recursively called from within the callback function + * that it executes. To handle this case, only fork a zone if this is executed + * within the root zone. + */ +function patchRequestAnimationFrame(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + global.zone[name] = function (fn) { + var callZone = global.zone.isRootZone() ? global.zone.fork() : global.zone; + if (fn) { + arguments[0] = function () { + return callZone.run(fn, this, arguments); + }; + } + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchSetFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + + if (delegate) { + global.zone[name] = function (fn) { + arguments[0] = function () { + return fn.apply(this, arguments); + }; + var args = utils.bindArgumentsOnce(arguments); + return delegate.apply(obj, args); + }; + + obj[name] = function () { + return zone[name].apply(this, arguments); + }; + } + }); +}; + +function patchFunction(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + global.zone[name] = function () { + return delegate.apply(obj, arguments); + }; + + obj[name] = function () { + return global.zone[name].apply(this, arguments); + }; + }); +}; + + +module.exports = { + patchSetClearFunction: patchSetClearFunction, + patchSetFunction: patchSetFunction, + patchRequestAnimationFrame: patchRequestAnimationFrame, + patchFunction: patchFunction +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + if (global.navigator && global.navigator.geolocation) { + utils.patchPrototype(global.navigator.geolocation, [ + 'getCurrentPosition', + 'watchPosition' + ]); + } +} + +module.exports = { + apply: apply +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],11:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function (fn) { + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); + // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks + this[creationZoneKey] = global.zone; + }; + + var instance = new OriginalClass(function () {}); + + global[className].prototype.disconnect = function () { + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; + } + return result; + }; + + global[className].prototype.observe = function () { + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; + } + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); + }; + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof global[className].prototype !== undefined) { + return; + } + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } +}; + +module.exports = { + patchClass: patchClass +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3}],12:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +/* + * Patches a function that returns a Promise-like instance. + * + * This function must be used when either: + * - Native Promises are not available, + * - The function returns a Promise-like object. + * + * This is required because zones rely on a Promise monkey patch that could not be applied when + * Promise is not natively available or when the returned object is not an instance of Promise. + * + * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work + * with minimal overhead. + * + * ``` + * var boundFunction = bindPromiseFn(FunctionReturningAPromise); + * + * boundFunction.then(successHandler, errorHandler); + * ``` + */ +var bindPromiseFn; + +if (global.Promise) { + bindPromiseFn = function (delegate) { + return function() { + var delegatePromise = delegate.apply(this, arguments); + + // if the delegate returned an instance of Promise, forward it. + if (delegatePromise instanceof Promise) { + return delegatePromise; + } + + // Otherwise wrap the Promise-like in a global Promise + return new Promise(function(resolve, reject) { + delegatePromise.then(resolve, reject); + }); + }; + }; +} else { + bindPromiseFn = function (delegate) { + return function () { + return _patchThenable(delegate.apply(this, arguments)); + }; + }; +} + + +function _patchPromiseFnsOnObject(objectPath, fnNames) { + var obj = global; + + var exists = objectPath.every(function (segment) { + obj = obj[segment]; + return obj; + }); + + if (!exists) { + return; + } + + fnNames.forEach(function (name) { + var fn = obj[name]; + if (fn) { + obj[name] = bindPromiseFn(fn); + } + }); +} + +function _patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = utils.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + var ocatch = thenable.catch; + thenable.catch = function () { + var args = utils.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return _patchThenable(nextThenable); + }; + + return thenable; +} + + +function apply() { + // Patch .then() and .catch() on native Promises to execute callbacks in the zone where + // those functions are called. + if (global.Promise) { + utils.patchPrototype(Promise.prototype, [ + 'then', + 'catch' + ]); + + // Patch browser APIs that return a Promise + var patchFns = [ + // fetch + [[], ['fetch']], + [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']] + ]; + + patchFns.forEach(function(objPathAndFns) { + _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]); + }); + } +} + +module.exports = { + apply: apply, + bindPromiseFn: bindPromiseFn +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],13:[function(require,module,exports){ +(function (global){ +'use strict'; + +var webSocketPatch = require('./websocket'); +var utils = require('../utils'); +var keys = require('../keys'); + +var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); + +function apply() { + if (utils.isWebWorker()){ + // on WebWorker so don't apply patch + return; + } + + var supportsWebSocket = typeof WebSocket !== 'undefined'; + if (canPatchViaPropertyDescriptor()) { + // for browsers that we can patch the descriptor: Chrome & Firefox + var onEventNames = eventNames.map(function (property) { + return 'on' + property; + }); + utils.patchProperties(HTMLElement.prototype, onEventNames); + utils.patchProperties(XMLHttpRequest.prototype); + if (supportsWebSocket) { + utils.patchProperties(WebSocket.prototype); + } + } else { + // Safari, Android browsers (Jelly Bean) + patchViaCapturingAllTheEvents(); + utils.patchClass('XMLHttpRequest'); + if (supportsWebSocket) { + webSocketPatch.apply(); + } + } +} + +function canPatchViaPropertyDescriptor() { + if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') { + // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 + // IDL interface attributes are not configurable + var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); + if (desc && !desc.configurable) return false; + } + + Object.defineProperty(HTMLElement.prototype, 'onclick', { + get: function () { + return true; + } + }); + var elt = document.createElement('div'); + var result = !!elt.onclick; + Object.defineProperty(HTMLElement.prototype, 'onclick', {}); + return result; +}; + +var unboundKey = keys.create('unbound'); + +// Whenever any event fires, we check the event target and all parents +// for `onwhatever` properties and replace them with zone-bound functions +// - Chrome (for now) +function patchViaCapturingAllTheEvents() { + eventNames.forEach(function (property) { + var onproperty = 'on' + property; + document.addEventListener(property, function (event) { + var elt = event.target, bound; + while (elt) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { + bound = global.zone.bind(elt[onproperty]); + bound[unboundKey] = elt[onproperty]; + elt[onproperty] = bound; + } + elt = elt.parentElement; + } + }, true); + }); +}; + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(require,module,exports){ +(function (global){ +'use strict'; + +var _redefineProperty = require('./define-property')._redefineProperty; +var utils = require("../utils"); + +function apply() { + if (utils.isWebWorker() || !('registerElement' in global.document)) { + return; + } + + var _registerElement = document.registerElement; + var callbacks = [ + 'createdCallback', + 'attachedCallback', + 'detachedCallback', + 'attributeChangedCallback' + ]; + + document.registerElement = function (name, opts) { + if (opts && opts.prototype) { + callbacks.forEach(function (callback) { + if (opts.prototype.hasOwnProperty(callback)) { + var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = global.zone.bind(descriptor.value); + _redefineProperty(opts.prototype, callback, descriptor); + } else { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + } else if (opts.prototype[callback]) { + opts.prototype[callback] = global.zone.bind(opts.prototype[callback]); + } + }); + } + + return _registerElement.apply(document, [name, opts]); + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16,"./define-property":6}],15:[function(require,module,exports){ +(function (global){ +'use strict'; + +var utils = require('../utils'); + +// we have to patch the instance since the proto is non-configurable +function apply() { + var WS = global.WebSocket; + utils.patchEventTargetMethods(WS.prototype); + global.WebSocket = function(a, b) { + var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); + var proxySocket; + + // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance + var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); + if (onmessageDesc && onmessageDesc.configurable === false) { + proxySocket = Object.create(socket); + ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) { + proxySocket[propName] = function() { + return socket[propName].apply(socket, arguments); + }; + }); + } else { + // we can patch the real socket + proxySocket = socket; + } + + utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']); + + return proxySocket; + }; +} + +module.exports = { + apply: apply +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../utils":16}],16:[function(require,module,exports){ +(function (global){ +'use strict'; + +var keys = require('./keys'); + +function bindArguments(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bind(args[i]); + } + } + return args; +}; + +function bindArgumentsOnce(args) { + for (var i = args.length - 1; i >= 0; i--) { + if (typeof args[i] === 'function') { + args[i] = global.zone.bindOnce(args[i]); + } + } + return args; +}; + +function patchPrototype(obj, fnNames) { + fnNames.forEach(function (name) { + var delegate = obj[name]; + if (delegate) { + obj[name] = function () { + return delegate.apply(this, bindArguments(arguments)); + }; + } + }); +}; + +function isWebWorker() { + return (typeof document === "undefined"); +} + +function patchProperty(obj, prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop) || { + enumerable: true, + configurable: true + }; + + // A property descriptor cannot have getter/setter and be writable + // deleting the writable and value properties avoids this error: + // + // TypeError: property descriptors must not specify a value or be writable when a + // getter or setter has been specified + delete desc.writable; + delete desc.value; + + // substr(2) cuz 'onclick' -> 'click', etc + var eventName = prop.substr(2); + var _prop = '_' + prop; + + desc.set = function (fn) { + if (this[_prop]) { + this.removeEventListener(eventName, this[_prop]); + } + + if (typeof fn === 'function') { + this[_prop] = fn; + this.addEventListener(eventName, fn, false); + } else { + this[_prop] = null; + } + }; + + desc.get = function () { + return this[_prop]; + }; + + Object.defineProperty(obj, prop, desc); +}; + +function patchProperties(obj, properties) { + (properties || (function () { + var props = []; + for (var prop in obj) { + props.push(prop); + } + return props; + }()). + filter(function (propertyName) { + return propertyName.substr(0,2) === 'on'; + })). + forEach(function (eventName) { + patchProperty(obj, eventName); + }); +}; + +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + +function patchEventTargetMethods(obj) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + var fn; + //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 + if (handler.toString() !== "[object FunctionWrapper]") { + if (handler.handleEvent) { + // Have to pass in 'handler' reference as an argument here, otherwise it gets clobbered in + // IE9 by the arguments[1] assignment at end of this function. + fn = (function(handler) { + return function() { + handler.handleEvent.apply(handler, arguments); + }; + })(handler); + } else { + fn = handler; + } + + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` (= `self`) + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + return global.zone.addEventListener.apply(target, arguments); + }; + + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; + } + + // - Inside a Web Worker, `this` is undefined, the context is `global` + // - When `addEventListener` is called on the global context in strict mode, `this` is undefined + // see https://github.com/angular/zone.js/issues/190 + var target = this || global; + + var result = global.zone.removeEventListener.apply(target, arguments); + global.zone.dequeueTask(handler[originalFnKey]); + return result; + }; +}; + +var originalInstanceKey = keys.create('originalInstance'); + +// wrap some native API on `window` +function patchClass(className) { + var OriginalClass = global[className]; + if (!OriginalClass) return; + + global[className] = function () { + var a = bindArguments(arguments); + switch (a.length) { + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; + default: throw new Error('what are you even doing?'); + } + }; + + var instance = new OriginalClass(); + + var prop; + for (prop in instance) { + (function (prop) { + if (typeof instance[prop] === 'function') { + global[className].prototype[prop] = function () { + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); + }; + } else { + Object.defineProperty(global[className].prototype, prop, { + set: function (fn) { + if (typeof fn === 'function') { + this[originalInstanceKey][prop] = global.zone.bind(fn); + } else { + this[originalInstanceKey][prop] = fn; + } + }, + get: function () { + return this[originalInstanceKey][prop]; + } + }); + } + }(prop)); + } + + for (prop in OriginalClass) { + if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { + global[className][prop] = OriginalClass[prop]; + } + } +}; + +module.exports = { + bindArguments: bindArguments, + bindArgumentsOnce: bindArgumentsOnce, + patchPrototype: patchPrototype, + patchProperty: patchProperty, + patchProperties: patchProperties, + patchEventTargetMethods: patchEventTargetMethods, + patchClass: patchClass, + isWebWorker: isWebWorker +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./keys":3}],17:[function(require,module,exports){ +(function (process,global){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 3.0.2 + */ + +(function() { + "use strict"; + function lib$es6$promise$utils$$objectOrFunction(x) { + return typeof x === 'function' || (typeof x === 'object' && x !== null); + } + + function lib$es6$promise$utils$$isFunction(x) { + return typeof x === 'function'; + } + + function lib$es6$promise$utils$$isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } + + var lib$es6$promise$utils$$_isArray; + if (!Array.isArray) { + lib$es6$promise$utils$$_isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + lib$es6$promise$utils$$_isArray = Array.isArray; + } + + var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; + var lib$es6$promise$asap$$len = 0; + var lib$es6$promise$asap$$toString = {}.toString; + var lib$es6$promise$asap$$vertxNext; + var lib$es6$promise$asap$$customSchedulerFn; + + var lib$es6$promise$asap$$asap = function asap(callback, arg) { + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback; + lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg; + lib$es6$promise$asap$$len += 2; + if (lib$es6$promise$asap$$len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (lib$es6$promise$asap$$customSchedulerFn) { + lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush); + } else { + lib$es6$promise$asap$$scheduleFlush(); + } + } + } + + function lib$es6$promise$asap$$setScheduler(scheduleFn) { + lib$es6$promise$asap$$customSchedulerFn = scheduleFn; + } + + function lib$es6$promise$asap$$setAsap(asapFn) { + lib$es6$promise$asap$$asap = asapFn; + } + + var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined; + var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; + var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + // test for web worker but not in IE10 + var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && + typeof importScripts !== 'undefined' && + typeof MessageChannel !== 'undefined'; + + // node + function lib$es6$promise$asap$$useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function() { + process.nextTick(lib$es6$promise$asap$$flush); + }; + } + + // vertx + function lib$es6$promise$asap$$useVertxTimer() { + return function() { + lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush); + }; + } + + function lib$es6$promise$asap$$useMutationObserver() { + var iterations = 0; + var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return function() { + node.data = (iterations = ++iterations % 2); + }; + } + + // web worker + function lib$es6$promise$asap$$useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = lib$es6$promise$asap$$flush; + return function () { + channel.port2.postMessage(0); + }; + } + + function lib$es6$promise$asap$$useSetTimeout() { + return function() { + setTimeout(lib$es6$promise$asap$$flush, 1); + }; + } + + var lib$es6$promise$asap$$queue = new Array(1000); + function lib$es6$promise$asap$$flush() { + for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) { + var callback = lib$es6$promise$asap$$queue[i]; + var arg = lib$es6$promise$asap$$queue[i+1]; + + callback(arg); + + lib$es6$promise$asap$$queue[i] = undefined; + lib$es6$promise$asap$$queue[i+1] = undefined; + } + + lib$es6$promise$asap$$len = 0; + } + + function lib$es6$promise$asap$$attemptVertx() { + try { + var r = require; + var vertx = r('vertx'); + lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext; + return lib$es6$promise$asap$$useVertxTimer(); + } catch(e) { + return lib$es6$promise$asap$$useSetTimeout(); + } + } + + var lib$es6$promise$asap$$scheduleFlush; + // Decide what async method to use to triggering processing of queued callbacks: + if (lib$es6$promise$asap$$isNode) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick(); + } else if (lib$es6$promise$asap$$BrowserMutationObserver) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver(); + } else if (lib$es6$promise$asap$$isWorker) { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); + } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); + } else { + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); + } + + function lib$es6$promise$$internal$$noop() {} + + var lib$es6$promise$$internal$$PENDING = void 0; + var lib$es6$promise$$internal$$FULFILLED = 1; + var lib$es6$promise$$internal$$REJECTED = 2; + + var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$selfFulfillment() { + return new TypeError("You cannot resolve a promise with itself"); + } + + function lib$es6$promise$$internal$$cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + + function lib$es6$promise$$internal$$getThen(promise) { + try { + return promise.then; + } catch(error) { + lib$es6$promise$$internal$$GET_THEN_ERROR.error = error; + return lib$es6$promise$$internal$$GET_THEN_ERROR; + } + } + + function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } + } + + function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) { + lib$es6$promise$asap$$asap(function(promise) { + var sealed = false; + var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + lib$es6$promise$$internal$$resolve(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + }, function(reason) { + if (sealed) { return; } + sealed = true; + + lib$es6$promise$$internal$$reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + lib$es6$promise$$internal$$reject(promise, error); + } + }, promise); + } + + function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) { + if (thenable._state === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, thenable._result); + } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, thenable._result); + } else { + lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) { + lib$es6$promise$$internal$$resolve(promise, value); + }, function(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } + } + + function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) { + if (maybeThenable.constructor === promise.constructor) { + lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable); + } else { + var then = lib$es6$promise$$internal$$getThen(maybeThenable); + + if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error); + } else if (then === undefined) { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } else if (lib$es6$promise$utils$$isFunction(then)) { + lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then); + } else { + lib$es6$promise$$internal$$fulfill(promise, maybeThenable); + } + } + } + + function lib$es6$promise$$internal$$resolve(promise, value) { + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); + } else if (lib$es6$promise$utils$$objectOrFunction(value)) { + lib$es6$promise$$internal$$handleMaybeThenable(promise, value); + } else { + lib$es6$promise$$internal$$fulfill(promise, value); + } + } + + function lib$es6$promise$$internal$$publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + + lib$es6$promise$$internal$$publish(promise); + } + + function lib$es6$promise$$internal$$fulfill(promise, value) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + + promise._result = value; + promise._state = lib$es6$promise$$internal$$FULFILLED; + + if (promise._subscribers.length !== 0) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise); + } + } + + function lib$es6$promise$$internal$$reject(promise, reason) { + if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; } + promise._state = lib$es6$promise$$internal$$REJECTED; + promise._result = reason; + + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise); + } + + function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onerror = null; + + subscribers[length] = child; + subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment; + subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection; + + if (length === 0 && parent._state) { + lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent); + } + } + + function lib$es6$promise$$internal$$publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (subscribers.length === 0) { return; } + + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + + promise._subscribers.length = 0; + } + + function lib$es6$promise$$internal$$ErrorObject() { + this.error = null; + } + + var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject(); + + function lib$es6$promise$$internal$$tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e; + return lib$es6$promise$$internal$$TRY_CATCH_ERROR; + } + } + + function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) { + var hasCallback = lib$es6$promise$utils$$isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = lib$es6$promise$$internal$$tryCatch(callback, detail); + + if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } + + if (promise === value) { + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn()); + return; + } + + } else { + value = detail; + succeeded = true; + } + + if (promise._state !== lib$es6$promise$$internal$$PENDING) { + // noop + } else if (hasCallback && succeeded) { + lib$es6$promise$$internal$$resolve(promise, value); + } else if (failed) { + lib$es6$promise$$internal$$reject(promise, error); + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { + lib$es6$promise$$internal$$fulfill(promise, value); + } else if (settled === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } + } + + function lib$es6$promise$$internal$$initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value){ + lib$es6$promise$$internal$$resolve(promise, value); + }, function rejectPromise(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + }); + } catch(e) { + lib$es6$promise$$internal$$reject(promise, e); + } + } + + function lib$es6$promise$enumerator$$Enumerator(Constructor, input) { + var enumerator = this; + + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; + + enumerator._init(); + + if (enumerator.length === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } else { + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result); + } + } + } else { + lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError()); + } + } + + lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) { + return lib$es6$promise$utils$$isArray(input); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._init = function() { + this._result = new Array(this.length); + }; + + var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator; + + lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() { + var enumerator = this; + + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + enumerator._eachEntry(input[i], i); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) { + var enumerator = this; + var c = enumerator._instanceConstructor; + + if (lib$es6$promise$utils$$isMaybeThenable(entry)) { + if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) { + entry._onerror = null; + enumerator._settledAt(entry._state, i, entry._result); + } else { + enumerator._willSettleAt(c.resolve(entry), i); + } + } else { + enumerator._remaining--; + enumerator._result[i] = entry; + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) { + var enumerator = this; + var promise = enumerator.promise; + + if (promise._state === lib$es6$promise$$internal$$PENDING) { + enumerator._remaining--; + + if (state === lib$es6$promise$$internal$$REJECTED) { + lib$es6$promise$$internal$$reject(promise, value); + } else { + enumerator._result[i] = value; + } + } + + if (enumerator._remaining === 0) { + lib$es6$promise$$internal$$fulfill(promise, enumerator._result); + } + }; + + lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; + + lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) { + enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason); + }); + }; + function lib$es6$promise$promise$all$$all(entries) { + return new lib$es6$promise$enumerator$$default(this, entries).promise; + } + var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all; + function lib$es6$promise$promise$race$$race(entries) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + + if (!lib$es6$promise$utils$$isArray(entries)) { + lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + lib$es6$promise$$internal$$resolve(promise, value); + } + + function onRejection(reason) { + lib$es6$promise$$internal$$reject(promise, reason); + } + + for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) { + lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; + } + var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race; + function lib$es6$promise$promise$resolve$$resolve(object) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$resolve(promise, object); + return promise; + } + var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve; + function lib$es6$promise$promise$reject$$reject(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(lib$es6$promise$$internal$$noop); + lib$es6$promise$$internal$$reject(promise, reason); + return promise; + } + var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject; + + var lib$es6$promise$promise$$counter = 0; + + function lib$es6$promise$promise$$needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + + function lib$es6$promise$promise$$needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + var lib$es6$promise$promise$$default = lib$es6$promise$promise$$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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {function} resolver + Useful for tooling. + @constructor + */ + function lib$es6$promise$promise$$Promise(resolver) { + this._id = lib$es6$promise$promise$$counter++; + this._state = undefined; + this._result = undefined; + this._subscribers = []; + + if (lib$es6$promise$$internal$$noop !== resolver) { + if (!lib$es6$promise$utils$$isFunction(resolver)) { + lib$es6$promise$promise$$needsResolver(); + } + + if (!(this instanceof lib$es6$promise$promise$$Promise)) { + lib$es6$promise$promise$$needsNew(); + } + + lib$es6$promise$$internal$$initializePromise(this, resolver); + } + } + + lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default; + lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default; + lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default; + lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default; + lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler; + lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap; + lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap; + + lib$es6$promise$promise$$Promise.prototype = { + constructor: lib$es6$promise$promise$$Promise, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + then: function(onFulfillment, onRejection) { + var parent = this; + var state = parent._state; + + if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) { + return this; + } + + var child = new this.constructor(lib$es6$promise$$internal$$noop); + var result = parent._result; + + if (state) { + var callback = arguments[state - 1]; + lib$es6$promise$asap$$asap(function(){ + lib$es6$promise$$internal$$invokeCallback(state, child, callback, result); + }); + } else { + lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection); + } + + return child; + }, + + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + 'catch': function(onRejection) { + return this.then(null, onRejection); + } + }; + function lib$es6$promise$polyfill$$polyfill() { + var local; + + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + var P = local.Promise; + + if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) { + return; + } + + local.Promise = lib$es6$promise$promise$$default; + } + var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill; + + var lib$es6$promise$umd$$ES6Promise = { + 'Promise': lib$es6$promise$promise$$default, + 'polyfill': lib$es6$promise$polyfill$$default + }; + + /* global define:true module:true window: true */ + if (typeof define === 'function' && define['amd']) { + define(function() { return lib$es6$promise$umd$$ES6Promise; }); + } else if (typeof module !== 'undefined' && module['exports']) { + module['exports'] = lib$es6$promise$umd$$ES6Promise; + } else if (typeof this !== 'undefined') { + this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise; + } + + lib$es6$promise$polyfill$$default(); +}).call(this); + + +}).call(this,{},typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) { + throw new TypeError(); + } + else if (!IsUndefined(targetKey)) { + targetKey = ToPropertyKey(targetKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + if (IsUndefined(metadataMap)) { + return false; + } + if (!metadataMap.delete(metadataKey)) { + return false; + } + if (metadataMap.size > 0) { + return true; + } + var targetMetadata = __Metadata__.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) { + return true; + } + __Metadata__.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) { + throw new TypeError(); + } + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) { + throw new TypeError(); + } + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = __Metadata__.get(target); + if (!targetMetadata) { + if (!create) { + return undefined; + } + targetMetadata = new _Map(); + __Metadata__.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) { + return undefined; + } + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return true; + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryHasMetadata(MetadataKey, parent, P); + } + return false; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return false; + } + return Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) { + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + var parent = GetPrototypeOf(O); + if (parent !== null) { + return OrdinaryGetMetadata(MetadataKey, parent, P); + } + return undefined; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (metadataMap === undefined) { + return undefined; + } + return metadataMap.get(MetadataKey); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) { + return ownKeys; + } + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) { + return ownKeys; + } + if (ownKeys.length <= 0) { + return parentKeys; + } + var set = new _Set(); + var keys = []; + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) { + metadataMap.forEach(function (_, key) { return keys.push(key); }); + } + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray(x); + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + if (IsSymbol(value)) { + return value; + } + return String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) { + return proto; + } + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) { + return proto; + } + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) { + return proto; + } + // if the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") { + return proto; + } + // if we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) { + return proto; + } + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + function Map() { + this._keys = []; + this._values = []; + this._cache = cacheSentinel; + } + Map.prototype = { + get size() { + return this._keys.length; + }, + has: function (key) { + if (key === this._cache) { + return true; + } + if (this._find(key) >= 0) { + this._cache = key; + return true; + } + return false; + }, + get: function (key) { + var index = this._find(key); + if (index >= 0) { + this._cache = key; + return this._values[index]; + } + return undefined; + }, + set: function (key, value) { + this.delete(key); + this._keys.push(key); + this._values.push(value); + this._cache = key; + return this; + }, + delete: function (key) { + var index = this._find(key); + if (index >= 0) { + this._keys.splice(index, 1); + this._values.splice(index, 1); + this._cache = cacheSentinel; + return true; + } + return false; + }, + clear: function () { + this._keys.length = 0; + this._values.length = 0; + this._cache = cacheSentinel; + }, + forEach: function (callback, thisArg) { + var size = this.size; + for (var i = 0; i < size; ++i) { + var key = this._keys[i]; + var value = this._values[i]; + this._cache = key; + callback.call(this, value, key, this); + } + }, + _find: function (key) { + var keys = this._keys; + var size = keys.length; + for (var i = 0; i < size; ++i) { + if (keys[i] === key) { + return i; + } + } + return -1; + } + }; + return Map; + } + // naive Set shim + function CreateSetPolyfill() { + var cacheSentinel = {}; + function Set() { + this._map = new _Map(); + } + Set.prototype = { + get size() { + return this._map.length; + }, + has: function (value) { + return this._map.has(value); + }, + add: function (value) { + this._map.set(value, value); + return this; + }, + delete: function (value) { + return this._map.delete(value); + }, + clear: function () { + this._map.clear(); + }, + forEach: function (callback, thisArg) { + this._map.forEach(callback, thisArg); + } + }; + return Set; + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; + var nodeCrypto = isNode && require("crypto"); + var hasOwn = Object.prototype.hasOwnProperty; + var keys = {}; + var rootKey = CreateUniqueKey(); + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype = { + has: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return this._key in table; + } + return false; + }, + get: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table) { + return table[this._key]; + } + return undefined; + }, + set: function (target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }, + delete: function (target) { + var table = GetOrCreateWeakMapTable(target, false); + if (table && this._key in table) { + return delete table[this._key]; + } + return false; + }, + clear: function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + } + }; + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) { + buffer[i] = Math.random() * 255 | 0; + } + } + function GenRandomBytes(size) { + if (nodeCrypto) { + var data = nodeCrypto.randomBytes(size); + return data; + } + else if (typeof Uint8Array === "function") { + var data = new Uint8Array(size); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(data); + } + else if (typeof msCrypto !== "undefined") { + msCrypto.getRandomValues(data); + } + else { + FillRandomBytes(data, size); + } + return data; + } + else { + var data = new Array(size); + FillRandomBytes(data, size); + return data; + } + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) { + result += "-"; + } + if (byte < 16) { + result += "0"; + } + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do { + key = "@@WeakMap@@" + CreateUUID(); + } while (hasOwn.call(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) { + return undefined; + } + Object.defineProperty(target, rootKey, { value: Object.create(null) }); + } + return target[rootKey]; + } + return WeakMap; + } + // hook global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + __global.Reflect[p] = Reflect[p]; + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURLDisabled=Reflect.js.map +"format register"; +System.register("angular2/lifecycle_hooks", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var globalScope; + if (typeof window === 'undefined') { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + globalScope = self; + } else { + globalScope = global; + } + } else { + globalScope = window; + } + ; + exports.IS_DART = false; + var _global = globalScope; + exports.global = _global; + exports.Type = Function; + function getTypeNameForDebugging(type) { + return type['name']; + } + exports.getTypeNameForDebugging = getTypeNameForDebugging; + exports.Math = _global.Math; + exports.Date = _global.Date; + var _devMode = !!_global.angularDevMode; + var _devModeLocked = false; + function lockDevMode() { + _devModeLocked = true; + } + exports.lockDevMode = lockDevMode; + function enableDevMode() { + if (_devModeLocked) { + throw 'Cannot enable dev mode after platform setup.'; + } + _devMode = true; + } + exports.enableDevMode = enableDevMode; + function assertionsEnabled() { + return _devMode; + } + exports.assertionsEnabled = assertionsEnabled; + _global.assert = function assert(condition) {}; + function CONST_EXPR(expr) { + return expr; + } + exports.CONST_EXPR = CONST_EXPR; + function CONST() { + return function(target) { + return target; + }; + } + exports.CONST = CONST; + function isPresent(obj) { + return obj !== undefined && obj !== null; + } + exports.isPresent = isPresent; + function isBlank(obj) { + return obj === undefined || obj === null; + } + exports.isBlank = isBlank; + function isString(obj) { + return typeof obj === "string"; + } + exports.isString = isString; + function isFunction(obj) { + return typeof obj === "function"; + } + exports.isFunction = isFunction; + function isType(obj) { + return isFunction(obj); + } + exports.isType = isType; + function isStringMap(obj) { + return typeof obj === 'object' && obj !== null; + } + exports.isStringMap = isStringMap; + function isPromise(obj) { + return obj instanceof _global.Promise; + } + exports.isPromise = isPromise; + function isArray(obj) { + return Array.isArray(obj); + } + exports.isArray = isArray; + function isNumber(obj) { + return typeof obj === 'number'; + } + exports.isNumber = isNumber; + function isDate(obj) { + return obj instanceof exports.Date && !isNaN(obj.valueOf()); + } + exports.isDate = isDate; + function stringify(token) { + if (typeof token === 'string') { + return token; + } + if (token === undefined || token === null) { + return '' + token; + } + if (token.name) { + return token.name; + } + var res = token.toString(); + var newLineIndex = res.indexOf("\n"); + return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); + } + exports.stringify = stringify; + function serializeEnum(val) { + return val; + } + exports.serializeEnum = serializeEnum; + function deserializeEnum(val, values) { + return val; + } + exports.deserializeEnum = deserializeEnum; + var StringWrapper = (function() { + function StringWrapper() {} + StringWrapper.fromCharCode = function(code) { + return String.fromCharCode(code); + }; + StringWrapper.charCodeAt = function(s, index) { + return s.charCodeAt(index); + }; + StringWrapper.split = function(s, regExp) { + return s.split(regExp); + }; + StringWrapper.equals = function(s, s2) { + return s === s2; + }; + StringWrapper.replace = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.replaceAll = function(s, from, replace) { + return s.replace(from, replace); + }; + StringWrapper.slice = function(s, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return s.slice(from, to === null ? undefined : to); + }; + StringWrapper.replaceAllMapped = function(s, from, cb) { + return s.replace(from, function() { + var matches = []; + for (var _i = 0; _i < arguments.length; _i++) { + matches[_i - 0] = arguments[_i]; + } + matches.splice(-2, 2); + return cb(matches); + }); + }; + StringWrapper.contains = function(s, substr) { + return s.indexOf(substr) != -1; + }; + StringWrapper.compare = function(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + }; + return StringWrapper; + })(); + exports.StringWrapper = StringWrapper; + var StringJoiner = (function() { + function StringJoiner(parts) { + if (parts === void 0) { + parts = []; + } + this.parts = parts; + } + StringJoiner.prototype.add = function(part) { + this.parts.push(part); + }; + StringJoiner.prototype.toString = function() { + return this.parts.join(""); + }; + return StringJoiner; + })(); + exports.StringJoiner = StringJoiner; + var NumberParseError = (function(_super) { + __extends(NumberParseError, _super); + function NumberParseError(message) { + _super.call(this); + this.message = message; + } + NumberParseError.prototype.toString = function() { + return this.message; + }; + return NumberParseError; + })(Error); + exports.NumberParseError = NumberParseError; + var NumberWrapper = (function() { + function NumberWrapper() {} + NumberWrapper.toFixed = function(n, fractionDigits) { + return n.toFixed(fractionDigits); + }; + NumberWrapper.equal = function(a, b) { + return a === b; + }; + NumberWrapper.parseIntAutoRadix = function(text) { + var result = parseInt(text); + if (isNaN(result)) { + throw new NumberParseError("Invalid integer literal when parsing " + text); + } + return result; + }; + NumberWrapper.parseInt = function(text, radix) { + if (radix == 10) { + if (/^(\-|\+)?[0-9]+$/.test(text)) { + return parseInt(text, radix); + } + } else if (radix == 16) { + if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { + return parseInt(text, radix); + } + } else { + var result = parseInt(text, radix); + if (!isNaN(result)) { + return result; + } + } + throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); + }; + NumberWrapper.parseFloat = function(text) { + return parseFloat(text); + }; + Object.defineProperty(NumberWrapper, "NaN", { + get: function() { + return NaN; + }, + enumerable: true, + configurable: true + }); + NumberWrapper.isNaN = function(value) { + return isNaN(value); + }; + NumberWrapper.isInteger = function(value) { + return Number.isInteger(value); + }; + return NumberWrapper; + })(); + exports.NumberWrapper = NumberWrapper; + exports.RegExp = _global.RegExp; + var RegExpWrapper = (function() { + function RegExpWrapper() {} + RegExpWrapper.create = function(regExpStr, flags) { + if (flags === void 0) { + flags = ''; + } + flags = flags.replace(/g/g, ''); + return new _global.RegExp(regExpStr, flags + 'g'); + }; + RegExpWrapper.firstMatch = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.exec(input); + }; + RegExpWrapper.test = function(regExp, input) { + regExp.lastIndex = 0; + return regExp.test(input); + }; + RegExpWrapper.matcher = function(regExp, input) { + regExp.lastIndex = 0; + return { + re: regExp, + input: input + }; + }; + return RegExpWrapper; + })(); + exports.RegExpWrapper = RegExpWrapper; + var RegExpMatcherWrapper = (function() { + function RegExpMatcherWrapper() {} + RegExpMatcherWrapper.next = function(matcher) { + return matcher.re.exec(matcher.input); + }; + return RegExpMatcherWrapper; + })(); + exports.RegExpMatcherWrapper = RegExpMatcherWrapper; + var FunctionWrapper = (function() { + function FunctionWrapper() {} + FunctionWrapper.apply = function(fn, posArgs) { + return fn.apply(null, posArgs); + }; + return FunctionWrapper; + })(); + exports.FunctionWrapper = FunctionWrapper; + function looseIdentical(a, b) { + return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); + } + exports.looseIdentical = looseIdentical; + function getMapKey(value) { + return value; + } + exports.getMapKey = getMapKey; + function normalizeBlank(obj) { + return isBlank(obj) ? null : obj; + } + exports.normalizeBlank = normalizeBlank; + function normalizeBool(obj) { + return isBlank(obj) ? false : obj; + } + exports.normalizeBool = normalizeBool; + function isJsObject(o) { + return o !== null && (typeof o === "function" || typeof o === "object"); + } + exports.isJsObject = isJsObject; + function print(obj) { + console.log(obj); + } + exports.print = print; + var Json = (function() { + function Json() {} + Json.parse = function(s) { + return _global.JSON.parse(s); + }; + Json.stringify = function(data) { + return _global.JSON.stringify(data, null, 2); + }; + return Json; + })(); + exports.Json = Json; + var DateWrapper = (function() { + function DateWrapper() {} + DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { + if (month === void 0) { + month = 1; + } + if (day === void 0) { + day = 1; + } + if (hour === void 0) { + hour = 0; + } + if (minutes === void 0) { + minutes = 0; + } + if (seconds === void 0) { + seconds = 0; + } + if (milliseconds === void 0) { + milliseconds = 0; + } + return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); + }; + DateWrapper.fromISOString = function(str) { + return new exports.Date(str); + }; + DateWrapper.fromMillis = function(ms) { + return new exports.Date(ms); + }; + DateWrapper.toMillis = function(date) { + return date.getTime(); + }; + DateWrapper.now = function() { + return new exports.Date(); + }; + DateWrapper.toJson = function(date) { + return date.toJSON(); + }; + return DateWrapper; + })(); + exports.DateWrapper = DateWrapper; + function setValueOnPath(global, path, value) { + var parts = path.split('.'); + var obj = global; + while (parts.length > 1) { + var name = parts.shift(); + if (obj.hasOwnProperty(name)) { + obj = obj[name]; + } else { + obj = obj[name] = {}; + } + } + if (obj === undefined || obj === null) { + obj = {}; + } + obj[parts.shift()] = value; + } + exports.setValueOnPath = setValueOnPath; + var _symbolIterator = null; + function getSymbolIterator() { + if (isBlank(_symbolIterator)) { + if (isPresent(Symbol) && isPresent(Symbol.iterator)) { + _symbolIterator = Symbol.iterator; + } else { + var keys = Object.getOwnPropertyNames(Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { + _symbolIterator = key; + } + } + } + } + return _symbolIterator; + } + exports.getSymbolIterator = getSymbolIterator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var InjectMetadata = (function() { + function InjectMetadata(token) { + this.token = token; + } + InjectMetadata.prototype.toString = function() { + return "@Inject(" + lang_1.stringify(this.token) + ")"; + }; + InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); + return InjectMetadata; + })(); + exports.InjectMetadata = InjectMetadata; + var OptionalMetadata = (function() { + function OptionalMetadata() {} + OptionalMetadata.prototype.toString = function() { + return "@Optional()"; + }; + OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); + return OptionalMetadata; + })(); + exports.OptionalMetadata = OptionalMetadata; + var DependencyMetadata = (function() { + function DependencyMetadata() {} + Object.defineProperty(DependencyMetadata.prototype, "token", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); + return DependencyMetadata; + })(); + exports.DependencyMetadata = DependencyMetadata; + var InjectableMetadata = (function() { + function InjectableMetadata() {} + InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); + return InjectableMetadata; + })(); + exports.InjectableMetadata = InjectableMetadata; + var SelfMetadata = (function() { + function SelfMetadata() {} + SelfMetadata.prototype.toString = function() { + return "@Self()"; + }; + SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); + return SelfMetadata; + })(); + exports.SelfMetadata = SelfMetadata; + var SkipSelfMetadata = (function() { + function SkipSelfMetadata() {} + SkipSelfMetadata.prototype.toString = function() { + return "@SkipSelf()"; + }; + SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); + return SkipSelfMetadata; + })(); + exports.SkipSelfMetadata = SkipSelfMetadata; + var HostMetadata = (function() { + function HostMetadata() {} + HostMetadata.prototype.toString = function() { + return "@Host()"; + }; + HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); + return HostMetadata; + })(); + exports.HostMetadata = HostMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function extractAnnotation(annotation) { + if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { + annotation = annotation.annotation; + } + return annotation; + } + function applyParams(fnOrArray, key) { + if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { + throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); + } + if (lang_1.isFunction(fnOrArray)) { + return fnOrArray; + } else if (fnOrArray instanceof Array) { + var annotations = fnOrArray; + var fn = fnOrArray[fnOrArray.length - 1]; + if (!lang_1.isFunction(fn)) { + throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); + } + var annoLength = annotations.length - 1; + if (annoLength != fn.length) { + throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); + } + var paramsAnnotations = []; + for (var i = 0, + ii = annotations.length - 1; i < ii; i++) { + var paramAnnotations = []; + paramsAnnotations.push(paramAnnotations); + var annotation = annotations[i]; + if (annotation instanceof Array) { + for (var j = 0; j < annotation.length; j++) { + paramAnnotations.push(extractAnnotation(annotation[j])); + } + } else if (lang_1.isFunction(annotation)) { + paramAnnotations.push(extractAnnotation(annotation)); + } else { + paramAnnotations.push(annotation); + } + } + Reflect.defineMetadata('parameters', paramsAnnotations, fn); + return fn; + } else { + throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); + } + } + function Class(clsDef) { + var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); + var proto = constructor.prototype; + if (clsDef.hasOwnProperty('extends')) { + if (lang_1.isFunction(clsDef.extends)) { + constructor.prototype = proto = Object.create(clsDef.extends.prototype); + } else { + throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); + } + } + for (var key in clsDef) { + if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { + proto[key] = applyParams(clsDef[key], key); + } + } + if (this && this.annotations instanceof Array) { + Reflect.defineMetadata('annotations', this.annotations, constructor); + } + return constructor; + } + exports.Class = Class; + var Reflect = lang_1.global.Reflect; + if (!(Reflect && Reflect.getMetadata)) { + throw 'reflect-metadata shim is required when using class decorators'; + } + function makeDecorator(annotationCls, chainFn) { + if (chainFn === void 0) { + chainFn = null; + } + function DecoratorFactory(objOrType) { + var annotationInstance = new annotationCls(objOrType); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; + chainAnnotation.push(annotationInstance); + var TypeDecorator = function TypeDecorator(cls) { + var annotations = Reflect.getOwnMetadata('annotations', cls); + annotations = annotations || []; + annotations.push(annotationInstance); + Reflect.defineMetadata('annotations', annotations, cls); + return cls; + }; + TypeDecorator.annotations = chainAnnotation; + TypeDecorator.Class = Class; + if (chainFn) + chainFn(TypeDecorator); + return TypeDecorator; + } + } + DecoratorFactory.prototype = Object.create(annotationCls.prototype); + return DecoratorFactory; + } + exports.makeDecorator = makeDecorator; + function makeParamDecorator(annotationCls) { + function ParamDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var annotationInstance = Object.create(annotationCls.prototype); + annotationCls.apply(annotationInstance, args); + if (this instanceof annotationCls) { + return annotationInstance; + } else { + ParamDecorator.annotation = annotationInstance; + return ParamDecorator; + } + function ParamDecorator(cls, unusedKey, index) { + var parameters = Reflect.getMetadata('parameters', cls); + parameters = parameters || []; + while (parameters.length <= index) { + parameters.push(null); + } + parameters[index] = parameters[index] || []; + var annotationsForParam = parameters[index]; + annotationsForParam.push(annotationInstance); + Reflect.defineMetadata('parameters', parameters, cls); + return cls; + } + } + ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); + return ParamDecoratorFactory; + } + exports.makeParamDecorator = makeParamDecorator; + function makePropDecorator(decoratorCls) { + function PropDecoratorFactory() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var decoratorInstance = Object.create(decoratorCls.prototype); + decoratorCls.apply(decoratorInstance, args); + if (this instanceof decoratorCls) { + return decoratorInstance; + } else { + return function PropDecorator(target, name) { + var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); + meta = meta || {}; + meta[name] = meta[name] || []; + meta[name].unshift(decoratorInstance); + Reflect.defineMetadata('propMetadata', meta, target.constructor); + }; + } + } + PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); + return PropDecoratorFactory; + } + exports.makePropDecorator = makePropDecorator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function forwardRef(forwardRefFn) { + forwardRefFn.__forward_ref__ = forwardRef; + forwardRefFn.toString = function() { + return lang_1.stringify(this()); + }; + return forwardRefFn; + } + exports.forwardRef = forwardRef; + function resolveForwardRef(type) { + if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { + return type(); + } else { + return type; + } + } + exports.resolveForwardRef = resolveForwardRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; + } + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); + } + return map; + }; + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; + } + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); + }); + return map; + }; + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; + } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); + return res; + }; + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); + }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); + } + return result; + }; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; + }; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); + }; + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + })(); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); + } + } + }; + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; + } + } + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } + } + return m; + }; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + })(); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); + } + }; + ListWrapper.first = function(array) { + if (!array) + return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + return array.indexOf(value, startIndex); + }; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; + }; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); + }; + ListWrapper.concat = function(a, b) { + return a.concat(b); + }; + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); + }; + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; + }; + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } + }; + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; + }; + ListWrapper.clear = function(list) { + list.length = 0; + }; + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); + } else { + l.sort(); + } + }; + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { + return null; + } + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; + }; + return ListWrapper; + })(); + exports.ListWrapper = ListWrapper; + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); + }; + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); + } + } + return res; + }; + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); + }; + SetWrapper.has = function(s, key) { + return s.has(key); + }; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; + })(); + exports.SetWrapper = SetWrapper; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + })(); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof exceptions_1.WrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception.originalException; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof exceptions_1.WrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof exceptions_1.WrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + })(); + exports.ExceptionHandler = ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ReflectionInfo = (function() { + function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { + this.annotations = annotations; + this.parameters = parameters; + this.factory = factory; + this.interfaces = interfaces; + this.propMetadata = propMetadata; + } + return ReflectionInfo; + })(); + exports.ReflectionInfo = ReflectionInfo; + var Reflector = (function() { + function Reflector(reflectionCapabilities) { + this._injectableInfo = new collection_1.Map(); + this._getters = new collection_1.Map(); + this._setters = new collection_1.Map(); + this._methods = new collection_1.Map(); + this._usedKeys = null; + this.reflectionCapabilities = reflectionCapabilities; + } + Reflector.prototype.isReflectionEnabled = function() { + return this.reflectionCapabilities.isReflectionEnabled(); + }; + Reflector.prototype.trackUsage = function() { + this._usedKeys = new collection_1.Set(); + }; + Reflector.prototype.listUnusedKeys = function() { + var _this = this; + if (this._usedKeys == null) { + throw new exceptions_1.BaseException('Usage tracking is disabled'); + } + var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); + return allTypes.filter(function(key) { + return !collection_1.SetWrapper.has(_this._usedKeys, key); + }); + }; + Reflector.prototype.registerFunction = function(func, funcInfo) { + this._injectableInfo.set(func, funcInfo); + }; + Reflector.prototype.registerType = function(type, typeInfo) { + this._injectableInfo.set(type, typeInfo); + }; + Reflector.prototype.registerGetters = function(getters) { + _mergeMaps(this._getters, getters); + }; + Reflector.prototype.registerSetters = function(setters) { + _mergeMaps(this._setters, setters); + }; + Reflector.prototype.registerMethods = function(methods) { + _mergeMaps(this._methods, methods); + }; + Reflector.prototype.factory = function(type) { + if (this._containsReflectionInfo(type)) { + var res = this._getReflectionInfo(type).factory; + return lang_1.isPresent(res) ? res : null; + } else { + return this.reflectionCapabilities.factory(type); + } + }; + Reflector.prototype.parameters = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).parameters; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.parameters(typeOrFunc); + } + }; + Reflector.prototype.annotations = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).annotations; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.annotations(typeOrFunc); + } + }; + Reflector.prototype.propMetadata = function(typeOrFunc) { + if (this._injectableInfo.has(typeOrFunc)) { + var res = this._getReflectionInfo(typeOrFunc).propMetadata; + return lang_1.isPresent(res) ? res : {}; + } else { + return this.reflectionCapabilities.propMetadata(typeOrFunc); + } + }; + Reflector.prototype.interfaces = function(type) { + if (this._injectableInfo.has(type)) { + var res = this._getReflectionInfo(type).interfaces; + return lang_1.isPresent(res) ? res : []; + } else { + return this.reflectionCapabilities.interfaces(type); + } + }; + Reflector.prototype.getter = function(name) { + if (this._getters.has(name)) { + return this._getters.get(name); + } else { + return this.reflectionCapabilities.getter(name); + } + }; + Reflector.prototype.setter = function(name) { + if (this._setters.has(name)) { + return this._setters.get(name); + } else { + return this.reflectionCapabilities.setter(name); + } + }; + Reflector.prototype.method = function(name) { + if (this._methods.has(name)) { + return this._methods.get(name); + } else { + return this.reflectionCapabilities.method(name); + } + }; + Reflector.prototype._getReflectionInfo = function(typeOrFunc) { + if (lang_1.isPresent(this._usedKeys)) { + this._usedKeys.add(typeOrFunc); + } + return this._injectableInfo.get(typeOrFunc); + }; + Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { + return this._injectableInfo.has(typeOrFunc); + }; + Reflector.prototype.importUri = function(type) { + return this.reflectionCapabilities.importUri(type); + }; + return Reflector; + })(); + exports.Reflector = Reflector; + function _mergeMaps(target, config) { + collection_1.StringMapWrapper.forEach(config, function(v, k) { + return target.set(k, v); + }); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ReflectionCapabilities = (function() { + function ReflectionCapabilities(reflect) { + this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; + } + ReflectionCapabilities.prototype.isReflectionEnabled = function() { + return true; + }; + ReflectionCapabilities.prototype.factory = function(t) { + switch (t.length) { + case 0: + return function() { + return new t(); + }; + case 1: + return function(a1) { + return new t(a1); + }; + case 2: + return function(a1, a2) { + return new t(a1, a2); + }; + case 3: + return function(a1, a2, a3) { + return new t(a1, a2, a3); + }; + case 4: + return function(a1, a2, a3, a4) { + return new t(a1, a2, a3, a4); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return new t(a1, a2, a3, a4, a5); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return new t(a1, a2, a3, a4, a5, a6); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return new t(a1, a2, a3, a4, a5, a6, a7); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + case 10: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + }; + case 11: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }; + case 12: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); + }; + case 13: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); + }; + case 14: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); + }; + case 15: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + }; + case 16: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); + }; + case 17: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); + }; + case 18: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); + }; + case 19: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); + }; + case 20: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { + return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + }; + } + ; + throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); + }; + ReflectionCapabilities.prototype._zipTypesAndAnnotaions = function(paramTypes, paramAnnotations) { + var result; + if (typeof paramTypes === 'undefined') { + result = new Array(paramAnnotations.length); + } else { + result = new Array(paramTypes.length); + } + for (var i = 0; i < result.length; i++) { + if (typeof paramTypes === 'undefined') { + result[i] = []; + } else if (paramTypes[i] != Object) { + result[i] = [paramTypes[i]]; + } else { + result[i] = []; + } + if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { + result[i] = result[i].concat(paramAnnotations[i]); + } + } + return result; + }; + ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.parameters)) { + return typeOrFunc.parameters; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); + var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); + if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { + return this._zipTypesAndAnnotaions(paramTypes, paramAnnotations); + } + } + var parameters = new Array(typeOrFunc.length); + parameters.fill(undefined); + return parameters; + }; + ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.annotations)) { + var annotations = typeOrFunc.annotations; + if (lang_1.isFunction(annotations) && annotations.annotations) { + annotations = annotations.annotations; + } + return annotations; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var annotations = this._reflect.getMetadata('annotations', typeOrFunc); + if (lang_1.isPresent(annotations)) + return annotations; + } + return []; + }; + ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { + if (lang_1.isPresent(typeOrFunc.propMetadata)) { + var propMetadata = typeOrFunc.propMetadata; + if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { + propMetadata = propMetadata.propMetadata; + } + return propMetadata; + } + if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { + var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); + if (lang_1.isPresent(propMetadata)) + return propMetadata; + } + return {}; + }; + ReflectionCapabilities.prototype.interfaces = function(type) { + throw new exceptions_1.BaseException("JavaScript does not support interfaces"); + }; + ReflectionCapabilities.prototype.getter = function(name) { + return new Function('o', 'return o.' + name + ';'); + }; + ReflectionCapabilities.prototype.setter = function(name) { + return new Function('o', 'v', 'return o.' + name + ' = v;'); + }; + ReflectionCapabilities.prototype.method = function(name) { + var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; + return new Function('o', 'args', functionBody); + }; + ReflectionCapabilities.prototype.importUri = function(type) { + return './'; + }; + return ReflectionCapabilities; + })(); + exports.ReflectionCapabilities = ReflectionCapabilities; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/type_literal", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var TypeLiteral = (function() { + function TypeLiteral() {} + Object.defineProperty(TypeLiteral.prototype, "type", { + get: function() { + throw new Error("Type literals are only supported in Dart"); + }, + enumerable: true, + configurable: true + }); + return TypeLiteral; + })(); + exports.TypeLiteral = TypeLiteral; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function findFirstClosedCycle(keys) { + var res = []; + for (var i = 0; i < keys.length; ++i) { + if (collection_1.ListWrapper.contains(res, keys[i])) { + res.push(keys[i]); + return res; + } else { + res.push(keys[i]); + } + } + return res; + } + function constructResolvingPath(keys) { + if (keys.length > 1) { + var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); + var tokenStrs = reversed.map(function(k) { + return lang_1.stringify(k.token); + }); + return " (" + tokenStrs.join(' -> ') + ")"; + } else { + return ""; + } + } + var AbstractProviderError = (function(_super) { + __extends(AbstractProviderError, _super); + function AbstractProviderError(injector, key, constructResolvingMessage) { + _super.call(this, "DI Exception"); + this.keys = [key]; + this.injectors = [injector]; + this.constructResolvingMessage = constructResolvingMessage; + this.message = this.constructResolvingMessage(this.keys); + } + AbstractProviderError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + this.message = this.constructResolvingMessage(this.keys); + }; + Object.defineProperty(AbstractProviderError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return AbstractProviderError; + })(exceptions_1.BaseException); + exports.AbstractProviderError = AbstractProviderError; + var NoProviderError = (function(_super) { + __extends(NoProviderError, _super); + function NoProviderError(injector, key) { + _super.call(this, injector, key, function(keys) { + var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); + return "No provider for " + first + "!" + constructResolvingPath(keys); + }); + } + return NoProviderError; + })(AbstractProviderError); + exports.NoProviderError = NoProviderError; + var CyclicDependencyError = (function(_super) { + __extends(CyclicDependencyError, _super); + function CyclicDependencyError(injector, key) { + _super.call(this, injector, key, function(keys) { + return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); + }); + } + return CyclicDependencyError; + })(AbstractProviderError); + exports.CyclicDependencyError = CyclicDependencyError; + var InstantiationError = (function(_super) { + __extends(InstantiationError, _super); + function InstantiationError(injector, originalException, originalStack, key) { + _super.call(this, "DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; + } + InstantiationError.prototype.addKey = function(injector, key) { + this.injectors.push(injector); + this.keys.push(key); + }; + Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { + get: function() { + var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); + return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "causeKey", { + get: function() { + return this.keys[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(InstantiationError.prototype, "context", { + get: function() { + return this.injectors[this.injectors.length - 1].debugContext(); + }, + enumerable: true, + configurable: true + }); + return InstantiationError; + })(exceptions_1.WrappedException); + exports.InstantiationError = InstantiationError; + var InvalidProviderError = (function(_super) { + __extends(InvalidProviderError, _super); + function InvalidProviderError(provider) { + _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); + } + return InvalidProviderError; + })(exceptions_1.BaseException); + exports.InvalidProviderError = InvalidProviderError; + var NoAnnotationError = (function(_super) { + __extends(NoAnnotationError, _super); + function NoAnnotationError(typeOrFunc, params) { + _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); + } + NoAnnotationError._genMessage = function(typeOrFunc, params) { + var signature = []; + for (var i = 0, + ii = params.length; i < ii; i++) { + var parameter = params[i]; + if (lang_1.isBlank(parameter) || parameter.length == 0) { + signature.push('?'); + } else { + signature.push(parameter.map(lang_1.stringify).join(' ')); + } + } + return "Cannot resolve all parameters for " + lang_1.stringify(typeOrFunc) + "(" + signature.join(', ') + "). " + 'Make sure they all have valid type or annotations.'; + }; + return NoAnnotationError; + })(exceptions_1.BaseException); + exports.NoAnnotationError = NoAnnotationError; + var OutOfBoundsError = (function(_super) { + __extends(OutOfBoundsError, _super); + function OutOfBoundsError(index) { + _super.call(this, "Index " + index + " is out-of-bounds."); + } + return OutOfBoundsError; + })(exceptions_1.BaseException); + exports.OutOfBoundsError = OutOfBoundsError; + var MixingMultiProvidersWithRegularProvidersError = (function(_super) { + __extends(MixingMultiProvidersWithRegularProvidersError, _super); + function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { + _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); + } + return MixingMultiProvidersWithRegularProvidersError; + })(exceptions_1.BaseException); + exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var OpaqueToken = (function() { + function OpaqueToken(_desc) { + this._desc = _desc; + } + OpaqueToken.prototype.toString = function() { + return "Token " + this._desc; + }; + OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); + return OpaqueToken; + })(); + exports.OpaqueToken = OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var IterableDiffers = (function() { + function IterableDiffers(factories) { + this.factories = factories; + } + IterableDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new IterableDiffers(factories); + } else { + return new IterableDiffers(factories); + } + }; + IterableDiffers.extend = function(factories) { + return new di_1.Provider(IterableDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); + } + return IterableDiffers.create(factories, parent); + }, + deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + IterableDiffers.prototype.find = function(iterable) { + var factory = this.factories.find(function(f) { + return f.supports(iterable); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "'"); + } + }; + IterableDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); + return IterableDiffers; + })(); + exports.IterableDiffers = IterableDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_2 = require("angular2/src/facade/lang"); + var DefaultIterableDifferFactory = (function() { + function DefaultIterableDifferFactory() {} + DefaultIterableDifferFactory.prototype.supports = function(obj) { + return collection_1.isListLikeIterable(obj); + }; + DefaultIterableDifferFactory.prototype.create = function(cdRef) { + return new DefaultIterableDiffer(); + }; + DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); + return DefaultIterableDifferFactory; + })(); + exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; + var DefaultIterableDiffer = (function() { + function DefaultIterableDiffer() { + this._collection = null; + this._length = null; + this._linkedRecords = null; + this._unlinkedRecords = null; + this._previousItHead = null; + this._itHead = null; + this._itTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._movesHead = null; + this._movesTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { + get: function() { + return this._collection; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DefaultIterableDiffer.prototype, "length", { + get: function() { + return this._length; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._itHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { + var record; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultIterableDiffer.prototype.diff = function(collection) { + if (lang_2.isBlank(collection)) + collection = []; + if (!collection_1.isListLikeIterable(collection)) { + throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); + } + if (this.check(collection)) { + return this; + } else { + return null; + } + }; + DefaultIterableDiffer.prototype.onDestroy = function() {}; + DefaultIterableDiffer.prototype.check = function(collection) { + var _this = this; + this._reset(); + var record = this._itHead; + var mayBeDirty = false; + var index; + var item; + if (lang_2.isArray(collection)) { + var list = collection; + this._length = collection.length; + for (index = 0; index < this._length; index++) { + item = list[index]; + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = this._verifyReinsertion(record, item, index); + } + record = record._next; + } + } else { + index = 0; + collection_1.iterateListLike(collection, function(item) { + if (record === null || !lang_2.looseIdentical(record.item, item)) { + record = _this._mismatch(record, item, index); + mayBeDirty = true; + } else if (mayBeDirty) { + record = _this._verifyReinsertion(record, item, index); + } + record = record._next; + index++; + }); + this._length = index; + } + this._truncate(record); + this._collection = collection; + return this.isDirty; + }; + Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultIterableDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + var nextRecord; + for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + record.previousIndex = record.currentIndex; + } + this._additionsHead = this._additionsTail = null; + for (record = this._movesHead; record !== null; record = nextRecord) { + record.previousIndex = record.currentIndex; + nextRecord = record._nextMoved; + } + this._movesHead = this._movesTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultIterableDiffer.prototype._mismatch = function(record, item, index) { + var previousRecord; + if (record === null) { + previousRecord = this._itTail; + } else { + previousRecord = record._prev; + this._remove(record); + } + record = this._linkedRecords === null ? null : this._linkedRecords.get(item, index); + if (record !== null) { + this._moveAfter(record, previousRecord, index); + } else { + record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (record !== null) { + this._reinsertAfter(record, previousRecord, index); + } else { + record = this._addAfter(new CollectionChangeRecord(item), previousRecord, index); + } + } + return record; + }; + DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, index) { + var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(item); + if (reinsertRecord !== null) { + record = this._reinsertAfter(reinsertRecord, record._prev, index); + } else if (record.currentIndex != index) { + record.currentIndex = index; + this._addToMoves(record, index); + } + return record; + }; + DefaultIterableDiffer.prototype._truncate = function(record) { + while (record !== null) { + var nextRecord = record._next; + this._addToRemovals(this._unlink(record)); + record = nextRecord; + } + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.clear(); + } + if (this._additionsTail !== null) { + this._additionsTail._nextAdded = null; + } + if (this._movesTail !== null) { + this._movesTail._nextMoved = null; + } + if (this._itTail !== null) { + this._itTail._next = null; + } + if (this._removalsTail !== null) { + this._removalsTail._nextRemoved = null; + } + }; + DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { + if (this._unlinkedRecords !== null) { + this._unlinkedRecords.remove(record); + } + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { + this._unlink(record); + this._insertAfter(record, prevRecord, index); + this._addToMoves(record, index); + return record; + }; + DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { + this._insertAfter(record, prevRecord, index); + if (this._additionsTail === null) { + this._additionsTail = this._additionsHead = record; + } else { + this._additionsTail = this._additionsTail._nextAdded = record; + } + return record; + }; + DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { + var next = prevRecord === null ? this._itHead : prevRecord._next; + record._next = next; + record._prev = prevRecord; + if (next === null) { + this._itTail = record; + } else { + next._prev = record; + } + if (prevRecord === null) { + this._itHead = record; + } else { + prevRecord._next = record; + } + if (this._linkedRecords === null) { + this._linkedRecords = new _DuplicateMap(); + } + this._linkedRecords.put(record); + record.currentIndex = index; + return record; + }; + DefaultIterableDiffer.prototype._remove = function(record) { + return this._addToRemovals(this._unlink(record)); + }; + DefaultIterableDiffer.prototype._unlink = function(record) { + if (this._linkedRecords !== null) { + this._linkedRecords.remove(record); + } + var prev = record._prev; + var next = record._next; + if (prev === null) { + this._itHead = next; + } else { + prev._next = next; + } + if (next === null) { + this._itTail = prev; + } else { + next._prev = prev; + } + return record; + }; + DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { + if (record.previousIndex === toIndex) { + return record; + } + if (this._movesTail === null) { + this._movesTail = this._movesHead = record; + } else { + this._movesTail = this._movesTail._nextMoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype._addToRemovals = function(record) { + if (this._unlinkedRecords === null) { + this._unlinkedRecords = new _DuplicateMap(); + } + this._unlinkedRecords.put(record); + record.currentIndex = null; + record._nextRemoved = null; + if (this._removalsTail === null) { + this._removalsTail = this._removalsHead = record; + record._prevRemoved = null; + } else { + record._prevRemoved = this._removalsTail; + this._removalsTail = this._removalsTail._nextRemoved = record; + } + return record; + }; + DefaultIterableDiffer.prototype.toString = function() { + var record; + var list = []; + for (record = this._itHead; record !== null; record = record._next) { + list.push(record); + } + var previous = []; + for (record = this._previousItHead; record !== null; record = record._nextPrevious) { + previous.push(record); + } + var additions = []; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(record); + } + var moves = []; + for (record = this._movesHead; record !== null; record = record._nextMoved) { + moves.push(record); + } + var removals = []; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(record); + } + return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + return DefaultIterableDiffer; + })(); + exports.DefaultIterableDiffer = DefaultIterableDiffer; + var CollectionChangeRecord = (function() { + function CollectionChangeRecord(item) { + this.item = item; + this.currentIndex = null; + this.previousIndex = null; + this._nextPrevious = null; + this._prev = null; + this._next = null; + this._prevDup = null; + this._nextDup = null; + this._prevRemoved = null; + this._nextRemoved = null; + this._nextAdded = null; + this._nextMoved = null; + } + CollectionChangeRecord.prototype.toString = function() { + return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; + }; + return CollectionChangeRecord; + })(); + exports.CollectionChangeRecord = CollectionChangeRecord; + var _DuplicateItemRecordList = (function() { + function _DuplicateItemRecordList() { + this._head = null; + this._tail = null; + } + _DuplicateItemRecordList.prototype.add = function(record) { + if (this._head === null) { + this._head = this._tail = record; + record._nextDup = null; + record._prevDup = null; + } else { + this._tail._nextDup = record; + record._prevDup = this._tail; + record._nextDup = null; + this._tail = record; + } + }; + _DuplicateItemRecordList.prototype.get = function(item, afterIndex) { + var record; + for (record = this._head; record !== null; record = record._nextDup) { + if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.item, item)) { + return record; + } + } + return null; + }; + _DuplicateItemRecordList.prototype.remove = function(record) { + var prev = record._prevDup; + var next = record._nextDup; + if (prev === null) { + this._head = next; + } else { + prev._nextDup = next; + } + if (next === null) { + this._tail = prev; + } else { + next._prevDup = prev; + } + return this._head === null; + }; + return _DuplicateItemRecordList; + })(); + var _DuplicateMap = (function() { + function _DuplicateMap() { + this.map = new Map(); + } + _DuplicateMap.prototype.put = function(record) { + var key = lang_2.getMapKey(record.item); + var duplicates = this.map.get(key); + if (!lang_2.isPresent(duplicates)) { + duplicates = new _DuplicateItemRecordList(); + this.map.set(key, duplicates); + } + duplicates.add(record); + }; + _DuplicateMap.prototype.get = function(value, afterIndex) { + if (afterIndex === void 0) { + afterIndex = null; + } + var key = lang_2.getMapKey(value); + var recordList = this.map.get(key); + return lang_2.isBlank(recordList) ? null : recordList.get(value, afterIndex); + }; + _DuplicateMap.prototype.remove = function(record) { + var key = lang_2.getMapKey(record.item); + var recordList = this.map.get(key); + if (recordList.remove(record)) { + this.map.delete(key); + } + return record; + }; + Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { + get: function() { + return this.map.size === 0; + }, + enumerable: true, + configurable: true + }); + _DuplicateMap.prototype.clear = function() { + this.map.clear(); + }; + _DuplicateMap.prototype.toString = function() { + return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; + }; + return _DuplicateMap; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var KeyValueDiffers = (function() { + function KeyValueDiffers(factories) { + this.factories = factories; + } + KeyValueDiffers.create = function(factories, parent) { + if (lang_1.isPresent(parent)) { + var copied = collection_1.ListWrapper.clone(parent.factories); + factories = factories.concat(copied); + return new KeyValueDiffers(factories); + } else { + return new KeyValueDiffers(factories); + } + }; + KeyValueDiffers.extend = function(factories) { + return new di_1.Provider(KeyValueDiffers, { + useFactory: function(parent) { + if (lang_1.isBlank(parent)) { + throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); + } + return KeyValueDiffers.create(factories, parent); + }, + deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] + }); + }; + KeyValueDiffers.prototype.find = function(kv) { + var factory = this.factories.find(function(f) { + return f.supports(kv); + }); + if (lang_1.isPresent(factory)) { + return factory; + } else { + throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); + } + }; + KeyValueDiffers = __decorate([di_1.Injectable(), lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); + return KeyValueDiffers; + })(); + exports.KeyValueDiffers = KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var DefaultKeyValueDifferFactory = (function() { + function DefaultKeyValueDifferFactory() {} + DefaultKeyValueDifferFactory.prototype.supports = function(obj) { + return obj instanceof Map || lang_1.isJsObject(obj); + }; + DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { + return new DefaultKeyValueDiffer(); + }; + DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); + return DefaultKeyValueDifferFactory; + })(); + exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; + var DefaultKeyValueDiffer = (function() { + function DefaultKeyValueDiffer() { + this._records = new Map(); + this._mapHead = null; + this._previousMapHead = null; + this._changesHead = null; + this._changesTail = null; + this._additionsHead = null; + this._additionsTail = null; + this._removalsHead = null; + this._removalsTail = null; + } + Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { + get: function() { + return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; + }, + enumerable: true, + configurable: true + }); + DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { + var record; + for (record = this._mapHead; record !== null; record = record._next) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { + var record; + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { + var record; + for (record = this._changesHead; record !== null; record = record._nextChanged) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { + var record; + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { + var record; + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + fn(record); + } + }; + DefaultKeyValueDiffer.prototype.diff = function(map) { + if (lang_1.isBlank(map)) + map = collection_1.MapWrapper.createFromPairs([]); + if (!(map instanceof Map || lang_1.isJsObject(map))) { + throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); + } + if (this.check(map)) { + return this; + } else { + return null; + } + }; + DefaultKeyValueDiffer.prototype.onDestroy = function() {}; + DefaultKeyValueDiffer.prototype.check = function(map) { + var _this = this; + this._reset(); + var records = this._records; + var oldSeqRecord = this._mapHead; + var lastOldSeqRecord = null; + var lastNewSeqRecord = null; + var seqChanged = false; + this._forEach(map, function(value, key) { + var newSeqRecord; + if (oldSeqRecord !== null && key === oldSeqRecord.key) { + newSeqRecord = oldSeqRecord; + if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { + oldSeqRecord.previousValue = oldSeqRecord.currentValue; + oldSeqRecord.currentValue = value; + _this._addToChanges(oldSeqRecord); + } + } else { + seqChanged = true; + if (oldSeqRecord !== null) { + oldSeqRecord._next = null; + _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); + _this._addToRemovals(oldSeqRecord); + } + if (records.has(key)) { + newSeqRecord = records.get(key); + } else { + newSeqRecord = new KVChangeRecord(key); + records.set(key, newSeqRecord); + newSeqRecord.currentValue = value; + _this._addToAdditions(newSeqRecord); + } + } + if (seqChanged) { + if (_this._isInRemovals(newSeqRecord)) { + _this._removeFromRemovals(newSeqRecord); + } + if (lastNewSeqRecord == null) { + _this._mapHead = newSeqRecord; + } else { + lastNewSeqRecord._next = newSeqRecord; + } + } + lastOldSeqRecord = oldSeqRecord; + lastNewSeqRecord = newSeqRecord; + oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; + }); + this._truncate(lastOldSeqRecord, oldSeqRecord); + return this.isDirty; + }; + DefaultKeyValueDiffer.prototype._reset = function() { + if (this.isDirty) { + var record; + for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { + record._nextPrevious = record._next; + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + record.previousValue = record.currentValue; + } + for (record = this._additionsHead; record != null; record = record._nextAdded) { + record.previousValue = record.currentValue; + } + this._changesHead = this._changesTail = null; + this._additionsHead = this._additionsTail = null; + this._removalsHead = this._removalsTail = null; + } + }; + DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { + while (record !== null) { + if (lastRecord === null) { + this._mapHead = null; + } else { + lastRecord._next = null; + } + var nextRecord = record._next; + this._addToRemovals(record); + lastRecord = record; + record = nextRecord; + } + for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { + rec.previousValue = rec.currentValue; + rec.currentValue = null; + this._records.delete(rec.key); + } + }; + DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { + return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; + }; + DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { + if (this._removalsHead === null) { + this._removalsHead = this._removalsTail = record; + } else { + this._removalsTail._nextRemoved = record; + record._prevRemoved = this._removalsTail; + this._removalsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { + var next = record._next; + if (prev === null) { + this._mapHead = next; + } else { + prev._next = next; + } + }; + DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { + var prev = record._prevRemoved; + var next = record._nextRemoved; + if (prev === null) { + this._removalsHead = next; + } else { + prev._nextRemoved = next; + } + if (next === null) { + this._removalsTail = prev; + } else { + next._prevRemoved = prev; + } + record._prevRemoved = record._nextRemoved = null; + }; + DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { + if (this._additionsHead === null) { + this._additionsHead = this._additionsTail = record; + } else { + this._additionsTail._nextAdded = record; + this._additionsTail = record; + } + }; + DefaultKeyValueDiffer.prototype._addToChanges = function(record) { + if (this._changesHead === null) { + this._changesHead = this._changesTail = record; + } else { + this._changesTail._nextChanged = record; + this._changesTail = record; + } + }; + DefaultKeyValueDiffer.prototype.toString = function() { + var items = []; + var previous = []; + var changes = []; + var additions = []; + var removals = []; + var record; + for (record = this._mapHead; record !== null; record = record._next) { + items.push(lang_1.stringify(record)); + } + for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { + previous.push(lang_1.stringify(record)); + } + for (record = this._changesHead; record !== null; record = record._nextChanged) { + changes.push(lang_1.stringify(record)); + } + for (record = this._additionsHead; record !== null; record = record._nextAdded) { + additions.push(lang_1.stringify(record)); + } + for (record = this._removalsHead; record !== null; record = record._nextRemoved) { + removals.push(lang_1.stringify(record)); + } + return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; + }; + DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { + if (obj instanceof Map) { + obj.forEach(fn); + } else { + collection_1.StringMapWrapper.forEach(obj, fn); + } + }; + return DefaultKeyValueDiffer; + })(); + exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; + var KVChangeRecord = (function() { + function KVChangeRecord(key) { + this.key = key; + this.previousValue = null; + this.currentValue = null; + this._nextPrevious = null; + this._next = null; + this._nextAdded = null; + this._nextRemoved = null; + this._prevRemoved = null; + this._nextChanged = null; + } + KVChangeRecord.prototype.toString = function() { + return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); + }; + return KVChangeRecord; + })(); + exports.KVChangeRecord = KVChangeRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var AST = (function() { + function AST() {} + AST.prototype.visit = function(visitor) { + return null; + }; + AST.prototype.toString = function() { + return "AST"; + }; + return AST; + })(); + exports.AST = AST; + var EmptyExpr = (function(_super) { + __extends(EmptyExpr, _super); + function EmptyExpr() { + _super.apply(this, arguments); + } + EmptyExpr.prototype.visit = function(visitor) {}; + return EmptyExpr; + })(AST); + exports.EmptyExpr = EmptyExpr; + var ImplicitReceiver = (function(_super) { + __extends(ImplicitReceiver, _super); + function ImplicitReceiver() { + _super.apply(this, arguments); + } + ImplicitReceiver.prototype.visit = function(visitor) { + return visitor.visitImplicitReceiver(this); + }; + return ImplicitReceiver; + })(AST); + exports.ImplicitReceiver = ImplicitReceiver; + var Chain = (function(_super) { + __extends(Chain, _super); + function Chain(expressions) { + _super.call(this); + this.expressions = expressions; + } + Chain.prototype.visit = function(visitor) { + return visitor.visitChain(this); + }; + return Chain; + })(AST); + exports.Chain = Chain; + var Conditional = (function(_super) { + __extends(Conditional, _super); + function Conditional(condition, trueExp, falseExp) { + _super.call(this); + this.condition = condition; + this.trueExp = trueExp; + this.falseExp = falseExp; + } + Conditional.prototype.visit = function(visitor) { + return visitor.visitConditional(this); + }; + return Conditional; + })(AST); + exports.Conditional = Conditional; + var PropertyRead = (function(_super) { + __extends(PropertyRead, _super); + function PropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + PropertyRead.prototype.visit = function(visitor) { + return visitor.visitPropertyRead(this); + }; + return PropertyRead; + })(AST); + exports.PropertyRead = PropertyRead; + var PropertyWrite = (function(_super) { + __extends(PropertyWrite, _super); + function PropertyWrite(receiver, name, setter, value) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.setter = setter; + this.value = value; + } + PropertyWrite.prototype.visit = function(visitor) { + return visitor.visitPropertyWrite(this); + }; + return PropertyWrite; + })(AST); + exports.PropertyWrite = PropertyWrite; + var SafePropertyRead = (function(_super) { + __extends(SafePropertyRead, _super); + function SafePropertyRead(receiver, name, getter) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.getter = getter; + } + SafePropertyRead.prototype.visit = function(visitor) { + return visitor.visitSafePropertyRead(this); + }; + return SafePropertyRead; + })(AST); + exports.SafePropertyRead = SafePropertyRead; + var KeyedRead = (function(_super) { + __extends(KeyedRead, _super); + function KeyedRead(obj, key) { + _super.call(this); + this.obj = obj; + this.key = key; + } + KeyedRead.prototype.visit = function(visitor) { + return visitor.visitKeyedRead(this); + }; + return KeyedRead; + })(AST); + exports.KeyedRead = KeyedRead; + var KeyedWrite = (function(_super) { + __extends(KeyedWrite, _super); + function KeyedWrite(obj, key, value) { + _super.call(this); + this.obj = obj; + this.key = key; + this.value = value; + } + KeyedWrite.prototype.visit = function(visitor) { + return visitor.visitKeyedWrite(this); + }; + return KeyedWrite; + })(AST); + exports.KeyedWrite = KeyedWrite; + var BindingPipe = (function(_super) { + __extends(BindingPipe, _super); + function BindingPipe(exp, name, args) { + _super.call(this); + this.exp = exp; + this.name = name; + this.args = args; + } + BindingPipe.prototype.visit = function(visitor) { + return visitor.visitPipe(this); + }; + return BindingPipe; + })(AST); + exports.BindingPipe = BindingPipe; + var LiteralPrimitive = (function(_super) { + __extends(LiteralPrimitive, _super); + function LiteralPrimitive(value) { + _super.call(this); + this.value = value; + } + LiteralPrimitive.prototype.visit = function(visitor) { + return visitor.visitLiteralPrimitive(this); + }; + return LiteralPrimitive; + })(AST); + exports.LiteralPrimitive = LiteralPrimitive; + var LiteralArray = (function(_super) { + __extends(LiteralArray, _super); + function LiteralArray(expressions) { + _super.call(this); + this.expressions = expressions; + } + LiteralArray.prototype.visit = function(visitor) { + return visitor.visitLiteralArray(this); + }; + return LiteralArray; + })(AST); + exports.LiteralArray = LiteralArray; + var LiteralMap = (function(_super) { + __extends(LiteralMap, _super); + function LiteralMap(keys, values) { + _super.call(this); + this.keys = keys; + this.values = values; + } + LiteralMap.prototype.visit = function(visitor) { + return visitor.visitLiteralMap(this); + }; + return LiteralMap; + })(AST); + exports.LiteralMap = LiteralMap; + var Interpolation = (function(_super) { + __extends(Interpolation, _super); + function Interpolation(strings, expressions) { + _super.call(this); + this.strings = strings; + this.expressions = expressions; + } + Interpolation.prototype.visit = function(visitor) { + visitor.visitInterpolation(this); + }; + return Interpolation; + })(AST); + exports.Interpolation = Interpolation; + var Binary = (function(_super) { + __extends(Binary, _super); + function Binary(operation, left, right) { + _super.call(this); + this.operation = operation; + this.left = left; + this.right = right; + } + Binary.prototype.visit = function(visitor) { + return visitor.visitBinary(this); + }; + return Binary; + })(AST); + exports.Binary = Binary; + var PrefixNot = (function(_super) { + __extends(PrefixNot, _super); + function PrefixNot(expression) { + _super.call(this); + this.expression = expression; + } + PrefixNot.prototype.visit = function(visitor) { + return visitor.visitPrefixNot(this); + }; + return PrefixNot; + })(AST); + exports.PrefixNot = PrefixNot; + var MethodCall = (function(_super) { + __extends(MethodCall, _super); + function MethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + MethodCall.prototype.visit = function(visitor) { + return visitor.visitMethodCall(this); + }; + return MethodCall; + })(AST); + exports.MethodCall = MethodCall; + var SafeMethodCall = (function(_super) { + __extends(SafeMethodCall, _super); + function SafeMethodCall(receiver, name, fn, args) { + _super.call(this); + this.receiver = receiver; + this.name = name; + this.fn = fn; + this.args = args; + } + SafeMethodCall.prototype.visit = function(visitor) { + return visitor.visitSafeMethodCall(this); + }; + return SafeMethodCall; + })(AST); + exports.SafeMethodCall = SafeMethodCall; + var FunctionCall = (function(_super) { + __extends(FunctionCall, _super); + function FunctionCall(target, args) { + _super.call(this); + this.target = target; + this.args = args; + } + FunctionCall.prototype.visit = function(visitor) { + return visitor.visitFunctionCall(this); + }; + return FunctionCall; + })(AST); + exports.FunctionCall = FunctionCall; + var ASTWithSource = (function(_super) { + __extends(ASTWithSource, _super); + function ASTWithSource(ast, source, location) { + _super.call(this); + this.ast = ast; + this.source = source; + this.location = location; + } + ASTWithSource.prototype.visit = function(visitor) { + return this.ast.visit(visitor); + }; + ASTWithSource.prototype.toString = function() { + return this.source + " in " + this.location; + }; + return ASTWithSource; + })(AST); + exports.ASTWithSource = ASTWithSource; + var TemplateBinding = (function() { + function TemplateBinding(key, keyIsVar, name, expression) { + this.key = key; + this.keyIsVar = keyIsVar; + this.name = name; + this.expression = expression; + } + return TemplateBinding; + })(); + exports.TemplateBinding = TemplateBinding; + var RecursiveAstVisitor = (function() { + function RecursiveAstVisitor() {} + RecursiveAstVisitor.prototype.visitBinary = function(ast) { + ast.left.visit(this); + ast.right.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitChain = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitConditional = function(ast) { + ast.condition.visit(this); + ast.trueExp.visit(this); + ast.falseExp.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPipe = function(ast) { + ast.exp.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { + ast.target.visit(this); + this.visitAll(ast.args); + return null; + }; + RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { + ast.obj.visit(this); + ast.key.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { + return this.visitAll(ast.expressions); + }; + RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { + return this.visitAll(ast.values); + }; + RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { + return null; + }; + RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { + ast.expression.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { + ast.receiver.visit(this); + ast.value.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { + ast.receiver.visit(this); + return null; + }; + RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { + ast.receiver.visit(this); + return this.visitAll(ast.args); + }; + RecursiveAstVisitor.prototype.visitAll = function(asts) { + var _this = this; + asts.forEach(function(ast) { + return ast.visit(_this); + }); + return null; + }; + return RecursiveAstVisitor; + })(); + exports.RecursiveAstVisitor = RecursiveAstVisitor; + var AstTransformer = (function() { + function AstTransformer() {} + AstTransformer.prototype.visitImplicitReceiver = function(ast) { + return ast; + }; + AstTransformer.prototype.visitInterpolation = function(ast) { + return new Interpolation(ast.strings, this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralPrimitive = function(ast) { + return new LiteralPrimitive(ast.value); + }; + AstTransformer.prototype.visitPropertyRead = function(ast) { + return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitPropertyWrite = function(ast) { + return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); + }; + AstTransformer.prototype.visitSafePropertyRead = function(ast) { + return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); + }; + AstTransformer.prototype.visitMethodCall = function(ast) { + return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitSafeMethodCall = function(ast) { + return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitFunctionCall = function(ast) { + return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitLiteralArray = function(ast) { + return new LiteralArray(this.visitAll(ast.expressions)); + }; + AstTransformer.prototype.visitLiteralMap = function(ast) { + return new LiteralMap(ast.keys, this.visitAll(ast.values)); + }; + AstTransformer.prototype.visitBinary = function(ast) { + return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); + }; + AstTransformer.prototype.visitPrefixNot = function(ast) { + return new PrefixNot(ast.expression.visit(this)); + }; + AstTransformer.prototype.visitConditional = function(ast) { + return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); + }; + AstTransformer.prototype.visitPipe = function(ast) { + return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); + }; + AstTransformer.prototype.visitKeyedRead = function(ast) { + return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); + }; + AstTransformer.prototype.visitKeyedWrite = function(ast) { + return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); + }; + AstTransformer.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + AstTransformer.prototype.visitChain = function(ast) { + return new Chain(this.visitAll(ast.expressions)); + }; + return AstTransformer; + })(); + exports.AstTransformer = AstTransformer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + (function(TokenType) { + TokenType[TokenType["Character"] = 0] = "Character"; + TokenType[TokenType["Identifier"] = 1] = "Identifier"; + TokenType[TokenType["Keyword"] = 2] = "Keyword"; + TokenType[TokenType["String"] = 3] = "String"; + TokenType[TokenType["Operator"] = 4] = "Operator"; + TokenType[TokenType["Number"] = 5] = "Number"; + })(exports.TokenType || (exports.TokenType = {})); + var TokenType = exports.TokenType; + var Lexer = (function() { + function Lexer() {} + Lexer.prototype.tokenize = function(text) { + var scanner = new _Scanner(text); + var tokens = []; + var token = scanner.scanToken(); + while (token != null) { + tokens.push(token); + token = scanner.scanToken(); + } + return tokens; + }; + Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); + return Lexer; + })(); + exports.Lexer = Lexer; + var Token = (function() { + function Token(index, type, numValue, strValue) { + this.index = index; + this.type = type; + this.numValue = numValue; + this.strValue = strValue; + } + Token.prototype.isCharacter = function(code) { + return (this.type == TokenType.Character && this.numValue == code); + }; + Token.prototype.isNumber = function() { + return (this.type == TokenType.Number); + }; + Token.prototype.isString = function() { + return (this.type == TokenType.String); + }; + Token.prototype.isOperator = function(operater) { + return (this.type == TokenType.Operator && this.strValue == operater); + }; + Token.prototype.isIdentifier = function() { + return (this.type == TokenType.Identifier); + }; + Token.prototype.isKeyword = function() { + return (this.type == TokenType.Keyword); + }; + Token.prototype.isKeywordVar = function() { + return (this.type == TokenType.Keyword && this.strValue == "var"); + }; + Token.prototype.isKeywordNull = function() { + return (this.type == TokenType.Keyword && this.strValue == "null"); + }; + Token.prototype.isKeywordUndefined = function() { + return (this.type == TokenType.Keyword && this.strValue == "undefined"); + }; + Token.prototype.isKeywordTrue = function() { + return (this.type == TokenType.Keyword && this.strValue == "true"); + }; + Token.prototype.isKeywordFalse = function() { + return (this.type == TokenType.Keyword && this.strValue == "false"); + }; + Token.prototype.toNumber = function() { + return (this.type == TokenType.Number) ? this.numValue : -1; + }; + Token.prototype.toString = function() { + switch (this.type) { + case TokenType.Character: + case TokenType.Identifier: + case TokenType.Keyword: + case TokenType.Operator: + case TokenType.String: + return this.strValue; + case TokenType.Number: + return this.numValue.toString(); + default: + return null; + } + }; + return Token; + })(); + exports.Token = Token; + function newCharacterToken(index, code) { + return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); + } + function newIdentifierToken(index, text) { + return new Token(index, TokenType.Identifier, 0, text); + } + function newKeywordToken(index, text) { + return new Token(index, TokenType.Keyword, 0, text); + } + function newOperatorToken(index, text) { + return new Token(index, TokenType.Operator, 0, text); + } + function newStringToken(index, text) { + return new Token(index, TokenType.String, 0, text); + } + function newNumberToken(index, n) { + return new Token(index, TokenType.Number, n, ""); + } + exports.EOF = new Token(-1, TokenType.Character, 0, ""); + exports.$EOF = 0; + exports.$TAB = 9; + exports.$LF = 10; + exports.$VTAB = 11; + exports.$FF = 12; + exports.$CR = 13; + exports.$SPACE = 32; + exports.$BANG = 33; + exports.$DQ = 34; + exports.$HASH = 35; + exports.$$ = 36; + exports.$PERCENT = 37; + exports.$AMPERSAND = 38; + exports.$SQ = 39; + exports.$LPAREN = 40; + exports.$RPAREN = 41; + exports.$STAR = 42; + exports.$PLUS = 43; + exports.$COMMA = 44; + exports.$MINUS = 45; + exports.$PERIOD = 46; + exports.$SLASH = 47; + exports.$COLON = 58; + exports.$SEMICOLON = 59; + exports.$LT = 60; + exports.$EQ = 61; + exports.$GT = 62; + exports.$QUESTION = 63; + var $0 = 48; + var $9 = 57; + var $A = 65, + $E = 69, + $Z = 90; + exports.$LBRACKET = 91; + exports.$BACKSLASH = 92; + exports.$RBRACKET = 93; + var $CARET = 94; + var $_ = 95; + var $a = 97, + $e = 101, + $f = 102, + $n = 110, + $r = 114, + $t = 116, + $u = 117, + $v = 118, + $z = 122; + exports.$LBRACE = 123; + exports.$BAR = 124; + exports.$RBRACE = 125; + var $NBSP = 160; + var ScannerError = (function(_super) { + __extends(ScannerError, _super); + function ScannerError(message) { + _super.call(this); + this.message = message; + } + ScannerError.prototype.toString = function() { + return this.message; + }; + return ScannerError; + })(exceptions_1.BaseException); + exports.ScannerError = ScannerError; + var _Scanner = (function() { + function _Scanner(input) { + this.input = input; + this.peek = 0; + this.index = -1; + this.length = input.length; + this.advance(); + } + _Scanner.prototype.advance = function() { + this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); + }; + _Scanner.prototype.scanToken = function() { + var input = this.input, + length = this.length, + peek = this.peek, + index = this.index; + while (peek <= exports.$SPACE) { + if (++index >= length) { + peek = exports.$EOF; + break; + } else { + peek = lang_1.StringWrapper.charCodeAt(input, index); + } + } + this.peek = peek; + this.index = index; + if (index >= length) { + return null; + } + if (isIdentifierStart(peek)) + return this.scanIdentifier(); + if (isDigit(peek)) + return this.scanNumber(index); + var start = index; + switch (peek) { + case exports.$PERIOD: + this.advance(); + return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); + case exports.$LPAREN: + case exports.$RPAREN: + case exports.$LBRACE: + case exports.$RBRACE: + case exports.$LBRACKET: + case exports.$RBRACKET: + case exports.$COMMA: + case exports.$COLON: + case exports.$SEMICOLON: + return this.scanCharacter(start, peek); + case exports.$SQ: + case exports.$DQ: + return this.scanString(); + case exports.$HASH: + case exports.$PLUS: + case exports.$MINUS: + case exports.$STAR: + case exports.$SLASH: + case exports.$PERCENT: + case $CARET: + return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); + case exports.$QUESTION: + return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); + case exports.$LT: + case exports.$GT: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); + case exports.$BANG: + case exports.$EQ: + return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); + case exports.$AMPERSAND: + return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); + case exports.$BAR: + return this.scanComplexOperator(start, '|', exports.$BAR, '|'); + case $NBSP: + while (isWhitespace(this.peek)) + this.advance(); + return this.scanToken(); + } + this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); + return null; + }; + _Scanner.prototype.scanCharacter = function(start, code) { + assert(this.peek == code); + this.advance(); + return newCharacterToken(start, code); + }; + _Scanner.prototype.scanOperator = function(start, str) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(str, 0)); + assert(collection_1.SetWrapper.has(OPERATORS, str)); + this.advance(); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { + assert(this.peek == lang_1.StringWrapper.charCodeAt(one, 0)); + this.advance(); + var str = one; + if (this.peek == twoCode) { + this.advance(); + str += two; + } + if (lang_1.isPresent(threeCode) && this.peek == threeCode) { + this.advance(); + str += three; + } + assert(collection_1.SetWrapper.has(OPERATORS, str)); + return newOperatorToken(start, str); + }; + _Scanner.prototype.scanIdentifier = function() { + assert(isIdentifierStart(this.peek)); + var start = this.index; + this.advance(); + while (isIdentifierPart(this.peek)) + this.advance(); + var str = this.input.substring(start, this.index); + if (collection_1.SetWrapper.has(KEYWORDS, str)) { + return newKeywordToken(start, str); + } else { + return newIdentifierToken(start, str); + } + }; + _Scanner.prototype.scanNumber = function(start) { + assert(isDigit(this.peek)); + var simple = (this.index === start); + this.advance(); + while (true) { + if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { + simple = false; + } else if (isExponentStart(this.peek)) { + this.advance(); + if (isExponentSign(this.peek)) + this.advance(); + if (!isDigit(this.peek)) + this.error('Invalid exponent', -1); + simple = false; + } else { + break; + } + this.advance(); + } + var str = this.input.substring(start, this.index); + var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); + return newNumberToken(start, value); + }; + _Scanner.prototype.scanString = function() { + assert(this.peek == exports.$SQ || this.peek == exports.$DQ); + var start = this.index; + var quote = this.peek; + this.advance(); + var buffer; + var marker = this.index; + var input = this.input; + while (this.peek != quote) { + if (this.peek == exports.$BACKSLASH) { + if (buffer == null) + buffer = new lang_1.StringJoiner(); + buffer.add(input.substring(marker, this.index)); + this.advance(); + var unescapedCode; + if (this.peek == $u) { + var hex = input.substring(this.index + 1, this.index + 5); + try { + unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); + } catch (e) { + this.error("Invalid unicode escape [\\u" + hex + "]", 0); + } + for (var i = 0; i < 5; i++) { + this.advance(); + } + } else { + unescapedCode = unescape(this.peek); + this.advance(); + } + buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); + marker = this.index; + } else if (this.peek == exports.$EOF) { + this.error('Unterminated quote', 0); + } else { + this.advance(); + } + } + var last = input.substring(marker, this.index); + this.advance(); + var unescaped = last; + if (buffer != null) { + buffer.add(last); + unescaped = buffer.toString(); + } + return newStringToken(start, unescaped); + }; + _Scanner.prototype.error = function(message, offset) { + var position = this.index + offset; + throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); + }; + return _Scanner; + })(); + function isWhitespace(code) { + return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); + } + function isIdentifierStart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); + } + function isIdentifierPart(code) { + return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); + } + function isDigit(code) { + return $0 <= code && code <= $9; + } + function isExponentStart(code) { + return code == $e || code == $E; + } + function isExponentSign(code) { + return code == exports.$MINUS || code == exports.$PLUS; + } + function unescape(code) { + switch (code) { + case $n: + return exports.$LF; + case $f: + return exports.$FF; + case $r: + return exports.$CR; + case $t: + return exports.$TAB; + case $v: + return exports.$VTAB; + default: + return code; + } + } + var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); + var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var decorators_1 = require("angular2/src/core/di/decorators"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var _implicitReceiver = new ast_1.ImplicitReceiver(); + var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; + var ParseException = (function(_super) { + __extends(ParseException, _super); + function ParseException(message, input, errLocation, ctxLocation) { + _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); + } + return ParseException; + })(exceptions_1.BaseException); + var Parser = (function() { + function Parser(_lexer, providedReflector) { + if (providedReflector === void 0) { + providedReflector = null; + } + this._lexer = _lexer; + this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; + } + Parser.prototype.parseAction = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseSimpleBinding = function(input, location) { + this._checkNoInterpolation(input, location); + var tokens = this._lexer.tokenize(input); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseSimpleBinding(); + return new ast_1.ASTWithSource(ast, input, location); + }; + Parser.prototype.parseTemplateBindings = function(input, location) { + var tokens = this._lexer.tokenize(input); + return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); + }; + Parser.prototype.parseInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length <= 1) { + return null; + } + var strings = []; + var expressions = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (i % 2 === 0) { + strings.push(part); + } else if (part.trim().length > 0) { + var tokens = this._lexer.tokenize(part); + var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); + expressions.push(ast); + } else { + throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); + } + } + return new ast_1.ASTWithSource(new ast_1.Interpolation(strings, expressions), input, location); + }; + Parser.prototype.wrapLiteralPrimitive = function(input, location) { + return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); + }; + Parser.prototype._checkNoInterpolation = function(input, location) { + var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); + if (parts.length > 1) { + throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); + } + }; + Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { + var errLocation = ''; + for (var j = 0; j < partInErrIdx; j++) { + errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; + } + return errLocation.length; + }; + Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); + return Parser; + })(); + exports.Parser = Parser; + var _ParseAST = (function() { + function _ParseAST(input, location, tokens, reflector, parseAction) { + this.input = input; + this.location = location; + this.tokens = tokens; + this.reflector = reflector; + this.parseAction = parseAction; + this.index = 0; + } + _ParseAST.prototype.peek = function(offset) { + var i = this.index + offset; + return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; + }; + Object.defineProperty(_ParseAST.prototype, "next", { + get: function() { + return this.peek(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_ParseAST.prototype, "inputIndex", { + get: function() { + return (this.index < this.tokens.length) ? this.next.index : this.input.length; + }, + enumerable: true, + configurable: true + }); + _ParseAST.prototype.advance = function() { + this.index++; + }; + _ParseAST.prototype.optionalCharacter = function(code) { + if (this.next.isCharacter(code)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.optionalKeywordVar = function() { + if (this.peekKeywordVar()) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.peekKeywordVar = function() { + return this.next.isKeywordVar() || this.next.isOperator('#'); + }; + _ParseAST.prototype.expectCharacter = function(code) { + if (this.optionalCharacter(code)) + return ; + this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); + }; + _ParseAST.prototype.optionalOperator = function(op) { + if (this.next.isOperator(op)) { + this.advance(); + return true; + } else { + return false; + } + }; + _ParseAST.prototype.expectOperator = function(operator) { + if (this.optionalOperator(operator)) + return ; + this.error("Missing expected operator " + operator); + }; + _ParseAST.prototype.expectIdentifierOrKeyword = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword()) { + this.error("Unexpected token " + n + ", expected identifier or keyword"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { + var n = this.next; + if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { + this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); + } + this.advance(); + return n.toString(); + }; + _ParseAST.prototype.parseSimpleBinding = function() { + var ast = this.parseChain(); + if (!SimpleExpressionChecker.check(ast)) { + this.error("Simple binding expression can only contain field access and constants'"); + } + return ast; + }; + _ParseAST.prototype.parseChain = function() { + var exprs = []; + while (this.index < this.tokens.length) { + var expr = this.parsePipe(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } else if (this.index < this.tokens.length) { + this.error("Unexpected token '" + this.next + "'"); + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.parsePipe = function() { + var result = this.parseExpression(); + if (this.optionalOperator("|")) { + if (this.parseAction) { + this.error("Cannot have a pipe in an action expression"); + } + do { + var name = this.expectIdentifierOrKeyword(); + var args = []; + while (this.optionalCharacter(lexer_1.$COLON)) { + args.push(this.parseExpression()); + } + result = new ast_1.BindingPipe(result, name, args); + } while (this.optionalOperator("|")); + } + return result; + }; + _ParseAST.prototype.parseExpression = function() { + return this.parseConditional(); + }; + _ParseAST.prototype.parseConditional = function() { + var start = this.inputIndex; + var result = this.parseLogicalOr(); + if (this.optionalOperator('?')) { + var yes = this.parsePipe(); + if (!this.optionalCharacter(lexer_1.$COLON)) { + var end = this.inputIndex; + var expression = this.input.substring(start, end); + this.error("Conditional expression " + expression + " requires all 3 expressions"); + } + var no = this.parsePipe(); + return new ast_1.Conditional(result, yes, no); + } else { + return result; + } + }; + _ParseAST.prototype.parseLogicalOr = function() { + var result = this.parseLogicalAnd(); + while (this.optionalOperator('||')) { + result = new ast_1.Binary('||', result, this.parseLogicalAnd()); + } + return result; + }; + _ParseAST.prototype.parseLogicalAnd = function() { + var result = this.parseEquality(); + while (this.optionalOperator('&&')) { + result = new ast_1.Binary('&&', result, this.parseEquality()); + } + return result; + }; + _ParseAST.prototype.parseEquality = function() { + var result = this.parseRelational(); + while (true) { + if (this.optionalOperator('==')) { + result = new ast_1.Binary('==', result, this.parseRelational()); + } else if (this.optionalOperator('===')) { + result = new ast_1.Binary('===', result, this.parseRelational()); + } else if (this.optionalOperator('!=')) { + result = new ast_1.Binary('!=', result, this.parseRelational()); + } else if (this.optionalOperator('!==')) { + result = new ast_1.Binary('!==', result, this.parseRelational()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseRelational = function() { + var result = this.parseAdditive(); + while (true) { + if (this.optionalOperator('<')) { + result = new ast_1.Binary('<', result, this.parseAdditive()); + } else if (this.optionalOperator('>')) { + result = new ast_1.Binary('>', result, this.parseAdditive()); + } else if (this.optionalOperator('<=')) { + result = new ast_1.Binary('<=', result, this.parseAdditive()); + } else if (this.optionalOperator('>=')) { + result = new ast_1.Binary('>=', result, this.parseAdditive()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseAdditive = function() { + var result = this.parseMultiplicative(); + while (true) { + if (this.optionalOperator('+')) { + result = new ast_1.Binary('+', result, this.parseMultiplicative()); + } else if (this.optionalOperator('-')) { + result = new ast_1.Binary('-', result, this.parseMultiplicative()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parseMultiplicative = function() { + var result = this.parsePrefix(); + while (true) { + if (this.optionalOperator('*')) { + result = new ast_1.Binary('*', result, this.parsePrefix()); + } else if (this.optionalOperator('%')) { + result = new ast_1.Binary('%', result, this.parsePrefix()); + } else if (this.optionalOperator('/')) { + result = new ast_1.Binary('/', result, this.parsePrefix()); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrefix = function() { + if (this.optionalOperator('+')) { + return this.parsePrefix(); + } else if (this.optionalOperator('-')) { + return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); + } else if (this.optionalOperator('!')) { + return new ast_1.PrefixNot(this.parsePrefix()); + } else { + return this.parseCallChain(); + } + }; + _ParseAST.prototype.parseCallChain = function() { + var result = this.parsePrimary(); + while (true) { + if (this.optionalCharacter(lexer_1.$PERIOD)) { + result = this.parseAccessMemberOrMethodCall(result, false); + } else if (this.optionalOperator('?.')) { + result = this.parseAccessMemberOrMethodCall(result, true); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var key = this.parsePipe(); + this.expectCharacter(lexer_1.$RBRACKET); + if (this.optionalOperator("=")) { + var value = this.parseConditional(); + result = new ast_1.KeyedWrite(result, key, value); + } else { + result = new ast_1.KeyedRead(result, key); + } + } else if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + result = new ast_1.FunctionCall(result, args); + } else { + return result; + } + } + }; + _ParseAST.prototype.parsePrimary = function() { + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var result = this.parsePipe(); + this.expectCharacter(lexer_1.$RPAREN); + return result; + } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { + this.advance(); + return new ast_1.LiteralPrimitive(null); + } else if (this.next.isKeywordTrue()) { + this.advance(); + return new ast_1.LiteralPrimitive(true); + } else if (this.next.isKeywordFalse()) { + this.advance(); + return new ast_1.LiteralPrimitive(false); + } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { + var elements = this.parseExpressionList(lexer_1.$RBRACKET); + this.expectCharacter(lexer_1.$RBRACKET); + return new ast_1.LiteralArray(elements); + } else if (this.next.isCharacter(lexer_1.$LBRACE)) { + return this.parseLiteralMap(); + } else if (this.next.isIdentifier()) { + return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); + } else if (this.next.isNumber()) { + var value = this.next.toNumber(); + this.advance(); + return new ast_1.LiteralPrimitive(value); + } else if (this.next.isString()) { + var literalValue = this.next.toString(); + this.advance(); + return new ast_1.LiteralPrimitive(literalValue); + } else if (this.index >= this.tokens.length) { + this.error("Unexpected end of expression: " + this.input); + } else { + this.error("Unexpected token " + this.next); + } + throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); + }; + _ParseAST.prototype.parseExpressionList = function(terminator) { + var result = []; + if (!this.next.isCharacter(terminator)) { + do { + result.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + } + return result; + }; + _ParseAST.prototype.parseLiteralMap = function() { + var keys = []; + var values = []; + this.expectCharacter(lexer_1.$LBRACE); + if (!this.optionalCharacter(lexer_1.$RBRACE)) { + do { + var key = this.expectIdentifierOrKeywordOrString(); + keys.push(key); + this.expectCharacter(lexer_1.$COLON); + values.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + this.expectCharacter(lexer_1.$RBRACE); + } + return new ast_1.LiteralMap(keys, values); + }; + _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { + if (isSafe === void 0) { + isSafe = false; + } + var id = this.expectIdentifierOrKeyword(); + if (this.optionalCharacter(lexer_1.$LPAREN)) { + var args = this.parseCallArguments(); + this.expectCharacter(lexer_1.$RPAREN); + var fn = this.reflector.method(id); + return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); + } else { + if (isSafe) { + if (this.optionalOperator("=")) { + this.error("The '?.' operator cannot be used in the assignment"); + } else { + return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); + } + } else { + if (this.optionalOperator("=")) { + if (!this.parseAction) { + this.error("Bindings cannot contain assignments"); + } + var value = this.parseConditional(); + return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); + } else { + return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); + } + } + } + return null; + }; + _ParseAST.prototype.parseCallArguments = function() { + if (this.next.isCharacter(lexer_1.$RPAREN)) + return []; + var positionals = []; + do { + positionals.push(this.parsePipe()); + } while (this.optionalCharacter(lexer_1.$COMMA)); + return positionals; + }; + _ParseAST.prototype.parseBlockContent = function() { + if (!this.parseAction) { + this.error("Binding expression cannot contain chained expression"); + } + var exprs = []; + while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { + var expr = this.parseExpression(); + exprs.push(expr); + if (this.optionalCharacter(lexer_1.$SEMICOLON)) { + while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} + } + } + if (exprs.length == 0) + return new ast_1.EmptyExpr(); + if (exprs.length == 1) + return exprs[0]; + return new ast_1.Chain(exprs); + }; + _ParseAST.prototype.expectTemplateBindingKey = function() { + var result = ''; + var operatorFound = false; + do { + result += this.expectIdentifierOrKeywordOrString(); + operatorFound = this.optionalOperator('-'); + if (operatorFound) { + result += '-'; + } + } while (operatorFound); + return result.toString(); + }; + _ParseAST.prototype.parseTemplateBindings = function() { + var bindings = []; + var prefix = null; + while (this.index < this.tokens.length) { + var keyIsVar = this.optionalKeywordVar(); + var key = this.expectTemplateBindingKey(); + if (!keyIsVar) { + if (prefix == null) { + prefix = key; + } else { + key = prefix + '-' + key; + } + } + this.optionalCharacter(lexer_1.$COLON); + var name = null; + var expression = null; + if (keyIsVar) { + if (this.optionalOperator("=")) { + name = this.expectTemplateBindingKey(); + } else { + name = '\$implicit'; + } + } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { + var start = this.inputIndex; + var ast = this.parsePipe(); + var source = this.input.substring(start, this.inputIndex); + expression = new ast_1.ASTWithSource(ast, source, this.location); + } + bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); + if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { + this.optionalCharacter(lexer_1.$COMMA); + } + } + return bindings; + }; + _ParseAST.prototype.error = function(message, index) { + if (index === void 0) { + index = null; + } + if (lang_1.isBlank(index)) + index = this.index; + var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; + throw new ParseException(message, this.input, location, this.location); + }; + return _ParseAST; + })(); + exports._ParseAST = _ParseAST; + var SimpleExpressionChecker = (function() { + function SimpleExpressionChecker() { + this.simple = true; + } + SimpleExpressionChecker.check = function(ast) { + var s = new SimpleExpressionChecker(); + ast.visit(s); + return s.simple; + }; + SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; + SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; + SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { + this.visitAll(ast.expressions); + }; + SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { + this.visitAll(ast.values); + }; + SimpleExpressionChecker.prototype.visitBinary = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitConditional = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitPipe = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { + this.simple = false; + }; + SimpleExpressionChecker.prototype.visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + SimpleExpressionChecker.prototype.visitChain = function(ast) { + this.simple = false; + }; + return SimpleExpressionChecker; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var Locals = (function() { + function Locals(parent, current) { + this.parent = parent; + this.current = current; + } + Locals.prototype.contains = function(name) { + if (this.current.has(name)) { + return true; + } + if (lang_1.isPresent(this.parent)) { + return this.parent.contains(name); + } + return false; + }; + Locals.prototype.get = function(name) { + if (this.current.has(name)) { + return this.current.get(name); + } + if (lang_1.isPresent(this.parent)) { + return this.parent.get(name); + } + throw new exceptions_1.BaseException("Cannot find '" + name + "'"); + }; + Locals.prototype.set = function(name, value) { + if (this.current.has(name)) { + this.current.set(name, value); + } else { + throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); + } + }; + Locals.prototype.clearValues = function() { + collection_1.MapWrapper.clearValues(this.current); + }; + return Locals; + })(); + exports.Locals = Locals; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { + __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); + function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { + _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); + } + return ExpressionChangedAfterItHasBeenCheckedException; + })(exceptions_1.BaseException); + exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; + var ChangeDetectionError = (function(_super) { + __extends(ChangeDetectionError, _super); + function ChangeDetectionError(exp, originalException, originalStack, context) { + _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); + this.location = exp; + } + return ChangeDetectionError; + })(exceptions_1.WrappedException); + exports.ChangeDetectionError = ChangeDetectionError; + var DehydratedException = (function(_super) { + __extends(DehydratedException, _super); + function DehydratedException() { + _super.call(this, 'Attempt to detect changes on a dehydrated detector.'); + } + return DehydratedException; + })(exceptions_1.BaseException); + exports.DehydratedException = DehydratedException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var DebugContext = (function() { + function DebugContext(element, componentElement, directive, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.directive = directive; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return DebugContext; + })(); + exports.DebugContext = DebugContext; + var ChangeDetectorGenConfig = (function() { + function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { + this.genDebugInfo = genDebugInfo; + this.logBindingUpdate = logBindingUpdate; + this.useJit = useJit; + } + return ChangeDetectorGenConfig; + })(); + exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; + var ChangeDetectorDefinition = (function() { + function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { + this.id = id; + this.strategy = strategy; + this.variableNames = variableNames; + this.bindingRecords = bindingRecords; + this.eventRecords = eventRecords; + this.directiveRecords = directiveRecords; + this.genConfig = genConfig; + } + return ChangeDetectorDefinition; + })(); + exports.ChangeDetectorDefinition = ChangeDetectorDefinition; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + (function(ChangeDetectorState) { + ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; + ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; + ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; + })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); + var ChangeDetectorState = exports.ChangeDetectorState; + (function(ChangeDetectionStrategy) { + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; + ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; + ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; + ChangeDetectionStrategy[ChangeDetectionStrategy["OnPushObserve"] = 6] = "OnPushObserve"; + })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); + var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default, ChangeDetectionStrategy.OnPushObserve]; + exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; + function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { + return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; + } + exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function implementsOnDestroy(pipe) { + return pipe.constructor.prototype.onDestroy; + } + exports.implementsOnDestroy = implementsOnDestroy; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; + var BINDING = "native"; + var DIRECTIVE = "directive"; + var ELEMENT_PROPERTY = "elementProperty"; + var ELEMENT_ATTRIBUTE = "elementAttribute"; + var ELEMENT_CLASS = "elementClass"; + var ELEMENT_STYLE = "elementStyle"; + var TEXT_NODE = "textNode"; + var EVENT = "event"; + var HOST_EVENT = "hostEvent"; + var BindingTarget = (function() { + function BindingTarget(mode, elementIndex, name, unit, debug) { + this.mode = mode; + this.elementIndex = elementIndex; + this.name = name; + this.unit = unit; + this.debug = debug; + } + BindingTarget.prototype.isDirective = function() { + return this.mode === DIRECTIVE; + }; + BindingTarget.prototype.isElementProperty = function() { + return this.mode === ELEMENT_PROPERTY; + }; + BindingTarget.prototype.isElementAttribute = function() { + return this.mode === ELEMENT_ATTRIBUTE; + }; + BindingTarget.prototype.isElementClass = function() { + return this.mode === ELEMENT_CLASS; + }; + BindingTarget.prototype.isElementStyle = function() { + return this.mode === ELEMENT_STYLE; + }; + BindingTarget.prototype.isTextNode = function() { + return this.mode === TEXT_NODE; + }; + return BindingTarget; + })(); + exports.BindingTarget = BindingTarget; + var BindingRecord = (function() { + function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { + this.mode = mode; + this.target = target; + this.implicitReceiver = implicitReceiver; + this.ast = ast; + this.setter = setter; + this.lifecycleEvent = lifecycleEvent; + this.directiveRecord = directiveRecord; + } + BindingRecord.prototype.isDirectiveLifecycle = function() { + return this.mode === DIRECTIVE_LIFECYCLE; + }; + BindingRecord.prototype.callOnChanges = function() { + return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; + }; + BindingRecord.prototype.isDefaultChangeDetection = function() { + return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); + }; + BindingRecord.createDirectiveDoCheck = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); + }; + BindingRecord.createDirectiveOnInit = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); + }; + BindingRecord.createDirectiveOnChanges = function(directiveRecord) { + return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); + }; + BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { + var elementIndex = directiveRecord.directiveIndex.elementIndex; + var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); + }; + BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementClass = function(ast, elementIndex, className) { + var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { + var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { + var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostClass = function(directiveIndex, ast, className) { + var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { + var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); + return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); + }; + BindingRecord.createForTextNode = function(ast, elementIndex) { + var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); + return new BindingRecord(BINDING, t, 0, ast, null, null, null); + }; + BindingRecord.createForEvent = function(ast, eventName, elementIndex) { + var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); + return new BindingRecord(EVENT, t, 0, ast, null, null, null); + }; + BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { + var directiveIndex = directiveRecord.directiveIndex; + var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); + return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); + }; + return BindingRecord; + })(); + exports.BindingRecord = BindingRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var DirectiveIndex = (function() { + function DirectiveIndex(elementIndex, directiveIndex) { + this.elementIndex = elementIndex; + this.directiveIndex = directiveIndex; + } + Object.defineProperty(DirectiveIndex.prototype, "name", { + get: function() { + return this.elementIndex + "_" + this.directiveIndex; + }, + enumerable: true, + configurable: true + }); + return DirectiveIndex; + })(); + exports.DirectiveIndex = DirectiveIndex; + var DirectiveRecord = (function() { + function DirectiveRecord(_a) { + var _b = _a === void 0 ? {} : _a, + directiveIndex = _b.directiveIndex, + callAfterContentInit = _b.callAfterContentInit, + callAfterContentChecked = _b.callAfterContentChecked, + callAfterViewInit = _b.callAfterViewInit, + callAfterViewChecked = _b.callAfterViewChecked, + callOnChanges = _b.callOnChanges, + callDoCheck = _b.callDoCheck, + callOnInit = _b.callOnInit, + changeDetection = _b.changeDetection; + this.directiveIndex = directiveIndex; + this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); + this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); + this.callOnChanges = lang_1.normalizeBool(callOnChanges); + this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); + this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); + this.callDoCheck = lang_1.normalizeBool(callDoCheck); + this.callOnInit = lang_1.normalizeBool(callOnInit); + this.changeDetection = changeDetection; + } + DirectiveRecord.prototype.isDefaultChangeDetection = function() { + return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); + }; + return DirectiveRecord; + })(); + exports.DirectiveRecord = DirectiveRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var constants_1 = require("angular2/src/core/change_detection/constants"); + var ChangeDetectorRef = (function() { + function ChangeDetectorRef() {} + return ChangeDetectorRef; + })(); + exports.ChangeDetectorRef = ChangeDetectorRef; + var ChangeDetectorRef_ = (function(_super) { + __extends(ChangeDetectorRef_, _super); + function ChangeDetectorRef_(_cd) { + _super.call(this); + this._cd = _cd; + } + ChangeDetectorRef_.prototype.markForCheck = function() { + this._cd.markPathToRootAsCheckOnce(); + }; + ChangeDetectorRef_.prototype.detach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; + }; + ChangeDetectorRef_.prototype.detectChanges = function() { + this._cd.detectChanges(); + }; + ChangeDetectorRef_.prototype.checkNoChanges = function() { + this._cd.checkNoChanges(); + }; + ChangeDetectorRef_.prototype.reattach = function() { + this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; + this.markForCheck(); + }; + return ChangeDetectorRef_; + })(ChangeDetectorRef); + exports.ChangeDetectorRef_ = ChangeDetectorRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var trace; + var events; + function detectWTF() { + var wtf = lang_1.global['wtf']; + if (wtf) { + trace = wtf['trace']; + if (trace) { + events = trace['events']; + return true; + } + } + return false; + } + exports.detectWTF = detectWTF; + function createScope(signature, flags) { + if (flags === void 0) { + flags = null; + } + return events.createScope(signature, flags); + } + exports.createScope = createScope; + function leave(scope, returnValue) { + trace.leaveScope(scope, returnValue); + return returnValue; + } + exports.leave = leave; + function startTimeRange(rangeType, action) { + return trace.beginTimeRange(rangeType, action); + } + exports.startTimeRange = startTimeRange; + function endTimeRange(range) { + trace.endTimeRange(range); + } + exports.endTimeRange = endTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/observable_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isObservable(value) { + return false; + } + exports.isObservable = isObservable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(RecordType) { + RecordType[RecordType["Self"] = 0] = "Self"; + RecordType[RecordType["Const"] = 1] = "Const"; + RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; + RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; + RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; + RecordType[RecordType["Local"] = 5] = "Local"; + RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; + RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; + RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; + RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; + RecordType[RecordType["Pipe"] = 10] = "Pipe"; + RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; + RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; + RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; + RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; + RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; + RecordType[RecordType["Chain"] = 16] = "Chain"; + RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; + RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; + RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; + })(exports.RecordType || (exports.RecordType = {})); + var RecordType = exports.RecordType; + var ProtoRecord = (function() { + function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { + this.mode = mode; + this.name = name; + this.funcOrValue = funcOrValue; + this.args = args; + this.fixedArgs = fixedArgs; + this.contextIndex = contextIndex; + this.directiveIndex = directiveIndex; + this.selfIndex = selfIndex; + this.bindingRecord = bindingRecord; + this.lastInBinding = lastInBinding; + this.lastInDirective = lastInDirective; + this.argumentToPureFunction = argumentToPureFunction; + this.referencedBySelf = referencedBySelf; + this.propertyBindingIndex = propertyBindingIndex; + } + ProtoRecord.prototype.isPureFunction = function() { + return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; + }; + ProtoRecord.prototype.isUsedByOtherRecord = function() { + return !this.lastInBinding || this.referencedBySelf; + }; + ProtoRecord.prototype.shouldBeChecked = function() { + return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); + }; + ProtoRecord.prototype.isPipeRecord = function() { + return this.mode === RecordType.Pipe; + }; + ProtoRecord.prototype.isConditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; + }; + ProtoRecord.prototype.isUnconditionalSkipRecord = function() { + return this.mode === RecordType.SkipRecords; + }; + ProtoRecord.prototype.isSkipRecord = function() { + return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); + }; + ProtoRecord.prototype.isLifeCycleRecord = function() { + return this.mode === RecordType.DirectiveLifecycle; + }; + return ProtoRecord; + })(); + exports.ProtoRecord = ProtoRecord; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EventBinding = (function() { + function EventBinding(eventName, elIndex, dirIndex, records) { + this.eventName = eventName; + this.elIndex = elIndex; + this.dirIndex = dirIndex; + this.records = records; + } + return EventBinding; + })(); + exports.EventBinding = EventBinding; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + function coalesce(srcRecords) { + var dstRecords = []; + var excludedIdxs = []; + var indexMap = new collection_1.Map(); + var skipDepth = 0; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipDepth--; + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + if (dst.isSkipRecord()) { + dstRecords.push(dst); + skipDepth++; + skipSources[dst.fixedArgs[0]] = dst; + } else { + var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); + indexMap.set(src.selfIndex, record.selfIndex); + } + } + return _optimizeSkips(dstRecords); + } + exports.coalesce = coalesce; + function _optimizeSkips(srcRecords) { + var dstRecords = []; + var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); + var indexMap = new collection_1.Map(); + for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { + var skipRecord = skipSources[protoIndex]; + if (lang_1.isPresent(skipRecord)) { + skipRecord.fixedArgs[0] = dstRecords.length; + } + var src = srcRecords[protoIndex]; + if (src.isSkipRecord()) { + if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { + src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; + src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; + protoIndex++; + } + if (src.fixedArgs[0] > protoIndex + 1) { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + skipSources[dst.fixedArgs[0]] = dst; + } + } else { + var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); + dstRecords.push(dst); + indexMap.set(src.selfIndex, dst.selfIndex); + } + } + return dstRecords; + } + function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { + var match = _findFirstMatch(record, dstRecords, excludedIdxs); + if (lang_1.isPresent(match)) { + if (record.lastInBinding) { + dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); + match.referencedBySelf = true; + } else { + if (record.argumentToPureFunction) { + match.argumentToPureFunction = true; + } + } + return match; + } + if (excluded) { + excludedIdxs.push(record.selfIndex); + } + dstRecords.push(record); + return record; + } + function _findFirstMatch(record, dstRecords, excludedIdxs) { + return dstRecords.find(function(rr) { + return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); + }); + } + function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { + var args = record.args.map(function(src) { + return _srcToDstSelfIndex(indexMap, src); + }); + var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); + var selfIndex = dstRecords.length + 1; + return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); + } + function _srcToDstSelfIndex(indexMap, srcIdx) { + var dstIdx = indexMap.get(srcIdx); + return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; + } + function _createSelfRecord(r, contextIndex, selfIndex) { + return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); + } + function _haveSameDirIndex(a, b) { + var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; + var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; + var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; + var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; + return di1 === di2 && ei1 === ei2; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _STATE_ACCESSOR = "state"; + var _CONTEXT_ACCESSOR = "context"; + var _PROP_BINDING_INDEX = "propertyBindingIndex"; + var _DIRECTIVES_ACCESSOR = "directiveIndices"; + var _DISPATCHER_ACCESSOR = "dispatcher"; + var _LOCALS_ACCESSOR = "locals"; + var _MODE_ACCESSOR = "mode"; + var _PIPES_ACCESSOR = "pipes"; + var _PROTOS_ACCESSOR = "protos"; + exports.CONTEXT_ACCESSOR = "context"; + exports.CONTEXT_INDEX = 0; + var _FIELD_PREFIX = 'this.'; + var _whiteSpaceRegExp = /\W/g; + function sanitizeName(s) { + return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); + } + exports.sanitizeName = sanitizeName; + var CodegenNameUtil = (function() { + function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._utilName = _utilName; + this._sanitizedEventNames = new collection_1.Map(); + this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); + this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); + } + for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { + var eb = _eventBindings[ebIndex]; + var names = [exports.CONTEXT_ACCESSOR]; + for (var i = 0, + iLen = eb.records.length; i < iLen; ++i) { + names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); + } + this._sanitizedEventNames.set(eb, names); + } + } + CodegenNameUtil.prototype._addFieldPrefix = function(name) { + return "" + _FIELD_PREFIX + name; + }; + CodegenNameUtil.prototype.getDispatcherName = function() { + return this._addFieldPrefix(_DISPATCHER_ACCESSOR); + }; + CodegenNameUtil.prototype.getPipesAccessorName = function() { + return this._addFieldPrefix(_PIPES_ACCESSOR); + }; + CodegenNameUtil.prototype.getProtosName = function() { + return this._addFieldPrefix(_PROTOS_ACCESSOR); + }; + CodegenNameUtil.prototype.getDirectivesAccessorName = function() { + return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); + }; + CodegenNameUtil.prototype.getLocalsAccessorName = function() { + return this._addFieldPrefix(_LOCALS_ACCESSOR); + }; + CodegenNameUtil.prototype.getStateName = function() { + return this._addFieldPrefix(_STATE_ACCESSOR); + }; + CodegenNameUtil.prototype.getModeName = function() { + return this._addFieldPrefix(_MODE_ACCESSOR); + }; + CodegenNameUtil.prototype.getPropertyBindingIndex = function() { + return this._addFieldPrefix(_PROP_BINDING_INDEX); + }; + CodegenNameUtil.prototype.getLocalName = function(idx) { + return "l_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { + return "l_" + this._sanitizedEventNames.get(eb)[idx]; + }; + CodegenNameUtil.prototype.getChangeName = function(idx) { + return "c_" + this._sanitizedNames[idx]; + }; + CodegenNameUtil.prototype.genInitLocals = function() { + var declarations = []; + var assignments = []; + for (var i = 0, + iLen = this.getFieldCount(); i < iLen; ++i) { + if (i == exports.CONTEXT_INDEX) { + declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); + } else { + var rec = this._records[i - 1]; + if (rec.argumentToPureFunction) { + var changeName = this.getChangeName(i); + declarations.push(this.getLocalName(i) + "," + changeName); + assignments.push(changeName); + } else { + declarations.push("" + this.getLocalName(i)); + } + } + } + var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; + return "var " + declarations.join(',') + ";" + assignmentsCode; + }; + CodegenNameUtil.prototype.genInitEventLocals = function() { + var _this = this; + var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; + this._sanitizedEventNames.forEach(function(names, eb) { + for (var i = 0; i < names.length; ++i) { + if (i !== exports.CONTEXT_INDEX) { + res.push("" + _this.getEventLocalName(eb, i)); + } + } + }); + return res.length > 1 ? "var " + res.join(',') + ";" : ''; + }; + CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { + return "preventDefault"; + }; + CodegenNameUtil.prototype.getFieldCount = function() { + return this._sanitizedNames.length; + }; + CodegenNameUtil.prototype.getFieldName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx]); + }; + CodegenNameUtil.prototype.getAllFieldNames = function() { + var fieldList = []; + for (var k = 0, + kLen = this.getFieldCount(); k < kLen; ++k) { + if (k === 0 || this._records[k - 1].shouldBeChecked()) { + fieldList.push(this.getFieldName(k)); + } + } + for (var i = 0, + iLen = this._records.length; i < iLen; ++i) { + var rec = this._records[i]; + if (rec.isPipeRecord()) { + fieldList.push(this.getPipeName(rec.selfIndex)); + } + } + for (var j = 0, + jLen = this._directiveRecords.length; j < jLen; ++j) { + var dRec = this._directiveRecords[j]; + fieldList.push(this.getDirectiveName(dRec.directiveIndex)); + if (!dRec.isDefaultChangeDetection()) { + fieldList.push(this.getDetectorName(dRec.directiveIndex)); + } + } + return fieldList; + }; + CodegenNameUtil.prototype.genDehydrateFields = function() { + var fields = this.getAllFieldNames(); + collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); + if (collection_1.ListWrapper.isEmpty(fields)) + return ''; + fields.push(this._utilName + ".uninitialized;"); + return fields.join(' = '); + }; + CodegenNameUtil.prototype.genPipeOnDestroy = function() { + var _this = this; + return this._records.filter(function(r) { + return r.isPipeRecord(); + }).map(function(r) { + return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); + }).join('\n'); + }; + CodegenNameUtil.prototype.getPipeName = function(idx) { + return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); + }; + CodegenNameUtil.prototype.getDirectiveName = function(d) { + return this._addFieldPrefix("directive_" + d.name); + }; + CodegenNameUtil.prototype.getDetectorName = function(d) { + return this._addFieldPrefix("detector_" + d.name); + }; + return CodegenNameUtil; + })(); + exports.CodegenNameUtil = CodegenNameUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function codify(obj) { + return JSON.stringify(obj); + } + exports.codify = codify; + function rawString(str) { + return "'" + str + "'"; + } + exports.rawString = rawString; + function combineGeneratedStrings(vals) { + return vals.join(' + '); + } + exports.combineGeneratedStrings = combineGeneratedStrings; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + (function(ViewEncapsulation) { + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; + ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; + })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); + var ViewEncapsulation = exports.ViewEncapsulation; + exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; + var ViewMetadata = (function() { + function ViewMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + templateUrl = _b.templateUrl, + template = _b.template, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation, + styles = _b.styles, + styleUrls = _b.styleUrls; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); + return ViewMetadata; + })(); + exports.ViewMetadata = ViewMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Class = decorators_1.Class; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var PromiseWrapper = (function() { + function PromiseWrapper() {} + PromiseWrapper.resolve = function(obj) { + return Promise.resolve(obj); + }; + PromiseWrapper.reject = function(obj, _) { + return Promise.reject(obj); + }; + PromiseWrapper.catchError = function(promise, onError) { + return promise.catch(onError); + }; + PromiseWrapper.all = function(promises) { + if (promises.length == 0) + return Promise.resolve([]); + return Promise.all(promises); + }; + PromiseWrapper.then = function(promise, success, rejection) { + return promise.then(success, rejection); + }; + PromiseWrapper.wrap = function(computation) { + return new Promise(function(res, rej) { + try { + res(computation()); + } catch (e) { + rej(e); + } + }); + }; + PromiseWrapper.scheduleMicrotask = function(computation) { + PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); + }; + PromiseWrapper.isPromise = function(obj) { + return obj instanceof Promise; + }; + PromiseWrapper.completer = function() { + var resolve; + var reject; + var p = new Promise(function(res, rej) { + resolve = res; + reject = rej; + }); + return { + promise: p, + resolve: resolve, + reject: reject + }; + }; + return PromiseWrapper; + })(); + exports.PromiseWrapper = PromiseWrapper; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = noop; + function noop() {} + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = throwError; + function throwError(e) { + throw e; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = tryOrOnError; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscription", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Subscription = (function() { + function Subscription(_unsubscribe) { + _classCallCheck(this, Subscription); + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function _unsubscribe() {}; + Subscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var unsubscribe = this._unsubscribe; + var subscriptions = this._subscriptions; + this._subscriptions = void 0; + if (unsubscribe) { + unsubscribe.call(this); + } + if (subscriptions != null) { + var index = -1; + var len = subscriptions.length; + while (++index < len) { + subscriptions[index].unsubscribe(); + } + } + }; + Subscription.prototype.add = function add(subscription) { + if (!subscription || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var sub = subscription; + switch (typeof subscription) { + case "function": + sub = new Subscription(subscription); + case "object": + if (sub.isUnsubscribed || typeof sub.unsubscribe !== "function") { + break; + } else if (this.isUnsubscribed) { + sub.unsubscribe(); + } else { + var subscriptions = this._subscriptions || (this._subscriptions = []); + subscriptions.push(sub); + } + break; + default: + throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); + } + }; + Subscription.prototype.remove = function remove(subscription) { + if (subscription == null || subscription === this || subscription === Subscription.EMPTY) { + return ; + } + var subscriptions = this._subscriptions; + if (subscriptions) { + var subscriptionIndex = subscriptions.indexOf(subscription); + if (subscriptionIndex !== -1) { + subscriptions.splice(subscriptionIndex, 1); + } + } + }; + return Subscription; + })(); + exports["default"] = Subscription; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + })(new Subscription()); + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + var root = objectTypes[typeof self] && self || objectTypes[typeof window] && window; + exports.root = root; + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + exports.root = root = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.observable) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.observable = _root.root.Symbol['for']('observable'); + } else { + _root.root.Symbol.observable = '@@observable'; + } + } + exports['default'] = _root.root.Symbol.observable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + var errorObject = {e: {}}; + exports.errorObject = errorObject; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var ErrorObservable = (function(_Observable) { + _inherits(ErrorObservable, _Observable); + function ErrorObservable(error, scheduler) { + _classCallCheck(this, ErrorObservable); + _Observable.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function create(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function dispatch(_ref) { + var error = _ref.error; + var subscriber = _ref.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function _subscribe(subscriber) { + var error = this.error; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, { + error: error, + subscriber: subscriber + })); + } else { + subscriber.error(error); + } + }; + return ErrorObservable; + })(_Observable3['default']); + exports['default'] = ErrorObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var EmptyObservable = (function(_Observable) { + _inherits(EmptyObservable, _Observable); + function EmptyObservable(scheduler) { + _classCallCheck(this, EmptyObservable); + _Observable.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function create(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function dispatch(_ref) { + var subscriber = _ref.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function _subscribe(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(_Observable3['default']); + exports['default'] = EmptyObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/OuterSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var OuterSubscriber = (function(_Subscriber) { + _inherits(OuterSubscriber, _Subscriber); + function OuterSubscriber() { + _classCallCheck(this, OuterSubscriber); + _Subscriber.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function notifyComplete(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function notifyError(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(_Subscriber3['default']); + exports['default'] = OuterSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + if (!_root.root.Symbol) { + _root.root.Symbol = {}; + } + if (!_root.root.Symbol.iterator) { + if (typeof _root.root.Symbol['for'] === 'function') { + _root.root.Symbol.iterator = _root.root.Symbol['for']('iterator'); + } else if (_root.root.Set && typeof new _root.root.Set()['@@iterator'] === 'function') { + _root.root.Symbol.iterator = '@@iterator'; + } else { + _root.root.Symbol.iterator = '_es6shim_iterator_'; + } + } + exports['default'] = _root.root.Symbol.iterator; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/InnerSubscriber", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var InnerSubscriber = (function(_Subscriber) { + _inherits(InnerSubscriber, _Subscriber); + function InnerSubscriber(parent, outerValue, outerIndex) { + _classCallCheck(this, InnerSubscriber); + _Subscriber.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function _error(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function _complete() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(_Subscriber3['default']); + exports['default'] = InnerSubscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", ["@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var ImmediateAction = (function(_Subscription) { + _inherits(ImmediateAction, _Subscription); + function ImmediateAction(scheduler, work) { + _classCallCheck(this, ImmediateAction); + _Subscription.call(this); + this.scheduler = scheduler; + this.work = work; + } + ImmediateAction.prototype.schedule = function schedule(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + ImmediateAction.prototype.execute = function execute() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + ImmediateAction.prototype.unsubscribe = function unsubscribe() { + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = void 0; + this.state = void 0; + this.scheduler = void 0; + if (index !== -1) { + actions.splice(index, 1); + } + _Subscription.prototype.unsubscribe.call(this); + }; + return ImmediateAction; + })(_Subscription3['default']); + exports['default'] = ImmediateAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var FutureAction = (function(_ImmediateAction) { + _inherits(FutureAction, _ImmediateAction); + function FutureAction(scheduler, work) { + _classCallCheck(this, FutureAction); + _ImmediateAction.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function schedule(state) { + var _this = this; + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (this.isUnsubscribed) { + return this; + } + this.delay = delay; + this.state = state; + var id = this.id; + if (id != null) { + this.id = undefined; + clearTimeout(id); + } + var scheduler = this.scheduler; + this.id = setTimeout(function() { + _this.id = void 0; + scheduler.actions.push(_this); + scheduler.flush(); + }, this.delay); + return this; + }; + FutureAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _ImmediateAction.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(_ImmediateAction3['default']); + exports['default'] = FutureAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var DeferObservable = (function(_Observable) { + _inherits(DeferObservable, _Observable); + function DeferObservable(observableFactory) { + _classCallCheck(this, DeferObservable); + _Observable.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function create(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function _subscribe(subscriber) { + var result = _utilTryCatch2['default'](this.observableFactory)(); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(_Observable3['default']); + exports['default'] = DeferObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var ForkJoinObservable = (function(_Observable) { + _inherits(ForkJoinObservable, _Observable); + function ForkJoinObservable(observables) { + _classCallCheck(this, ForkJoinObservable); + _Observable.call(this); + this.observables = observables; + } + ForkJoinObservable.create = function create() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + return new ForkJoinObservable(observables); + }; + ForkJoinObservable.prototype._subscribe = function _subscribe(subscriber) { + var observables = this.observables; + var len = observables.length; + var context = { + complete: 0, + total: len, + values: emptyArray(len) + }; + for (var i = 0; i < len; i++) { + observables[i].subscribe(new AllSubscriber(subscriber, this, i, context)); + } + }; + return ForkJoinObservable; + })(_Observable3['default']); + exports['default'] = ForkJoinObservable; + var AllSubscriber = (function(_Subscriber) { + _inherits(AllSubscriber, _Subscriber); + function AllSubscriber(destination, parent, index, context) { + _classCallCheck(this, AllSubscriber); + _Subscriber.call(this, destination); + this.parent = parent; + this.index = index; + this.context = context; + } + AllSubscriber.prototype._next = function _next(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function _complete() { + var context = this.context; + context.values[this.index] = this._value; + if (context.values.every(hasValue)) { + this.destination.next(context.values); + this.destination.complete(); + } + }; + return AllSubscriber; + })(_Subscriber3['default']); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var PromiseObservable = (function(_Observable) { + _inherits(PromiseObservable, _Observable); + function PromiseObservable(promise, scheduler) { + _classCallCheck(this, PromiseObservable); + _Observable.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function create(promise) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function _subscribe(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === _schedulersImmediate2['default']) { + if (this._isScalar) { + subscriber.next(this.value); + subscriber.complete(); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscriber.next(value); + subscriber.complete(); + }, function(err) { + return subscriber.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + } + } else { + var _ret = (function() { + var subscription = new _Subscription2['default'](); + if (_this._isScalar) { + var value = _this.value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + } else { + promise.then(function(value) { + _this._isScalar = true; + _this.value = value; + subscription.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subscriber: subscriber + })); + }, function(err) { + return subscription.add(scheduler.schedule(dispatchError, 0, { + err: err, + subscriber: subscriber + })); + }).then(null, function(err) { + scheduler.schedule(function() { + throw err; + }); + }); + } + return {v: subscription}; + })(); + if (typeof _ret === 'object') + return _ret.v; + } + }; + return PromiseObservable; + })(_Observable3['default']); + exports['default'] = PromiseObservable; + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_ref2) { + var err = _ref2.err; + var subscriber = _ref2.subscriber; + subscriber.error(err); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var IteratorObservable = (function(_Observable) { + _inherits(IteratorObservable, _Observable); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _classCallCheck(this, IteratorObservable); + _Observable.call(this); + this.iterator = iterator; + this.project = project; + this.thisArg = thisArg; + this.scheduler = scheduler; + } + IteratorObservable.create = function create(iterator, project, thisArg, scheduler) { + if (iterator == null) { + throw new Error('iterator cannot be null.'); + } + if (project && typeof project !== 'function') { + throw new Error('When provided, `project` must be a function.'); + } + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function dispatch(state) { + var index = state.index; + var hasError = state.hasError; + var thisArg = state.thisArg; + var project = state.project; + var iterator = state.iterator; + var subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index); + if (result === _utilErrorObject.errorObject) { + state.error = _utilErrorObject.errorObject.e; + state.hasError = true; + } else { + subscriber.next(result); + state.index = index + 1; + } + } else { + subscriber.next(result.value); + state.index = index + 1; + } + if (subscriber.isUnsubscribed) { + return ; + } + this.schedule(state); + }; + IteratorObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var project = this.project; + var thisArg = this.thisArg; + var iterator = getIterator(Object(this.iterator)); + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(IteratorObservable.dispatch, 0, { + index: index, + thisArg: thisArg, + project: project, + iterator: iterator, + subscriber: subscriber + })); + } else { + do { + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + break; + } else if (project) { + result = _utilTryCatch2['default'](project).call(thisArg, result.value, index++); + if (result === _utilErrorObject.errorObject) { + subscriber.error(_utilErrorObject.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(_Observable3['default']); + exports['default'] = IteratorObservable; + var maxSafeInteger = Math.pow(2, 53) - 1; + var StringIterator = (function() { + function StringIterator(str) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? str.length : arguments[2]; + return (function() { + _classCallCheck(this, StringIterator); + this.str = str; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + StringIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StringIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.str.charAt(this.idx++) + } : { + done: true, + value: undefined + }; + }; + return StringIterator; + })(); + var ArrayIterator = (function() { + function ArrayIterator(arr) { + var idx = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var len = arguments.length <= 2 || arguments[2] === undefined ? toLength(arr) : arguments[2]; + return (function() { + _classCallCheck(this, ArrayIterator); + this.arr = arr; + this.idx = idx; + this.len = len; + }).apply(this, arguments); + } + ArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ArrayIterator.prototype.next = function next() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(o) { + var i = o[_utilSymbol_iterator2['default']]; + if (!i && typeof o === 'string') { + return new StringIterator(o); + } + if (!i && o.length !== undefined) { + return new ArrayIterator(o); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return o[_utilSymbol_iterator2['default']](); + } + function toLength(o) { + var len = +o.length; + if (isNaN(len)) { + return 0; + } + if (len === 0 || !numberIsFinite(len)) { + return len; + } + len = sign(len) * Math.floor(Math.abs(len)); + if (len <= 0) { + return 0; + } + if (len > maxSafeInteger) { + return maxSafeInteger; + } + return len; + } + function numberIsFinite(value) { + return typeof value === 'number' && _utilRoot.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Notification", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var Notification = (function() { + function Notification(kind, value, exception) { + _classCallCheck(this, Notification); + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function observe(observer) { + switch (this.kind) { + case 'N': + return observer.next(this.value); + case 'E': + return observer.error(this.exception); + case 'C': + return observer.complete(); + } + }; + Notification.prototype['do'] = function _do(next, error, complete) { + var kind = this.kind; + switch (kind) { + case 'N': + return next(this.value); + case 'E': + return error(this.exception); + case 'C': + return complete(); + } + }; + Notification.prototype.accept = function accept(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this['do'](nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function toObservable() { + var kind = this.kind; + var value = this.value; + switch (kind) { + case 'N': + return _Observable2['default'].of(value); + case 'E': + return _Observable2['default']['throw'](value); + case 'C': + return _Observable2['default'].empty(); + } + }; + Notification.createNext = function createNext(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function createError(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function createComplete() { + return this.completeNotification; + }; + return Notification; + })(); + exports['default'] = Notification; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var FromEventObservable = (function(_Observable) { + _inherits(FromEventObservable, _Observable); + function FromEventObservable(sourceObj, eventName, selector) { + _classCallCheck(this, FromEventObservable); + _Observable.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function create(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function setupSubscription(sourceObj, eventName, handler, subscriber) { + var unsubscribe = undefined; + var tag = sourceObj.toString(); + if (tag === '[object NodeList]' || tag === '[object HTMLCollection]') { + for (var i = 0, + len = sourceObj.length; i < len; i++) { + FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); + } + } else if (typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function') { + sourceObj.addEventListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeEventListener(eventName, handler); + }; + } else if (typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function') { + sourceObj.on(eventName, handler); + unsubscribe = function() { + return sourceObj.off(eventName, handler); + }; + } else if (typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function') { + sourceObj.addListener(eventName, handler); + unsubscribe = function() { + return sourceObj.removeListener(eventName, handler); + }; + } + subscriber.add(new _Subscription2['default'](unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function _subscribe(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector)(e); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(_Observable3['default']); + exports['default'] = FromEventObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var FromEventPatternObservable = (function(_Observable) { + _inherits(FromEventPatternObservable, _Observable); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _classCallCheck(this, FromEventPatternObservable); + _Observable.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function create(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function _subscribe(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = _utilTryCatch2['default'](selector).apply(null, arguments); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = _utilTryCatch2['default'](addHandler)(handler); + if (result === _utilErrorObject.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new _Subscription2['default'](function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(_Observable3['default']); + exports['default'] = FromEventPatternObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isNumeric; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && val - parseFloat(val) + 1 >= 0; + } + ; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Immediate", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + var Immediate = { + setImmediate: function setImmediate(x) { + return 0; + }, + clearImmediate: function clearImmediate(id) {} + }; + exports.Immediate = Immediate; + if (_root.root && _root.root.setImmediate) { + Immediate.setImmediate = _root.root.setImmediate; + Immediate.clearImmediate = _root.root.clearImmediate; + } else { + exports.Immediate = Immediate = (function(global, Immediate) { + var nextHandle = 1, + tasksByHandle = {}, + currentlyRunningATask = false, + doc = global.document, + setImmediate = undefined; + if (({}).toString.call(global.process) === '[object process]') { + setImmediate = installNextTickImplementation(); + } else if (canUsePostMessage()) { + setImmediate = installPostMessageImplementation(); + } else if (global.MessageChannel) { + setImmediate = installMessageChannelImplementation(); + } else if (doc && 'onreadystatechange' in doc.createElement('script')) { + setImmediate = installReadyStateChangeImplementation(); + } else { + setImmediate = installSetTimeoutImplementation(); + } + Immediate.setImmediate = setImmediate; + Immediate.clearImmediate = clearImmediate; + return Immediate; + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + function addFromSetImmediateArguments(args) { + tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args); + return nextHandle++; + } + function partiallyApplied(handler) { + for (var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return function() { + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + new Function('' + handler)(); + } + }; + } + function runIfPresent(handle) { + if (currentlyRunningATask) { + setTimeout(partiallyApplied(runIfPresent, handle), 0); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + task(); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + function installNextTickImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.process.nextTick(partiallyApplied(runIfPresent, handle)); + return handle; + }; + } + function canUsePostMessage() { + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage('', '*'); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + function installPostMessageImplementation() { + var messagePrefix = 'setImmediate$' + Math.random() + '$'; + var onGlobalMessage = function onGlobalMessage(event) { + if (event.source === global && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + if (global.addEventListener) { + global.addEventListener('message', onGlobalMessage, false); + } else { + global.attachEvent('onmessage', onGlobalMessage); + } + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + global.postMessage(messagePrefix + handle, '*'); + return handle; + }; + } + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + } + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + } + function installSetTimeoutImplementation() { + return function setImmediate() { + var handle = addFromSetImmediateArguments(arguments); + setTimeout(partiallyApplied(runIfPresent, handle), 0); + return handle; + }; + } + })(_root.root, Immediate); + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll-support", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + _classCallCheck(this, MergeAllOperator); + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function call(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_OuterSubscriber) { + _inherits(MergeAllSubscriber, _OuterSubscriber); + function MergeAllSubscriber(destination, concurrent) { + _classCallCheck(this, MergeAllSubscriber); + _OuterSubscriber.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function _next(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeAllSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var InfiniteObservable = (function(_Observable) { + _inherits(InfiniteObservable, _Observable); + function InfiniteObservable() { + _classCallCheck(this, InfiniteObservable); + _Observable.call(this); + } + InfiniteObservable.create = function create() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function _subscribe(subscriber) {}; + return InfiniteObservable; + })(_Observable3['default']); + exports['default'] = InfiniteObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RangeObservable = (function(_Observable) { + _inherits(RangeObservable, _Observable); + function RangeObservable(start, end, scheduler) { + _classCallCheck(this, RangeObservable); + _Observable.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function create(start, end, scheduler) { + if (start === undefined) + start = 0; + if (end === undefined) + end = 0; + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function dispatch(state) { + var start = state.start; + var index = state.index; + var end = state.end; + var subscriber = state.subscriber; + if (index >= end) { + subscriber.complete(); + return ; + } + subscriber.next(start); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + state.start = start + 1; + this.schedule(state); + }; + RangeObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var start = this.start; + var end = this.end; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(RangeObservable.dispatch, 0, { + index: index, + end: end, + start: start, + subscriber: subscriber + })); + } else { + do { + if (index++ >= end) { + subscriber.complete(); + break; + } + subscriber.next(start++); + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return RangeObservable; + })(_Observable3['default']); + exports['default'] = RangeObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var TimerObservable = (function(_Observable) { + _inherits(TimerObservable, _Observable); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + _classCallCheck(this, TimerObservable); + _Observable.call(this); + this.dueTime = dueTime; + this.period = period; + this.scheduler = scheduler; + if (_utilIsNumeric2['default'](period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (period && typeof period.schedule === 'function') { + scheduler = period; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = _schedulersNextTick2['default']; + } + this.scheduler = scheduler; + } + TimerObservable.create = function create(dueTime, period, scheduler) { + if (dueTime === undefined) + dueTime = 0; + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function dispatch(state) { + var index = state.index; + var period = state.period; + var subscriber = state.subscriber; + var action = this; + subscriber.next(index); + if (typeof period === 'undefined') { + subscriber.complete(); + return ; + } else if (subscriber.isUnsubscribed) { + return ; + } + if (typeof action.delay === 'undefined') { + action.add(action.scheduler.schedule(TimerObservable.dispatch, period, { + index: index + 1, + period: period, + subscriber: subscriber + })); + } else { + state.index = index + 1; + action.schedule(state, period); + } + }; + TimerObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this._period; + var dueTime = this.dueTime; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(TimerObservable.dispatch, dueTime, { + index: index, + period: period, + subscriber: subscriber + })); + }; + return TimerObservable; + })(_Observable3['default']); + exports['default'] = TimerObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + _classCallCheck(this, ZipOperator); + this.project = project; + } + ZipOperator.prototype.call = function call(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_Subscriber) { + _inherits(ZipSubscriber, _Subscriber); + function ZipSubscriber(destination, project) { + var values = arguments.length <= 2 || arguments[2] === undefined ? Object.create(null) : arguments[2]; + _classCallCheck(this, ZipSubscriber); + _Subscriber.call(this, destination); + this.index = 0; + this.iterators = []; + this.active = 0; + this.project = typeof project === 'function' ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function _next(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[_utilSymbol_iterator2['default']] === 'function') { + iterators.push(new StaticIterator(value[_utilSymbol_iterator2['default']]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function _complete() { + var iterators = this.iterators; + var len = iterators.length; + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + iterator.subscribe(iterator, i); + } else { + this.active--; + } + } + }; + ZipSubscriber.prototype.notifyInactive = function notifyInactive() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function checkIterators() { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return ; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return ; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(_Subscriber3['default']); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + _classCallCheck(this, StaticIterator); + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function hasValue() { + return true; + }; + StaticIterator.prototype.next = function next() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function hasCompleted() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + _classCallCheck(this, StaticArrayIterator); + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function next(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function hasValue() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function hasCompleted() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_OuterSubscriber) { + _inherits(ZipBufferIterator, _OuterSubscriber); + function ZipBufferIterator(destination, parent, observable, index) { + _classCallCheck(this, ZipBufferIterator); + _OuterSubscriber.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[_utilSymbol_iterator2['default']] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function next() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function hasValue() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function hasCompleted() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function notifyComplete() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function subscribe(value, index) { + this.add(_utilSubscribeToResult2['default'](this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(_OuterSubscriber3['default']); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/buffer", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = buffer; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + _classCallCheck(this, BufferOperator); + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function call(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_Subscriber) { + _inherits(BufferSubscriber, _Subscriber); + function BufferSubscriber(destination, closingNotifier) { + _classCallCheck(this, BufferSubscriber); + _Subscriber.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function flushBuffer() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function bufferCount(bufferSize) { + var startBufferEvery = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountOperator); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function call(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_Subscriber) { + _inherits(BufferCountSubscriber, _Subscriber); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _classCallCheck(this, BufferCountSubscriber); + _Subscriber.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function _next(value) { + var count = this.count += 1; + var destination = this.destination; + var bufferSize = this.bufferSize; + var startBufferEvery = this.startBufferEvery == null ? bufferSize : this.startBufferEvery; + var buffers = this.buffers; + var len = buffers.length; + var remove = -1; + if (count % startBufferEvery === 0) { + buffers.push([]); + } + for (var i = 0; i < len; i++) { + var buffer = buffers[i]; + buffer.push(value); + if (buffer.length === bufferSize) { + remove = i; + destination.next(buffer); + } + } + if (remove !== -1) { + buffers.splice(remove, 1); + } + }; + BufferCountSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + var buffers = this.buffers; + while (buffers.length > 0) { + var buffer = buffers.shift(); + if (buffer.length > 0) { + destination.next(buffer); + } + } + destination.complete(); + }; + return BufferCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function bufferTime(bufferTimeSpan) { + var bufferCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeOperator); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function call(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_Subscriber) { + _inherits(BufferTimeSubscriber, _Subscriber); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _classCallCheck(this, BufferTimeSubscriber); + _Subscriber.call(this, destination); + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + this.buffers = []; + var buffer = this.openBuffer(); + if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { + var closeState = { + subscriber: this, + buffer: buffer + }; + var creationState = { + bufferTimeSpan: bufferTimeSpan, + bufferCreationInterval: bufferCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); + } else { + var timeSpanOnlyState = { + subscriber: this, + buffer: buffer, + bufferTimeSpan: bufferTimeSpan + }; + this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); + } + } + BufferTimeSubscriber.prototype._next = function _next(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function _error(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function _complete() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function openBuffer() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function closeBuffer(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(_Subscriber3['default']); + function dispatchBufferTimeSpanOnly(state) { + var subscriber = state.subscriber; + var prevBuffer = state.buffer; + if (prevBuffer) { + subscriber.closeBuffer(prevBuffer); + } + state.buffer = subscriber.openBuffer(); + if (!subscriber.isUnsubscribed) { + this.schedule(state, state.bufferTimeSpan); + } + } + function dispatchBufferCreation(state) { + var bufferCreationInterval = state.bufferCreationInterval; + var bufferTimeSpan = state.bufferTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var buffer = subscriber.openBuffer(); + var action = this; + if (!subscriber.isUnsubscribed) { + action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { + subscriber: subscriber, + buffer: buffer + })); + action.schedule(state, bufferCreationInterval); + } + } + function dispatchBufferClose(_ref) { + var subscriber = _ref.subscriber; + var buffer = _ref.buffer; + subscriber.closeBuffer(buffer); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + _classCallCheck(this, BufferToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function call(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_Subscriber) { + _inherits(BufferToggleSubscriber, _Subscriber); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, BufferToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].buffer.push(value); + } + }; + BufferToggleSubscriber.prototype._error = function _error(err) { + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + } + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function openBuffer(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.contexts = null; + this.destination.error(err); + } else { + var context = { + buffer: [], + subscription: new _Subscription2['default']() + }; + contexts.push(context); + var subscriber = new BufferClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function closeBuffer(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer; + var subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(_Subscriber5['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent, context) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.context = context; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeBuffer(this.context); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeBuffer(this.context); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber5['default']); + var BufferToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(BufferToggleOpeningsSubscriber, _Subscriber3); + function BufferToggleOpeningsSubscriber(parent) { + _classCallCheck(this, BufferToggleOpeningsSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return BufferToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bufferWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + _classCallCheck(this, BufferWhenOperator); + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function call(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_Subscriber) { + _inherits(BufferWhenSubscriber, _Subscriber); + function BufferWhenSubscriber(destination, closingSelector) { + _classCallCheck(this, BufferWhenSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function _next(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function _error(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function _complete() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function openBuffer() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var buffer = this.buffer; + if (buffer) { + this.destination.next(buffer); + } + this.buffer = []; + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(_Subscriber4['default']); + var BufferClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(BufferClosingNotifierSubscriber, _Subscriber2); + function BufferClosingNotifierSubscriber(parent) { + _classCallCheck(this, BufferClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/catch", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _catch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + var CatchOperator = (function() { + function CatchOperator(selector) { + _classCallCheck(this, CatchOperator); + this.selector = selector; + } + CatchOperator.prototype.call = function call(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_Subscriber) { + _inherits(CatchSubscriber, _Subscriber); + function CatchSubscriber(destination, selector, caught) { + _classCallCheck(this, CatchSubscriber); + _Subscriber.call(this, destination); + this.selector = selector; + this.caught = caught; + } + CatchSubscriber.prototype._error = function _error(err) { + var result = _utilTryCatch2['default'](this.selector)(err, this.caught); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.add(result.subscribe(this.destination)); + } + }; + return CatchSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineAll", ["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineAll; + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineAll(project) { + return this.lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + var project = undefined; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat", ["@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + function concat() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + args.unshift(this); + if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') { + args.splice(args.length - 2, 0, 1); + } + return _Observable2['default'].fromArray(args).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function concatAll() { + return this.lift(new _mergeAllSupport.MergeAllOperator(1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/subscribeToResult", "@reactivex/rxjs/dist/cjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapOperator); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function call(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapSubscriber, _OuterSubscriber); + function MergeMapSubscriber(destination, project, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = _utilTryCatch2['default'](this.project)(value, index); + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function _innerSub(ish, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var destination = this.destination; + var resultSelector = this.resultSelector; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, MergeMapToOperator); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function call(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_OuterSubscriber) { + _inherits(MergeMapToSubscriber, _OuterSubscriber); + function MergeMapToSubscriber(destination, ish, resultSelector) { + var concurrent = arguments.length <= 3 || arguments[3] === undefined ? Number.POSITIVE_INFINITY : arguments[3]; + _classCallCheck(this, MergeMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + this.index = 0; + } + MergeMapToSubscriber.prototype._next = function _next(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + if (ish === _utilErrorObject.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function _innerSub(ish, destination, resultSelector, value, index) { + this.add(_utilSubscribeToResult2['default'](this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapToSubscriber; + })(_OuterSubscriber3['default']); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/bindCallback", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = bindCallback; + function bindCallback(func, thisArg, argCount) { + if (typeof thisArg === 'undefined') { + return func; + } + switch (argCount) { + case 0: + return function() { + return func.call(thisArg); + }; + case 1: + return function(arg) { + return func.call(thisArg, arg); + }; + case 2: + return function(value, index) { + return func.call(thisArg, value, index); + }; + case 3: + return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/dematerialize", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = dematerialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() { + _classCallCheck(this, DeMaterializeOperator); + } + DeMaterializeOperator.prototype.call = function call(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_Subscriber) { + _inherits(DeMaterializeSubscriber, _Subscriber); + function DeMaterializeSubscriber(destination) { + _classCallCheck(this, DeMaterializeSubscriber); + _Subscriber.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function _next(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounce", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = debounce; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + _classCallCheck(this, DebounceOperator); + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function call(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_Subscriber) { + _inherits(DebounceSubscriber, _Subscriber); + function DebounceSubscriber(destination, durationSelector) { + _classCallCheck(this, DebounceSubscriber); + _Subscriber.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + DebounceSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = _utilTryCatch2['default'](this.durationSelector)(value); + if (debounce === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + if (typeof debounce.subscribe !== 'function' && typeof debounce.then === 'function') { + debounce = _observablesPromiseObservable2['default'].create(debounce); + } + this.lastValue = value; + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + _createClass(DebounceSubscriber, [{ + key: 'index', + get: function get() { + return this._index; + } + }]); + return DebounceSubscriber; + })(_Subscriber4['default']); + var DurationSelectorSubscriber = (function(_Subscriber2) { + _inherits(DurationSelectorSubscriber, _Subscriber2); + function DurationSelectorSubscriber(parent, currentIndex) { + _classCallCheck(this, DurationSelectorSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function debounceNext() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function _next(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function _complete() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/debounceTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = debounceTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function debounceTime(dueTime) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + _classCallCheck(this, DebounceTimeOperator); + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function call(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_Subscriber) { + _inherits(DebounceTimeSubscriber, _Subscriber); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _classCallCheck(this, DebounceTimeSubscriber); + _Subscriber.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function _next(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function _complete() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function debouncedNext() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function clearDebounce() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = defaultIfEmpty; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function defaultIfEmpty() { + var defaultValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + _classCallCheck(this, DefaultIfEmptyOperator); + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function call(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_Subscriber) { + _inherits(DefaultIfEmptySubscriber, _Subscriber); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _classCallCheck(this, DefaultIfEmptySubscriber); + _Subscriber.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function _next(x) { + this.isEmpty = false; + this.destination.next(x); + }; + DefaultIfEmptySubscriber.prototype._complete = function _complete() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = isDate; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = distinctUntilChanged; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function distinctUntilChanged(compare, thisArg) { + return this.lift(new DistinctUntilChangedOperator(thisArg ? _utilBindCallback2['default'](compare, thisArg, 2) : compare)); + } + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + _classCallCheck(this, DistinctUntilChangedOperator); + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function call(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_Subscriber) { + _inherits(DistinctUntilChangedSubscriber, _Subscriber); + function DistinctUntilChangedSubscriber(destination, compare) { + _classCallCheck(this, DistinctUntilChangedSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function compare(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function _next(x) { + var result = false; + if (this.hasValue) { + result = _utilTryCatch2['default'](this.compare)(this.value, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = x; + this.destination.next(x); + } + }; + return DistinctUntilChangedSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/do", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _do; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next = undefined; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || _utilNoop2['default'], error || _utilNoop2['default'], complete || _utilNoop2['default'])); + } + var DoOperator = (function() { + function DoOperator(next, error, complete) { + _classCallCheck(this, DoOperator); + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function call(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_Subscriber) { + _inherits(DoSubscriber, _Subscriber); + function DoSubscriber(destination, next, error, complete) { + _classCallCheck(this, DoSubscriber); + _Subscriber.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.__next)(x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function _error(e) { + var result = _utilTryCatch2['default'](this.__error)(e); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function _complete() { + var result = _utilTryCatch2['default'](this.__complete)(); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var ExpandOperator = (function() { + function ExpandOperator(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + _classCallCheck(this, ExpandOperator); + this.project = project; + this.concurrent = concurrent; + } + ExpandOperator.prototype.call = function call(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_OuterSubscriber) { + _inherits(ExpandSubscriber, _OuterSubscriber); + function ExpandSubscriber(destination, project) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + _classCallCheck(this, ExpandSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.prototype._next = function _next(value) { + var index = this.index++; + this.destination.next(value); + if (this.active < this.concurrent) { + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(_utilSubscribeToResult2['default'](this, result, value, index)); + } + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(_OuterSubscriber3['default']); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/filter", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = filter; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + _classCallCheck(this, FilterOperator); + this.select = _utilBindCallback2['default'](select, thisArg, 2); + } + FilterOperator.prototype.call = function call(subscriber) { + return new FilterSubscriber(subscriber, this.select); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_Subscriber) { + _inherits(FilterSubscriber, _Subscriber); + function FilterSubscriber(destination, select) { + _classCallCheck(this, FilterSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.select)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/finally", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _finally; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function _finally(finallySelector, thisArg) { + return this.lift(new FinallyOperator(thisArg ? _utilBindCallback2['default'](finallySelector, thisArg, 2) : finallySelector)); + } + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + _classCallCheck(this, FinallyOperator); + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function call(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_Subscriber) { + _inherits(FinallySubscriber, _Subscriber); + function FinallySubscriber(destination, finallySelector) { + _classCallCheck(this, FinallySubscriber); + _Subscriber.call(this, destination); + this.add(new _Subscription2['default'](finallySelector)); + } + return FinallySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var EmptyError = function EmptyError() { + _classCallCheck(this, EmptyError); + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + }; + ; + exports['default'] = EmptyError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var SubjectSubscription = (function(_Subscription) { + _inherits(SubjectSubscription, _Subscription); + function SubjectSubscription(subject, observer) { + _classCallCheck(this, SubjectSubscription); + _Subscription.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function unsubscribe() { + if (this.isUnsubscribed) { + return ; + } + this.isUnsubscribed = true; + var subject = this.subject; + var observers = subject.observers; + this.subject = void 0; + if (!observers || observers.length === 0 || subject.isUnsubscribed) { + return ; + } + if (this.observer instanceof _Subscriber2['default']) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(_Subscription3['default']); + exports['default'] = SubjectSubscription; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/Map", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _root = require("@reactivex/rxjs/dist/cjs/util/root"); + exports['default'] = _root.root.Map || (function() { + function Map() { + this.size = 0; + this._values = []; + this._keys = []; + } + Map.prototype['delete'] = function(key) { + var i = this._keys.indexOf(key); + if (i === -1) { + return false; + } + this._values.splice(i, 1); + this._keys.splice(i, 1); + this.size--; + return true; + }; + Map.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + Map.prototype.set = function(key, value) { + var i = this._keys.indexOf(key); + if (i === -1) { + this._keys.push(key); + this._values.push(value); + this.size++; + } else { + this._values[i] = value; + } + return this; + }; + Map.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return Map; + })(); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var FastMap = (function() { + function FastMap() { + _classCallCheck(this, FastMap); + this.size = 0; + this._values = {}; + } + FastMap.prototype["delete"] = function _delete(key) { + this._values[key] = null; + return true; + }; + FastMap.prototype.set = function set(key, value) { + this._values[key] = value; + return this; + }; + FastMap.prototype.get = function get(key) { + return this._values[key]; + }; + FastMap.prototype.forEach = function forEach(cb, thisArg) { + var values = this._values; + for (var key in values) { + if (values.hasOwnProperty(key) && values[key] !== null) { + cb.call(thisArg, values[key], key); + } + } + }; + FastMap.prototype.clear = function clear() { + this._values = {}; + }; + return FastMap; + })(); + exports["default"] = FastMap; + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy-support", ["@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var RefCountSubscription = (function(_Subscription) { + _inherits(RefCountSubscription, _Subscription); + function RefCountSubscription() { + _classCallCheck(this, RefCountSubscription); + _Subscription.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function setPrimary(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _Subscription.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_Observable) { + _inherits(GroupedObservable, _Observable); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _classCallCheck(this, GroupedObservable); + _Observable.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function _subscribe(subscriber) { + var subscription = new _Subscription4['default'](); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(_Observable3['default']); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_Subscription2) { + _inherits(InnerRefCountSubscription, _Subscription2); + function InnerRefCountSubscription(parent) { + _classCallCheck(this, InnerRefCountSubscription); + _Subscription2.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function unsubscribe() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _Subscription2.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(_Subscription4['default']); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/ignoreElements", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = ignoreElements; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() { + _classCallCheck(this, IgnoreElementsOperator); + } + IgnoreElementsOperator.prototype.call = function call(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_Subscriber) { + _inherits(IgnoreElementsSubscriber, _Subscriber); + function IgnoreElementsSubscriber() { + _classCallCheck(this, IgnoreElementsSubscriber); + _Subscriber.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function _next() {}; + return IgnoreElementsSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/every", ["@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = every; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function every(predicate, thisArg) { + var source = this; + var result = undefined; + if (source._isScalar) { + result = _utilTryCatch2['default'](predicate)(source.value, 0, source); + if (result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](result, source.scheduler); + } + } + if (source instanceof _observablesArrayObservable2['default']) { + var array = source.array; + var _result = _utilTryCatch2['default'](function(array, predicate) { + return array.every(predicate); + })(array, predicate); + if (_result === _utilErrorObject.errorObject) { + return new _observablesErrorObservable2['default'](_utilErrorObject.errorObject.e, source.scheduler); + } else { + return new _observablesScalarObservable2['default'](_result, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + _classCallCheck(this, EveryOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function call(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_Subscriber) { + _inherits(EverySubscriber, _Subscriber); + function EverySubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, EverySubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.predicate = undefined; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + EverySubscriber.prototype.notifyComplete = function notifyComplete(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + if (predicate === undefined) { + this.destination.error(new TypeError('predicate must be a function')); + } + var result = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function _complete() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/last", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = last; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function call(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_Subscriber) { + _inherits(LastSubscriber, _Subscriber); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, LastSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.hasValue = false; + this.index = 0; + if (typeof defaultValue !== 'undefined') { + this.lastValue = defaultValue; + this.hasValue = true; + } + } + LastSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var destination = this.destination; + var index = this.index++; + if (predicate) { + var found = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (found === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return LastSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/map", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = map; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function map(project, thisArg) { + return this.lift(new MapOperator(project, thisArg)); + } + var MapOperator = (function() { + function MapOperator(project, thisArg) { + _classCallCheck(this, MapOperator); + this.project = _utilBindCallback2['default'](project, thisArg, 2); + } + MapOperator.prototype.call = function call(subscriber) { + return new MapSubscriber(subscriber, this.project); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_Subscriber) { + _inherits(MapSubscriber, _Subscriber); + function MapSubscriber(destination, project) { + _classCallCheck(this, MapSubscriber); + _Subscriber.call(this, destination); + this.count = 0; + this.project = project; + } + MapSubscriber.prototype._next = function _next(x) { + var result = _utilTryCatch2['default'](this.project)(x, this.count++); + if (result === _utilErrorObject.errorObject) { + this.error(_utilErrorObject.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mapTo", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + var MapToOperator = (function() { + function MapToOperator(value) { + _classCallCheck(this, MapToOperator); + this.value = value; + } + MapToOperator.prototype.call = function call(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_Subscriber) { + _inherits(MapToSubscriber, _Subscriber); + function MapToSubscriber(destination, value) { + _classCallCheck(this, MapToSubscriber); + _Subscriber.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function _next(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/materialize", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = materialize; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + function materialize() { + return this.lift(new MaterializeOperator()); + } + var MaterializeOperator = (function() { + function MaterializeOperator() { + _classCallCheck(this, MaterializeOperator); + } + MaterializeOperator.prototype.call = function call(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_Subscriber) { + _inherits(MaterializeSubscriber, _Subscriber); + function MaterializeSubscriber(destination) { + _classCallCheck(this, MaterializeSubscriber); + _Subscriber.call(this, destination); + } + MaterializeSubscriber.prototype._next = function _next(value) { + this.destination.next(_Notification2['default'].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function _error(err) { + var destination = this.destination; + destination.next(_Notification2['default'].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + destination.next(_Notification2['default'].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge", ["@reactivex/rxjs/dist/cjs/operators/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _mergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _mergeStatic2 = _interopRequireDefault(_mergeStatic); + function merge() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _mergeStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll", ["@reactivex/rxjs/dist/cjs/operators/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeAll; + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + function mergeAll() { + var concurrent = arguments.length <= 0 || arguments[0] === undefined ? Number.POSITIVE_INFINITY : arguments[0]; + return this.lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function mergeMap(project, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapSupport.MergeMapOperator(project, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/mergeMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = mergeMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector) { + var concurrent = arguments.length <= 2 || arguments[2] === undefined ? Number.POSITIVE_INFINITY : arguments[2]; + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, resultSelector, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable3 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable4 = _interopRequireDefault(_Observable3); + var _Subscription3 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription4 = _interopRequireDefault(_Subscription3); + var ConnectableObservable = (function(_Observable) { + _inherits(ConnectableObservable, _Observable); + function ConnectableObservable(source, subjectFactory) { + _classCallCheck(this, ConnectableObservable); + _Observable.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function _subscribe(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function _getSubject() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return this.subject = this.subjectFactory(); + }; + ConnectableObservable.prototype.connect = function connect() { + var source = this.source; + var subscription = this.subscription; + if (subscription && !subscription.isUnsubscribed) { + return subscription; + } + subscription = source.subscribe(this._getSubject()); + subscription.add(new ConnectableSubscription(this)); + return this.subscription = subscription; + }; + ConnectableObservable.prototype.refCount = function refCount() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(_Observable4['default']); + exports['default'] = ConnectableObservable; + var ConnectableSubscription = (function(_Subscription) { + _inherits(ConnectableSubscription, _Subscription); + function ConnectableSubscription(connectable) { + _classCallCheck(this, ConnectableSubscription); + _Subscription.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function _unsubscribe() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(_Subscription4['default']); + var RefCountObservable = (function(_Observable2) { + _inherits(RefCountObservable, _Observable2); + function RefCountObservable(connectable) { + var refCount = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, RefCountObservable); + _Observable2.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function _subscribe(subscriber) { + var connectable = this.connectable; + var subscription = connectable.subscribe(subscriber); + if (++this.refCount === 1) { + this.connection = connectable.connect(); + } + subscription.add(new RefCountSubscription(this)); + return subscription; + }; + return RefCountObservable; + })(_Observable4['default']); + var RefCountSubscription = (function(_Subscription2) { + _inherits(RefCountSubscription, _Subscription2); + function RefCountSubscription(refCountObservable) { + _classCallCheck(this, RefCountSubscription); + _Subscription2.call(this); + this.refCountObservable = refCountObservable; + } + RefCountSubscription.prototype._unsubscribe = function _unsubscribe() { + var observable = this.refCountObservable; + if (--observable.refCount === 0) { + observable.connection.unsubscribe(); + observable.connection = void 0; + } + }; + return RefCountSubscription; + })(_Subscription4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn", ["@reactivex/rxjs/dist/cjs/operators/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = observeOn; + var _observeOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + function observeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new _observeOnSupport.ObserveOnOperator(scheduler, delay)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + "use strict"; + exports.__esModule = true; + exports["default"] = not; + function not(pred, thisArg) { + function notPred() { + return !notPred.pred.apply(notPred.thisArg, arguments); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + module.exports = exports["default"]; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publish", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publish; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function subjectFactory() { + return new _Subject2['default'](); + } + function publish() { + return _multicast2['default'].call(this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", ["@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var BehaviorSubject = (function(_Subject) { + _inherits(BehaviorSubject, _Subject); + function BehaviorSubject(value) { + _classCallCheck(this, BehaviorSubject); + _Subject.call(this); + this.value = value; + } + BehaviorSubject.prototype._subscribe = function _subscribe(subscriber) { + var subscription = _Subject.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this.value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function _next(value) { + _Subject.prototype._next.call(this, this.value = value); + }; + return BehaviorSubject; + })(_Subject3['default']); + exports['default'] = BehaviorSubject; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", ["@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subject2 = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject3 = _interopRequireDefault(_Subject2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var ReplaySubject = (function(_Subject) { + _inherits(ReplaySubject, _Subject); + function ReplaySubject(bufferSize, _windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (_windowTime === undefined) + _windowTime = Number.POSITIVE_INFINITY; + _classCallCheck(this, ReplaySubject); + _Subject.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = _windowTime < 1 ? 1 : _windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function _next(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + _Subject.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function _subscribe(subscriber) { + var events = this._getEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _Subject.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function _getNow() { + return (this.scheduler || _schedulersImmediate2['default']).now(); + }; + ReplaySubject.prototype._getEvents = function _getEvents(now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + while (spliceCount < eventsCount) { + if (now - events[spliceCount].time < _windowTime) { + break; + } + spliceCount += 1; + } + if (eventsCount > bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - bufferSize); + } + if (spliceCount > 0) { + events.splice(0, spliceCount); + } + return events; + }; + return ReplaySubject; + })(_Subject3['default']); + exports['default'] = ReplaySubject; + var ReplayEvent = function ReplayEvent(time, value) { + _classCallCheck(this, ReplayEvent); + this.time = time; + this.value = value; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, acc) { + _classCallCheck(this, ReduceOperator); + this.acc = acc; + this.project = project; + } + ReduceOperator.prototype.call = function call(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.acc); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_Subscriber) { + _inherits(ReduceSubscriber, _Subscriber); + function ReduceSubscriber(destination, project, acc) { + _classCallCheck(this, ReduceSubscriber); + _Subscriber.call(this, destination); + this.hasValue = false; + this.acc = acc; + this.project = project; + this.hasSeed = typeof acc !== 'undefined'; + } + ReduceSubscriber.prototype._next = function _next(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function _complete() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(_Subscriber3['default']); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/repeat", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = repeat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + function repeat() { + var count = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0]; + if (count === 0) { + return _observablesEmptyObservable2['default'].create(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + _classCallCheck(this, RepeatOperator); + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function call(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_Subscriber) { + _inherits(FirstRepeatSubscriber, _Subscriber); + function FirstRepeatSubscriber(destination, count, source) { + _classCallCheck(this, FirstRepeatSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + if (count === 0) { + this.destination.complete(); + _Subscriber.prototype.unsubscribe.call(this); + } + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function resubscribe(count) { + this.lastSubscription.unsubscribe(); + if (count - 1 === 0) { + this.destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + } + }; + return FirstRepeatSubscriber; + })(_Subscriber4['default']); + var MoreRepeatSubscriber = (function(_Subscriber2) { + _inherits(MoreRepeatSubscriber, _Subscriber2); + function MoreRepeatSubscriber(parent, count) { + _classCallCheck(this, MoreRepeatSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function _error(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function _complete() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retry", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retry; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function retry() { + var count = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + return this.lift(new RetryOperator(count, this)); + } + var RetryOperator = (function() { + function RetryOperator(count, source) { + _classCallCheck(this, RetryOperator); + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function call(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_Subscriber) { + _inherits(FirstRetrySubscriber, _Subscriber); + function FirstRetrySubscriber(destination, count, source) { + _classCallCheck(this, FirstRetrySubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.count = count; + this.source = source; + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function error(_error) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function _complete() { + _Subscriber.prototype.unsubscribe.call(this); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRetrySubscriber.prototype.resubscribe = function resubscribe() { + var retried = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + this.lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetrySubscriber; + })(_Subscriber4['default']); + var RetryMoreSubscriber = (function(_Subscriber2) { + _inherits(RetryMoreSubscriber, _Subscriber2); + function RetryMoreSubscriber(parent, count) { + var retried = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, RetryMoreSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function _error(err) { + var parent = this.parent; + var retried = this.retried; + var count = this.count; + if (count && retried === count) { + parent.destination.error(err); + } else { + parent.resubscribe(retried); + } + }; + RetryMoreSubscriber.prototype._complete = function _complete() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = retryWhen; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + _classCallCheck(this, RetryWhenOperator); + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function call(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_Subscriber) { + _inherits(FirstRetryWhenSubscriber, _Subscriber); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _classCallCheck(this, FirstRetryWhenSubscriber); + _Subscriber.call(this, null); + this.destination = destination; + this.notifier = notifier; + this.source = source; + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function error(err) { + if (!this.isUnsubscribed) { + _Subscriber.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new _Subject2['default'](); + var notifications = _utilTryCatch2['default'](this.notifier).call(this, this.errors); + if (notifications === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function destinationError(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function _complete() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function destinationComplete() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function unsubscribe() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _Subscriber.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function tearDown() { + _Subscriber.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function resubscribe() { + this.lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + }; + return FirstRetryWhenSubscriber; + })(_Subscriber5['default']); + var MoreRetryWhenSubscriber = (function(_Subscriber2) { + _inherits(MoreRetryWhenSubscriber, _Subscriber2); + function MoreRetryWhenSubscriber(parent) { + _classCallCheck(this, MoreRetryWhenSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function _next(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function _error(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(_Subscriber5['default']); + var RetryNotificationSubscriber = (function(_Subscriber3) { + _inherits(RetryNotificationSubscriber, _Subscriber3); + function RetryNotificationSubscriber(parent) { + _classCallCheck(this, RetryNotificationSubscriber); + _Subscriber3.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function _next(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function _error(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function _complete() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sample", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sample; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + var SampleOperator = (function() { + function SampleOperator(notifier) { + _classCallCheck(this, SampleOperator); + this.notifier = notifier; + } + SampleOperator.prototype.call = function call(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_Subscriber) { + _inherits(SampleSubscriber, _Subscriber); + function SampleSubscriber(destination, notifier) { + _classCallCheck(this, SampleSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNoficationSubscriber(this))); + } + SampleSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(_Subscriber4['default']); + var SampleNoficationSubscriber = (function(_Subscriber2) { + _inherits(SampleNoficationSubscriber, _Subscriber2); + function SampleNoficationSubscriber(parent) { + _classCallCheck(this, SampleNoficationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + SampleNoficationSubscriber.prototype._next = function _next() { + this.parent.notifyNext(); + }; + SampleNoficationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + SampleNoficationSubscriber.prototype._complete = function _complete() {}; + return SampleNoficationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = sampleTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function sampleTime(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + _classCallCheck(this, SampleTimeOperator); + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function call(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_Subscriber) { + _inherits(SampleTimeSubscriber, _Subscriber); + function SampleTimeSubscriber(destination, delay, scheduler) { + _classCallCheck(this, SampleTimeSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.hasValue = false; + this.add(scheduler.schedule(dispatchNotification, delay, { + subscriber: this, + delay: delay + })); + } + SampleTimeSubscriber.prototype._next = function _next(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function notifyNext() { + if (this.hasValue) { + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(_Subscriber3['default']); + function dispatchNotification(state) { + var subscriber = state.subscriber; + var delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/scan", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = scan; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function scan(project, acc) { + return this.lift(new ScanOperator(project, acc)); + } + var ScanOperator = (function() { + function ScanOperator(project, acc) { + _classCallCheck(this, ScanOperator); + this.acc = acc; + this.project = project; + } + ScanOperator.prototype.call = function call(subscriber) { + return new ScanSubscriber(subscriber, this.project, this.acc); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_Subscriber) { + _inherits(ScanSubscriber, _Subscriber); + function ScanSubscriber(destination, project, acc) { + _classCallCheck(this, ScanSubscriber); + _Subscriber.call(this, destination); + this.accumulatorSet = false; + this.acc = acc; + this.project = project; + this.accumulatorSet = typeof acc !== 'undefined'; + } + ScanSubscriber.prototype._next = function _next(x) { + if (!this.accumulatorSet) { + this.acc = x; + this.destination.next(x); + } else { + var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x); + if (result === _utilErrorObject.errorObject) { + this.destination.error(_utilErrorObject.errorObject.e); + } else { + this.acc = result; + this.destination.next(this.acc); + } + } + }; + _createClass(ScanSubscriber, [{ + key: 'acc', + get: function get() { + return this._acc; + }, + set: function set(value) { + this.accumulatorSet = true; + this._acc = value; + } + }]); + return ScanSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/share", ["@reactivex/rxjs/dist/cjs/operators/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = share; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _publish2 = _interopRequireDefault(_publish); + function share() { + return _publish2['default'].call(this).refCount(); + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareBehavior", ["@reactivex/rxjs/dist/cjs/operators/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _publishBehavior2 = _interopRequireDefault(_publishBehavior); + function shareBehavior(value) { + return _publishBehavior2['default'].call(this, value).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/shareReplay", ["@reactivex/rxjs/dist/cjs/operators/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = shareReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _publishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _publishReplay2 = _interopRequireDefault(_publishReplay); + function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _publishReplay2['default'].call(this, bufferSize, windowTime, scheduler).refCount(); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/single", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = single; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function single(predicate, thisArg) { + return this.lift(new SingleOperator(predicate, thisArg, this)); + } + var SingleOperator = (function() { + function SingleOperator(predicate, thisArg, source) { + _classCallCheck(this, SingleOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + SingleOperator.prototype.call = function call(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_Subscriber) { + _inherits(SingleSubscriber, _Subscriber); + function SingleSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, SingleSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.seenValue = false; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + SingleSubscriber.prototype.applySingleValue = function applySingleValue(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = _utilTryCatch2['default'](predicate)(value, currentIndex, this.source); + if (result === _utilErrorObject.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new _utilEmptyError2['default']()); + } + }; + return SingleSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skip", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + var SkipOperator = (function() { + function SkipOperator(total) { + _classCallCheck(this, SkipOperator); + this.total = total; + } + SkipOperator.prototype.call = function call(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_Subscriber) { + _inherits(SkipSubscriber, _Subscriber); + function SkipSubscriber(destination, total) { + _classCallCheck(this, SkipSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function _next(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = skipUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function skipUntil(total) { + return this.lift(new SkipUntilOperator(total)); + } + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + _classCallCheck(this, SkipUntilOperator); + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function call(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_Subscriber) { + _inherits(SkipUntilSubscriber, _Subscriber); + function SkipUntilSubscriber(destination, notifier) { + _classCallCheck(this, SkipUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new NotificationSubscriber(this); + this.add(this.notifier.subscribe(this.notificationSubscriber)); + } + SkipUntilSubscriber.prototype._next = function _next(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._complete = function _complete() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + return SkipUntilSubscriber; + })(_Subscriber4['default']); + var NotificationSubscriber = (function(_Subscriber2) { + _inherits(NotificationSubscriber, _Subscriber2); + function NotificationSubscriber(parent) { + _classCallCheck(this, NotificationSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function _next(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/startWith", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/operators/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = startWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _observablesScalarObservable2 = _interopRequireDefault(_observablesScalarObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _concatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _concatStatic2 = _interopRequireDefault(_concatStatic); + function startWith() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return _concatStatic2['default'](new _observablesScalarObservable2['default'](array[0], scheduler), this); + } else if (len > 1) { + return _concatStatic2['default'](new _observablesArrayObservable2['default'](array, scheduler), this); + } else { + return _concatStatic2['default'](new _observablesEmptyObservable2['default'](scheduler), this); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var SubscribeOnObservable = (function(_Observable) { + _inherits(SubscribeOnObservable, _Observable); + function SubscribeOnObservable(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + _classCallCheck(this, SubscribeOnObservable); + _Observable.call(this); + this.source = source; + this.delayTime = delay; + this.scheduler = scheduler; + } + SubscribeOnObservable.create = function create(source) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function dispatch(_ref) { + var source = _ref.source; + var subscriber = _ref.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function _subscribe(subscriber) { + var delay = this.delayTime; + var source = this.source; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(SubscribeOnObservable.dispatch, delay, { + source: source, + subscriber: subscriber + })); + }; + return SubscribeOnObservable; + })(_Observable3['default']); + exports['default'] = SubscribeOnObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switch", ["@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = _switch; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function _switch() { + return this.lift(new SwitchOperator()); + } + var SwitchOperator = (function() { + function SwitchOperator() { + _classCallCheck(this, SwitchOperator); + } + SwitchOperator.prototype.call = function call(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchSubscriber, _OuterSubscriber); + function SwitchSubscriber(destination) { + _classCallCheck(this, SwitchSubscriber); + _OuterSubscriber.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function _next(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, value)); + }; + SwitchSubscriber.prototype._complete = function _complete() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function unsubscribeInner() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function notifyComplete() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMap", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMap; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + _classCallCheck(this, SwitchMapOperator); + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function call(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapSubscriber, _OuterSubscriber); + function SwitchMapSubscriber(destination, project, resultSelector) { + _classCallCheck(this, SwitchMapSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var destination = this.destination; + var result = _utilTryCatch2['default'](this.project)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/switchMapTo", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = switchMapTo; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + _classCallCheck(this, SwitchMapToOperator); + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function call(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_OuterSubscriber) { + _inherits(SwitchMapToSubscriber, _OuterSubscriber); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _classCallCheck(this, SwitchMapToSubscriber); + _OuterSubscriber.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function _next(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = _utilSubscribeToResult2['default'](this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function _complete() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function notifyComplete(innerSub) { + this.remove(innerSub); + var prevSubscription = this.innerSubscription; + if (prevSubscription) { + prevSubscription.unsubscribe(); + } + this.innerSubscription = null; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyError = function notifyError(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function notifyNext(outerValue, innerValue, outerIndex, innerIndex) { + var resultSelector = this.resultSelector; + var destination = this.destination; + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/take", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = take; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function take(total) { + return this.lift(new TakeOperator(total)); + } + var TakeOperator = (function() { + function TakeOperator(total) { + _classCallCheck(this, TakeOperator); + this.total = total; + } + TakeOperator.prototype.call = function call(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_Subscriber) { + _inherits(TakeSubscriber, _Subscriber); + function TakeSubscriber(destination, total) { + _classCallCheck(this, TakeSubscriber); + _Subscriber.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function _next(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = takeUntil; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + _classCallCheck(this, TakeUntilOperator); + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function call(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_Subscriber) { + _inherits(TakeUntilSubscriber, _Subscriber); + function TakeUntilSubscriber(destination, notifier) { + _classCallCheck(this, TakeUntilSubscriber); + _Subscriber.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(_Subscriber4['default']); + var TakeUntilInnerSubscriber = (function(_Subscriber2) { + _inherits(TakeUntilInnerSubscriber, _Subscriber2); + function TakeUntilInnerSubscriber(destination) { + _classCallCheck(this, TakeUntilInnerSubscriber); + _Subscriber2.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function _next() { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function _error(e) { + this.destination.error(e); + }; + TakeUntilInnerSubscriber.prototype._complete = function _complete() {}; + return TakeUntilInnerSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/throttle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = throttle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function throttle(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return this.lift(new ThrottleOperator(delay, scheduler)); + } + var ThrottleOperator = (function() { + function ThrottleOperator(delay, scheduler) { + _classCallCheck(this, ThrottleOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleOperator.prototype.call = function call(subscriber) { + return new ThrottleSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_Subscriber) { + _inherits(ThrottleSubscriber, _Subscriber); + function ThrottleSubscriber(destination, delay, scheduler) { + _classCallCheck(this, ThrottleSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleSubscriber.prototype._next = function _next(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { + value: value, + subscriber: this + })); + } + }; + ThrottleSubscriber.prototype.throttledNext = function throttledNext(value) { + this.clearThrottle(); + this.destination.next(value); + }; + ThrottleSubscriber.prototype.clearThrottle = function clearThrottle() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + } + }; + return ThrottleSubscriber; + })(_Subscriber3['default']); + function dispatchNext(_ref) { + var value = _ref.value; + var subscriber = _ref.subscriber; + subscriber.throttledNext(value); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeout", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeout; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function timeout(due) { + var errorToSend = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + _classCallCheck(this, TimeoutOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function call(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_Subscriber) { + _inherits(TimeoutSubscriber, _Subscriber); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _classCallCheck(this, TimeoutSubscriber); + _Subscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function _next(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function _error(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function _complete() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function notifyTimeout() { + this.error(this.errorToSend || new Error('timeout')); + }; + _createClass(TimeoutSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith", ["@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + exports['default'] = timeoutWith; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function timeoutWith(due, withObservable) { + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersImmediate2['default'] : arguments[2]; + var absoluteTimeout = _utilIsDate2['default'](due); + var waitFor = absoluteTimeout ? +due - scheduler.now() : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithOperator); + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function call(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_OuterSubscriber) { + _inherits(TimeoutWithSubscriber, _OuterSubscriber); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _classCallCheck(this, TimeoutWithSubscriber); + _OuterSubscriber.call(this, destination); + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.timedOut = false; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + this.scheduleTimeout(); + } + TimeoutWithSubscriber.dispatchTimeout = function dispatchTimeout(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function scheduleTimeout() { + var currentIndex = this.index; + var timeoutState = { + subscriber: this, + index: currentIndex + }; + this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutWithSubscriber.prototype._next = function _next(value) { + if (!this.timedOut) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + } + }; + TimeoutWithSubscriber.prototype._error = function _error(err) { + if (!this.timedOut) { + this.destination.error(err); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype._complete = function _complete() { + if (!this.timedOut) { + this.destination.complete(); + this._hasCompleted = true; + } + }; + TimeoutWithSubscriber.prototype.handleTimeout = function handleTimeout() { + var withObservable = this.withObservable; + this.timedOut = true; + this.add(this.timeoutSubscription = _utilSubscribeToResult2['default'](this, withObservable)); + }; + _createClass(TimeoutWithSubscriber, [{ + key: 'previousIndex', + get: function get() { + return this._previousIndex; + } + }, { + key: 'hasCompleted', + get: function get() { + return this._hasCompleted; + } + }]); + return TimeoutWithSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toArray", ["@reactivex/rxjs/dist/cjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toArray; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + function toArray() { + return this.lift(new ToArrayOperator()); + } + var ToArrayOperator = (function() { + function ToArrayOperator() { + _classCallCheck(this, ToArrayOperator); + } + ToArrayOperator.prototype.call = function call(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_Subscriber) { + _inherits(ToArraySubscriber, _Subscriber); + function ToArraySubscriber(destination) { + _classCallCheck(this, ToArraySubscriber); + _Subscriber.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function _next(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function _complete() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/toPromise", ["@reactivex/rxjs/dist/cjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = toPromise; + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value = undefined; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/window", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + _classCallCheck(this, WindowOperator); + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingNotifier) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingNotifier = closingNotifier; + this.window = new _Subject2['default'](); + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowCount", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowCount; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + function windowCount(windowSize) { + var startWindowEvery = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountOperator); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function call(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_Subscriber) { + _inherits(WindowCountSubscriber, _Subscriber); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _classCallCheck(this, WindowCountSubscriber); + _Subscriber.call(this, destination); + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new _Subject2['default']()]; + this.count = 0; + destination.next(this.windows[0]); + } + WindowCountSubscriber.prototype._next = function _next(value) { + var startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize; + var windowSize = this.windowSize; + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + var c = this.count - windowSize + 1; + if (c >= 0 && c % startWindowEvery === 0) { + windows.shift().complete(); + } + if (++this.count % startWindowEvery === 0) { + var _window = new _Subject2['default'](); + windows.push(_window); + this.destination.next(_window); + } + }; + WindowCountSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowTime", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowTime; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + function windowTime(windowTimeSpan) { + var windowCreationInterval = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var scheduler = arguments.length <= 2 || arguments[2] === undefined ? _schedulersNextTick2['default'] : arguments[2]; + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeOperator); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function call(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_Subscriber) { + _inherits(WindowTimeSubscriber, _Subscriber); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _classCallCheck(this, WindowTimeSubscriber); + _Subscriber.call(this, destination); + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var _window = this.openWindow(); + var closeState = { + subscriber: this, + window: _window, + context: null + }; + var creationState = { + windowTimeSpan: windowTimeSpan, + windowCreationInterval: windowCreationInterval, + subscriber: this, + scheduler: scheduler + }; + this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); + this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); + } else { + var _window2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: _window2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function _next(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function _error(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function _complete() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function openWindow() { + var window = new _Subject2['default'](); + this.windows.push(window); + this.destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function closeWindow(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(_Subscriber3['default']); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber; + var windowTimeSpan = state.windowTimeSpan; + var window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan; + var subscriber = state.subscriber; + var scheduler = state.scheduler; + var windowCreationInterval = state.windowCreationInterval; + var window = subscriber.openWindow(); + var action = this; + var context = { + action: action, + subscription: null + }; + var timeSpanState = { + subscriber: subscriber, + window: window, + context: context + }; + context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); + action.add(context.subscription); + action.schedule(state, windowCreationInterval); + } + function dispatchWindowClose(_ref) { + var subscriber = _ref.subscriber; + var window = _ref.window; + var context = _ref.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = windowToggle; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber4 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber5 = _interopRequireDefault(_Subscriber4); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + _classCallCheck(this, WindowToggleOperator); + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function call(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_Subscriber) { + _inherits(WindowToggleSubscriber, _Subscriber); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _classCallCheck(this, WindowToggleSubscriber); + _Subscriber.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function _next(value) { + var contexts = this.contexts; + var len = contexts.length; + for (var i = 0; i < len; i++) { + contexts[i].window.next(value); + } + }; + WindowToggleSubscriber.prototype._error = function _error(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function _complete() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.window.complete(); + context.subscription.unsubscribe(); + } + this.destination.complete(); + }; + WindowToggleSubscriber.prototype.openWindow = function openWindow(value) { + var closingSelector = this.closingSelector; + var closingNotifier = _utilTryCatch2['default'](closingSelector)(value); + if (closingNotifier === _utilErrorObject.errorObject) { + this.error(closingNotifier.e); + } else { + var context = { + window: new _Subject2['default'](), + subscription: new _Subscription2['default']() + }; + this.contexts.push(context); + this.destination.next(context.window); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + this.add(context.subscription.add(subscription)); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) { + var window = context.window; + var subscription = context.subscription; + var contexts = this.contexts; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + this.remove(subscription); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(_Subscriber5['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(_Subscriber5['default']); + var WindowToggleOpeningsSubscriber = (function(_Subscriber3) { + _inherits(WindowToggleOpeningsSubscriber, _Subscriber3); + function WindowToggleOpeningsSubscriber(parent) { + _classCallCheck(this, WindowToggleOpeningsSubscriber); + _Subscriber3.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function _next(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {}; + return WindowToggleOpeningsSubscriber; + })(_Subscriber5['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = window; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function window(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + _classCallCheck(this, WindowOperator); + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function call(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_Subscriber) { + _inherits(WindowSubscriber, _Subscriber); + function WindowSubscriber(destination, closingSelector) { + _classCallCheck(this, WindowSubscriber); + _Subscriber.call(this, destination); + this.closingSelector = closingSelector; + this.window = new _Subject2['default'](); + this.openWindow(); + } + WindowSubscriber.prototype._next = function _next(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function _error(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function _complete() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function openWindow() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + this.destination.next(this.window = new _Subject2['default']()); + var closingNotifier = _utilTryCatch2['default'](this.closingSelector)(); + if (closingNotifier === _utilErrorObject.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new _Subscription2['default'](); + this.add(closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this)))); + } + }; + return WindowSubscriber; + })(_Subscriber4['default']); + var WindowClosingNotifierSubscriber = (function(_Subscriber2) { + _inherits(WindowClosingNotifierSubscriber, _Subscriber2); + function WindowClosingNotifierSubscriber(parent) { + _classCallCheck(this, WindowClosingNotifierSubscriber); + _Subscriber2.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function _next() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function _error(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function _complete() {}; + return WindowClosingNotifierSubscriber; + })(_Subscriber4['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = withLatestFrom; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + function withLatestFrom() { + var project = undefined; + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + _classCallCheck(this, WithLatestFromOperator); + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function call(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_OuterSubscriber) { + _inherits(WithLatestFromSubscriber, _OuterSubscriber); + function WithLatestFromSubscriber(destination, observables, project) { + _classCallCheck(this, WithLatestFromSubscriber); + _OuterSubscriber.call(this, destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + var len = observables.length; + this.values = new Array(len); + for (var i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function notifyNext(observable, value, observableIndex, index) { + this.values[observableIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(observableIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + }; + WithLatestFromSubscriber.prototype.notifyComplete = function notifyComplete() {}; + WithLatestFromSubscriber.prototype._next = function _next(value) { + if (this.toRespond.length === 0) { + var values = this.values; + var destination = this.destination; + var project = this.project; + var args = [value].concat(values); + if (project) { + var result = _utilTryCatch2['default'](this.project).apply(this, args); + if (result === _utilErrorObject.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(_OuterSubscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip", ["@reactivex/rxjs/dist/cjs/operators/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipProto; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _zipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _zipStatic2 = _interopRequireDefault(_zipStatic); + function zipProto() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + observables.unshift(this); + return _zipStatic2['default'].apply(this, observables); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zipAll", ["@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zipAll; + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zipAll(project) { + return this.lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var ArgumentOutOfRangeError = function ArgumentOutOfRangeError() { + _classCallCheck(this, ArgumentOutOfRangeError); + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + }; + ; + exports['default'] = ArgumentOutOfRangeError; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var InvalidPipeArgumentException = (function(_super) { + __extends(InvalidPipeArgumentException, _super); + function InvalidPipeArgumentException(type, value) { + _super.call(this, "Invalid argument '" + value + "' for pipe '" + type + "'"); + } + return InvalidPipeArgumentException; + })(exceptions_1.BaseException); + exports.InvalidPipeArgumentException = InvalidPipeArgumentException; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var UpperCasePipe = (function() { + function UpperCasePipe() {} + UpperCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); + } + return value.toUpperCase(); + }; + UpperCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'uppercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); + return UpperCasePipe; + })(); + exports.UpperCasePipe = UpperCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var LowerCasePipe = (function() { + function LowerCasePipe() {} + LowerCasePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(value)) + return value; + if (!lang_1.isString(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); + } + return value.toLowerCase(); + }; + LowerCasePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'lowercase'}), di_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); + return LowerCasePipe; + })(); + exports.LowerCasePipe = LowerCasePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var JsonPipe = (function() { + function JsonPipe() {} + JsonPipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + return lang_1.Json.stringify(value); + }; + JsonPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'json', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); + return JsonPipe; + })(); + exports.JsonPipe = JsonPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/common/pipes/invalid_pipe_argument_exception", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var metadata_1 = require("angular2/src/core/metadata"); + var SlicePipe = (function() { + function SlicePipe() {} + SlicePipe.prototype.transform = function(value, args) { + if (args === void 0) { + args = null; + } + if (lang_1.isBlank(args) || args.length == 0) { + throw new exceptions_1.BaseException('Slice pipe requires one argument'); + } + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); + } + if (lang_1.isBlank(value)) + return value; + var start = args[0]; + var end = args.length > 1 ? args[1] : null; + if (lang_1.isString(value)) { + return lang_1.StringWrapper.slice(value, start, end); + } + return collection_1.ListWrapper.slice(value, start, end); + }; + SlicePipe.prototype.supports = function(obj) { + return lang_1.isString(obj) || lang_1.isArray(obj); + }; + SlicePipe = __decorate([metadata_1.Pipe({ + name: 'slice', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); + return SlicePipe; + })(); + exports.SlicePipe = SlicePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(NumberFormatStyle) { + NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; + NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; + NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; + })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); + var NumberFormatStyle = exports.NumberFormatStyle; + var NumberFormatter = (function() { + function NumberFormatter() {} + NumberFormatter.format = function(num, locale, style, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.minimumIntegerDigits, + minimumIntegerDigits = _c === void 0 ? 1 : _c, + _d = _b.minimumFractionDigits, + minimumFractionDigits = _d === void 0 ? 0 : _d, + _e = _b.maximumFractionDigits, + maximumFractionDigits = _e === void 0 ? 3 : _e, + currency = _b.currency, + _f = _b.currencyAsSymbol, + currencyAsSymbol = _f === void 0 ? false : _f; + var intlOptions = { + minimumIntegerDigits: minimumIntegerDigits, + minimumFractionDigits: minimumFractionDigits, + maximumFractionDigits: maximumFractionDigits + }; + intlOptions.style = NumberFormatStyle[style].toLowerCase(); + if (style == NumberFormatStyle.Currency) { + intlOptions.currency = currency; + intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; + } + return new Intl.NumberFormat(locale, intlOptions).format(num); + }; + return NumberFormatter; + })(); + exports.NumberFormatter = NumberFormatter; + function digitCondition(len) { + return len == 2 ? '2-digit' : 'numeric'; + } + function nameCondition(len) { + return len < 4 ? 'short' : 'long'; + } + function extractComponents(pattern) { + var ret = {}; + var i = 0, + j; + while (i < pattern.length) { + j = i; + while (j < pattern.length && pattern[j] == pattern[i]) + j++; + var len = j - i; + switch (pattern[i]) { + case 'G': + ret.era = nameCondition(len); + break; + case 'y': + ret.year = digitCondition(len); + break; + case 'M': + if (len >= 3) + ret.month = nameCondition(len); + else + ret.month = digitCondition(len); + break; + case 'd': + ret.day = digitCondition(len); + break; + case 'E': + ret.weekday = nameCondition(len); + break; + case 'j': + ret.hour = digitCondition(len); + break; + case 'h': + ret.hour = digitCondition(len); + ret.hour12 = true; + break; + case 'H': + ret.hour = digitCondition(len); + ret.hour12 = false; + break; + case 'm': + ret.minute = digitCondition(len); + break; + case 's': + ret.second = digitCondition(len); + break; + case 'z': + ret.timeZoneName = 'long'; + break; + case 'Z': + ret.timeZoneName = 'short'; + break; + } + i = j; + } + return ret; + } + var dateFormatterCache = new Map(); + var DateFormatter = (function() { + function DateFormatter() {} + DateFormatter.format = function(date, locale, pattern) { + var key = locale + pattern; + if (dateFormatterCache.has(key)) { + return dateFormatterCache.get(key).format(date); + } + var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); + dateFormatterCache.set(key, formatter); + return formatter.format(date); + }; + return DateFormatter; + })(); + exports.DateFormatter = DateFormatter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); + var NumberPipe = (function() { + function NumberPipe() {} + NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { + if (currency === void 0) { + currency = null; + } + if (currencyAsSymbol === void 0) { + currencyAsSymbol = false; + } + if (lang_1.isBlank(value)) + return null; + if (!lang_1.isNumber(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); + } + var minInt = 1, + minFraction = 0, + maxFraction = 3; + if (lang_1.isPresent(digits)) { + var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); + if (lang_1.isBlank(parts)) { + throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); + } + if (lang_1.isPresent(parts[1])) { + minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); + } + if (lang_1.isPresent(parts[3])) { + minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); + } + if (lang_1.isPresent(parts[5])) { + maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); + } + } + return intl_1.NumberFormatter.format(value, defaultLocale, style, { + minimumIntegerDigits: minInt, + minimumFractionDigits: minFraction, + maximumFractionDigits: maxFraction, + currency: currency, + currencyAsSymbol: currencyAsSymbol + }); + }; + NumberPipe = __decorate([lang_1.CONST(), di_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); + return NumberPipe; + })(); + exports.NumberPipe = NumberPipe; + var DecimalPipe = (function(_super) { + __extends(DecimalPipe, _super); + function DecimalPipe() { + _super.apply(this, arguments); + } + DecimalPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); + }; + DecimalPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'number'}), di_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); + return DecimalPipe; + })(NumberPipe); + exports.DecimalPipe = DecimalPipe; + var PercentPipe = (function(_super) { + __extends(PercentPipe, _super); + function PercentPipe() { + _super.apply(this, arguments); + } + PercentPipe.prototype.transform = function(value, args) { + var digits = collection_1.ListWrapper.first(args); + return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); + }; + PercentPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'percent'}), di_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); + return PercentPipe; + })(NumberPipe); + exports.PercentPipe = PercentPipe; + var CurrencyPipe = (function(_super) { + __extends(CurrencyPipe, _super); + function CurrencyPipe() { + _super.apply(this, arguments); + } + CurrencyPipe.prototype.transform = function(value, args) { + var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; + var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; + var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; + return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); + }; + CurrencyPipe = __decorate([lang_1.CONST(), metadata_1.Pipe({name: 'currency'}), di_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); + return CurrencyPipe; + })(NumberPipe); + exports.CurrencyPipe = CurrencyPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Type = lang_1.Type; + var async_1 = require("angular2/src/facade/async"); + exports.Observable = async_1.Observable; + exports.EventEmitter = async_1.EventEmitter; + var exceptions_1 = require("angular2/src/facade/exceptions"); + exports.WrappedException = exceptions_1.WrappedException; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_1.ExceptionHandler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var profile_1 = require("angular2/src/core/profile/profile"); + var NgZoneError = (function() { + function NgZoneError(error, stackTrace) { + this.error = error; + this.stackTrace = stackTrace; + } + return NgZoneError; + })(); + exports.NgZoneError = NgZoneError; + var NgZone = (function() { + function NgZone(_a) { + var enableLongStackTrace = _a.enableLongStackTrace; + this._runScope = profile_1.wtfCreateScope("NgZone#run()"); + this._microtaskScope = profile_1.wtfCreateScope("NgZone#microtask()"); + this._pendingMicrotasks = 0; + this._hasExecutedCodeInInnerZone = false; + this._nestedRun = 0; + this._inVmTurnDone = false; + this._pendingTimeouts = []; + if (lang_1.global.zone) { + this._disabled = false; + this._mountZone = lang_1.global.zone; + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); + } else { + this._disabled = true; + this._mountZone = null; + } + this._onTurnStartEvents = new async_1.EventEmitter(false); + this._onTurnDoneEvents = new async_1.EventEmitter(false); + this._onEventDoneEvents = new async_1.EventEmitter(false); + this._onErrorEvents = new async_1.EventEmitter(false); + } + NgZone.prototype.overrideOnTurnStart = function(onTurnStartHook) { + this._onTurnStart = lang_1.normalizeBlank(onTurnStartHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnStart", { + get: function() { + return this._onTurnStartEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnStart = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnStartEvents.next(null); + }); + }; + NgZone.prototype.overrideOnTurnDone = function(onTurnDoneHook) { + this._onTurnDone = lang_1.normalizeBlank(onTurnDoneHook); + }; + Object.defineProperty(NgZone.prototype, "onTurnDone", { + get: function() { + return this._onTurnDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnTurnDone = function(parentRun) { + var _this = this; + parentRun.call(this._innerZone, function() { + _this._onTurnDoneEvents.next(null); + }); + }; + NgZone.prototype.overrideOnEventDone = function(onEventDoneFn, opt_waitForAsync) { + var _this = this; + if (opt_waitForAsync === void 0) { + opt_waitForAsync = false; + } + var normalizedOnEventDone = lang_1.normalizeBlank(onEventDoneFn); + if (opt_waitForAsync) { + this._onEventDone = function() { + if (!_this._pendingTimeouts.length) { + normalizedOnEventDone(); + } + }; + } else { + this._onEventDone = normalizedOnEventDone; + } + }; + Object.defineProperty(NgZone.prototype, "onEventDone", { + get: function() { + return this._onEventDoneEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype._notifyOnEventDone = function() { + var _this = this; + this.runOutsideAngular(function() { + _this._onEventDoneEvents.next(null); + }); + }; + Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { + get: function() { + return this._pendingMicrotasks > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingTimers", { + get: function() { + return this._pendingTimeouts.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgZone.prototype, "hasPendingAsyncTasks", { + get: function() { + return this.hasPendingMicrotasks || this.hasPendingTimers; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.overrideOnErrorHandler = function(errorHandler) { + this._onErrorHandler = lang_1.normalizeBlank(errorHandler); + }; + Object.defineProperty(NgZone.prototype, "onError", { + get: function() { + return this._onErrorEvents; + }, + enumerable: true, + configurable: true + }); + NgZone.prototype.run = function(fn) { + if (this._disabled) { + return fn(); + } else { + var s = this._runScope(); + try { + return this._innerZone.run(fn); + } finally { + profile_1.wtfLeave(s); + } + } + }; + NgZone.prototype.runOutsideAngular = function(fn) { + if (this._disabled) { + return fn(); + } else { + return this._mountZone.run(fn); + } + }; + NgZone.prototype._createInnerZone = function(zone, enableLongStackTrace) { + var microtaskScope = this._microtaskScope; + var ngZone = this; + var errorHandling; + if (enableLongStackTrace) { + errorHandling = collection_1.StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) { + ngZone._notifyOnError(this, e); + }}); + } else { + errorHandling = {onError: function(e) { + ngZone._notifyOnError(this, e); + }}; + } + return zone.fork(errorHandling).fork({ + '$run': function(parentRun) { + return function() { + try { + ngZone._nestedRun++; + if (!ngZone._hasExecutedCodeInInnerZone) { + ngZone._hasExecutedCodeInInnerZone = true; + ngZone._notifyOnTurnStart(parentRun); + if (ngZone._onTurnStart) { + parentRun.call(ngZone._innerZone, ngZone._onTurnStart); + } + } + return parentRun.apply(this, arguments); + } finally { + ngZone._nestedRun--; + if (ngZone._pendingMicrotasks == 0 && ngZone._nestedRun == 0 && !this._inVmTurnDone) { + if (ngZone._hasExecutedCodeInInnerZone) { + try { + this._inVmTurnDone = true; + ngZone._notifyOnTurnDone(parentRun); + if (ngZone._onTurnDone) { + parentRun.call(ngZone._innerZone, ngZone._onTurnDone); + } + } finally { + this._inVmTurnDone = false; + ngZone._hasExecutedCodeInInnerZone = false; + } + } + if (ngZone._pendingMicrotasks === 0) { + ngZone._notifyOnEventDone(); + if (lang_1.isPresent(ngZone._onEventDone)) { + ngZone.runOutsideAngular(ngZone._onEventDone); + } + } + } + } + }; + }, + '$scheduleMicrotask': function(parentScheduleMicrotask) { + return function(fn) { + ngZone._pendingMicrotasks++; + var microtask = function() { + var s = microtaskScope(); + try { + fn(); + } finally { + ngZone._pendingMicrotasks--; + profile_1.wtfLeave(s); + } + }; + parentScheduleMicrotask.call(this, microtask); + }; + }, + '$setTimeout': function(parentSetTimeout) { + return function(fn, delay) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var id; + var cb = function() { + fn(); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + id = parentSetTimeout(cb, delay, args); + ngZone._pendingTimeouts.push(id); + return id; + }; + }, + '$clearTimeout': function(parentClearTimeout) { + return function(id) { + parentClearTimeout(id); + collection_1.ListWrapper.remove(ngZone._pendingTimeouts, id); + }; + }, + _innerZone: true + }); + }; + NgZone.prototype._notifyOnError = function(zone, e) { + if (lang_1.isPresent(this._onErrorHandler) || async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + var trace = [lang_1.normalizeBlank(e.stack)]; + while (zone && zone.constructedAtException) { + trace.push(zone.constructedAtException.get()); + zone = zone.parent; + } + if (async_1.ObservableWrapper.hasSubscribers(this._onErrorEvents)) { + async_1.ObservableWrapper.callNext(this._onErrorEvents, new NgZoneError(e, trace)); + } + if (lang_1.isPresent(this._onErrorHandler)) { + this._onErrorHandler(e, trace); + } + } else { + console.log('## _notifyOnError ##'); + console.log(e.stack); + throw e; + } + }; + return NgZone; + })(); + exports.NgZone = NgZone; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); + exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); + exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); + function _appIdRandomProviderFactory() { + return "" + _randomChar() + _randomChar() + _randomChar(); + } + exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { + useFactory: _appIdRandomProviderFactory, + deps: [] + })); + function _randomChar() { + return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + function setRootDomAdapter(adapter) { + if (lang_1.isBlank(exports.DOM)) { + exports.DOM = adapter; + } + } + exports.setRootDomAdapter = setRootDomAdapter; + var DomAdapter = (function() { + function DomAdapter() {} + return DomAdapter; + })(); + exports.DomAdapter = DomAdapter; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/api", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var RenderProtoViewRef = (function() { + function RenderProtoViewRef() {} + return RenderProtoViewRef; + })(); + exports.RenderProtoViewRef = RenderProtoViewRef; + var RenderFragmentRef = (function() { + function RenderFragmentRef() {} + return RenderFragmentRef; + })(); + exports.RenderFragmentRef = RenderFragmentRef; + var RenderViewRef = (function() { + function RenderViewRef() {} + return RenderViewRef; + })(); + exports.RenderViewRef = RenderViewRef; + var RenderTemplateCmd = (function() { + function RenderTemplateCmd() {} + return RenderTemplateCmd; + })(); + exports.RenderTemplateCmd = RenderTemplateCmd; + var RenderBeginCmd = (function(_super) { + __extends(RenderBeginCmd, _super); + function RenderBeginCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginCmd.prototype, "isBound", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginCmd; + })(RenderTemplateCmd); + exports.RenderBeginCmd = RenderBeginCmd; + var RenderTextCmd = (function(_super) { + __extends(RenderTextCmd, _super); + function RenderTextCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderTextCmd.prototype, "value", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderTextCmd; + })(RenderBeginCmd); + exports.RenderTextCmd = RenderTextCmd; + var RenderNgContentCmd = (function(_super) { + __extends(RenderNgContentCmd, _super); + function RenderNgContentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderNgContentCmd.prototype, "index", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderNgContentCmd.prototype, "ngContentIndex", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderNgContentCmd; + })(RenderTemplateCmd); + exports.RenderNgContentCmd = RenderNgContentCmd; + var RenderBeginElementCmd = (function(_super) { + __extends(RenderBeginElementCmd, _super); + function RenderBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginElementCmd.prototype, "name", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "attrNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginElementCmd; + })(RenderBeginCmd); + exports.RenderBeginElementCmd = RenderBeginElementCmd; + var RenderBeginComponentCmd = (function(_super) { + __extends(RenderBeginComponentCmd, _super); + function RenderBeginComponentCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderBeginComponentCmd.prototype, "templateId", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderBeginComponentCmd; + })(RenderBeginElementCmd); + exports.RenderBeginComponentCmd = RenderBeginComponentCmd; + var RenderEmbeddedTemplateCmd = (function(_super) { + __extends(RenderEmbeddedTemplateCmd, _super); + function RenderEmbeddedTemplateCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "isMerged", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(RenderEmbeddedTemplateCmd.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return RenderEmbeddedTemplateCmd; + })(RenderBeginElementCmd); + exports.RenderEmbeddedTemplateCmd = RenderEmbeddedTemplateCmd; + var RenderViewWithFragments = (function() { + function RenderViewWithFragments(viewRef, fragmentRefs) { + this.viewRef = viewRef; + this.fragmentRefs = fragmentRefs; + } + return RenderViewWithFragments; + })(); + exports.RenderViewWithFragments = RenderViewWithFragments; + var RenderComponentTemplate = (function() { + function RenderComponentTemplate(id, shortId, encapsulation, commands, styles) { + this.id = id; + this.shortId = shortId; + this.encapsulation = encapsulation; + this.commands = commands; + this.styles = styles; + } + return RenderComponentTemplate; + })(); + exports.RenderComponentTemplate = RenderComponentTemplate; + var Renderer = (function() { + function Renderer() {} + return Renderer; + })(); + exports.Renderer = Renderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var provider_1 = require("angular2/src/core/di/provider"); + var di_1 = require("angular2/src/core/di"); + var PipeProvider = (function(_super) { + __extends(PipeProvider, _super); + function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { + _super.call(this, key, resolvedFactories, multiBinding); + this.name = name; + this.pure = pure; + } + PipeProvider.createFromType = function(type, metadata) { + var provider = new di_1.Provider(type, {useClass: type}); + var rb = provider_1.resolveProvider(provider); + return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); + }; + return PipeProvider; + })(provider_1.ResolvedProvider_); + exports.PipeProvider = PipeProvider; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SelectedPipe = (function() { + function SelectedPipe(pipe, pure) { + this.pipe = pipe; + this.pure = pure; + } + return SelectedPipe; + })(); + exports.SelectedPipe = SelectedPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + function internalView(viewRef) { + return viewRef._view; + } + exports.internalView = internalView; + function internalProtoView(protoViewRef) { + return lang_1.isPresent(protoViewRef) ? protoViewRef._protoView : null; + } + exports.internalProtoView = internalProtoView; + var ViewRef = (function() { + function ViewRef() {} + Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ViewRef; + })(); + exports.ViewRef = ViewRef; + var ViewRef_ = (function(_super) { + __extends(ViewRef_, _super); + function ViewRef_(_view) { + _super.call(this); + this._changeDetectorRef = null; + this._view = _view; + } + Object.defineProperty(ViewRef_.prototype, "render", { + get: function() { + return this._view.render; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "renderFragment", { + get: function() { + return this._view.renderFragment; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { + get: function() { + if (this._changeDetectorRef === null) { + this._changeDetectorRef = this._view.changeDetector.ref; + } + return this._changeDetectorRef; + }, + enumerable: true, + configurable: true + }); + ViewRef_.prototype.setLocal = function(variableName, value) { + this._view.setLocal(variableName, value); + }; + return ViewRef_; + })(ViewRef); + exports.ViewRef_ = ViewRef_; + var ProtoViewRef = (function() { + function ProtoViewRef() {} + return ProtoViewRef; + })(); + exports.ProtoViewRef = ProtoViewRef; + var ProtoViewRef_ = (function(_super) { + __extends(ProtoViewRef_, _super); + function ProtoViewRef_(_protoView) { + _super.call(this); + this._protoView = _protoView; + } + return ProtoViewRef_; + })(ProtoViewRef); + exports.ProtoViewRef_ = ProtoViewRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_binder", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementBinder = (function() { + function ElementBinder(index, parent, distanceToParent, protoElementInjector, componentDirective, nestedProtoView) { + this.index = index; + this.parent = parent; + this.distanceToParent = distanceToParent; + this.protoElementInjector = protoElementInjector; + this.componentDirective = componentDirective; + this.nestedProtoView = nestedProtoView; + if (lang_1.isBlank(index)) { + throw new exceptions_1.BaseException('null index not allowed.'); + } + } + return ElementBinder; + })(); + exports.ElementBinder = ElementBinder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ElementRef = (function() { + function ElementRef() {} + Object.defineProperty(ElementRef.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ElementRef.prototype, "renderView", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return ElementRef; + })(); + exports.ElementRef = ElementRef; + var ElementRef_ = (function(_super) { + __extends(ElementRef_, _super); + function ElementRef_(parentView, boundElementIndex, _renderer) { + _super.call(this); + this.parentView = parentView; + this.boundElementIndex = boundElementIndex; + this._renderer = _renderer; + } + Object.defineProperty(ElementRef_.prototype, "renderView", { + get: function() { + return this.parentView.render; + }, + set: function(value) { + exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ElementRef_.prototype, "nativeElement", { + get: function() { + return this._renderer.getNativeElementSync(this); + }, + enumerable: true, + configurable: true + }); + return ElementRef_; + })(ElementRef); + exports.ElementRef_ = ElementRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_ref", ["angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var TemplateRef = (function() { + function TemplateRef() {} + return TemplateRef; + })(); + exports.TemplateRef = TemplateRef; + var TemplateRef_ = (function(_super) { + __extends(TemplateRef_, _super); + function TemplateRef_(elementRef) { + _super.call(this); + this.elementRef = elementRef; + } + TemplateRef_.prototype._getProtoView = function() { + var elementRef = this.elementRef; + var parentView = view_ref_1.internalView(elementRef.parentView); + return parentView.proto.elementBinders[elementRef.boundElementIndex - parentView.elementOffset].nestedProtoView; + }; + Object.defineProperty(TemplateRef_.prototype, "protoViewRef", { + get: function() { + return this._getProtoView().ref; + }, + enumerable: true, + configurable: true + }); + TemplateRef_.prototype.hasLocal = function(name) { + return this._getProtoView().templateVariableBindings.has(name); + }; + return TemplateRef_; + })(TemplateRef); + exports.TemplateRef_ = TemplateRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_pool", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + exports.APP_VIEW_POOL_CAPACITY = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppViewPool.viewPoolCapacity')); + var AppViewPool = (function() { + function AppViewPool(poolCapacityPerProtoView) { + this._pooledViewsPerProtoView = new collection_1.Map(); + this._poolCapacityPerProtoView = poolCapacityPerProtoView; + } + AppViewPool.prototype.getView = function(protoView) { + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isPresent(pooledViews) && pooledViews.length > 0) { + return pooledViews.pop(); + } + return null; + }; + AppViewPool.prototype.returnView = function(view) { + var protoView = view.proto; + var pooledViews = this._pooledViewsPerProtoView.get(protoView); + if (lang_1.isBlank(pooledViews)) { + pooledViews = []; + this._pooledViewsPerProtoView.set(protoView, pooledViews); + } + var haveRemainingCapacity = pooledViews.length < this._poolCapacityPerProtoView; + if (haveRemainingCapacity) { + pooledViews.push(view); + } + return haveRemainingCapacity; + }; + AppViewPool = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.APP_VIEW_POOL_CAPACITY)), __metadata('design:paramtypes', [Object])], AppViewPool); + return AppViewPool; + })(); + exports.AppViewPool = AppViewPool; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_listener", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppViewListener = (function() { + function AppViewListener() {} + AppViewListener.prototype.onViewCreated = function(view) {}; + AppViewListener.prototype.onViewDestroyed = function(view) {}; + AppViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewListener); + return AppViewListener; + })(); + exports.AppViewListener = AppViewListener; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var ViewContainerRef = (function() { + function ViewContainerRef() {} + ViewContainerRef.prototype.clear = function() { + for (var i = this.length - 1; i >= 0; i--) { + this.remove(i); + } + }; + Object.defineProperty(ViewContainerRef.prototype, "length", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ViewContainerRef; + })(); + exports.ViewContainerRef = ViewContainerRef; + var ViewContainerRef_ = (function(_super) { + __extends(ViewContainerRef_, _super); + function ViewContainerRef_(viewManager, element) { + _super.call(this); + this.viewManager = viewManager; + this.element = element; + } + ViewContainerRef_.prototype._getViews = function() { + var element = this.element; + var vc = view_ref_1.internalView(element.parentView).viewContainers[element.boundElementIndex]; + return lang_1.isPresent(vc) ? vc.views : []; + }; + ViewContainerRef_.prototype.get = function(index) { + return this._getViews()[index].ref; + }; + Object.defineProperty(ViewContainerRef_.prototype, "length", { + get: function() { + return this._getViews().length; + }, + enumerable: true, + configurable: true + }); + ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.createEmbeddedViewInContainer(this.element, index, templateRef); + }; + ViewContainerRef_.prototype.createHostView = function(protoViewRef, index, dynamicallyCreatedProviders) { + if (protoViewRef === void 0) { + protoViewRef = null; + } + if (index === void 0) { + index = -1; + } + if (dynamicallyCreatedProviders === void 0) { + dynamicallyCreatedProviders = null; + } + if (index == -1) + index = this.length; + return this.viewManager.createHostViewInContainer(this.element, index, protoViewRef, dynamicallyCreatedProviders); + }; + ViewContainerRef_.prototype.insert = function(viewRef, index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length; + return this.viewManager.attachViewInContainer(this.element, index, viewRef); + }; + ViewContainerRef_.prototype.indexOf = function(viewRef) { + return collection_1.ListWrapper.indexOf(this._getViews(), view_ref_1.internalView(viewRef)); + }; + ViewContainerRef_.prototype.remove = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + this.viewManager.destroyViewInContainer(this.element, index); + }; + ViewContainerRef_.prototype.detach = function(index) { + if (index === void 0) { + index = -1; + } + if (index == -1) + index = this.length - 1; + return this.viewManager.detachViewInContainer(this.element, index); + }; + return ViewContainerRef_; + })(ViewContainerRef); + exports.ViewContainerRef_ = ViewContainerRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + (function(LifecycleHooks) { + LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; + LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; + LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; + LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; + LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; + LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; + LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; + LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; + })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); + var LifecycleHooks = exports.LifecycleHooks; + exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var QueryList = (function() { + function QueryList() { + this._results = []; + this._emitter = new async_1.EventEmitter(); + } + Object.defineProperty(QueryList.prototype, "changes", { + get: function() { + return this._emitter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "length", { + get: function() { + return this._results.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "first", { + get: function() { + return collection_1.ListWrapper.first(this._results); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryList.prototype, "last", { + get: function() { + return collection_1.ListWrapper.last(this._results); + }, + enumerable: true, + configurable: true + }); + QueryList.prototype.map = function(fn) { + return this._results.map(fn); + }; + QueryList.prototype.filter = function(fn) { + return this._results.filter(fn); + }; + QueryList.prototype.reduce = function(fn, init) { + return this._results.reduce(fn, init); + }; + QueryList.prototype.toArray = function() { + return collection_1.ListWrapper.clone(this._results); + }; + QueryList.prototype[lang_1.getSymbolIterator()] = function() { + return this._results[lang_1.getSymbolIterator()](); + }; + QueryList.prototype.toString = function() { + return this._results.toString(); + }; + QueryList.prototype.reset = function(res) { + this._results = res; + }; + QueryList.prototype.notifyOnChanges = function() { + this._emitter.next(this); + }; + return QueryList; + })(); + exports.QueryList = QueryList; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/event_config", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.EVENT_TARGET_SEPARATOR = ':'; + var EventConfig = (function() { + function EventConfig(fieldName, eventName, isLongForm) { + this.fieldName = fieldName; + this.eventName = eventName; + this.isLongForm = isLongForm; + } + EventConfig.parse = function(eventConfig) { + var fieldName = eventConfig, + eventName = eventConfig, + isLongForm = false; + var separatorIdx = eventConfig.indexOf(exports.EVENT_TARGET_SEPARATOR); + if (separatorIdx > -1) { + fieldName = eventConfig.substring(0, separatorIdx).trim(); + eventName = eventConfig.substring(separatorIdx + 1).trim(); + isLongForm = true; + } + return new EventConfig(fieldName, eventName, isLongForm); + }; + EventConfig.prototype.getFullName = function() { + return this.isLongForm ? "" + this.fieldName + exports.EVENT_TARGET_SEPARATOR + this.eventName : this.eventName; + }; + return EventConfig; + })(); + exports.EventConfig = EventConfig; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isDirectiveMetadata(type) { + return type instanceof metadata_1.DirectiveMetadata; + } + var DirectiveResolver = (function() { + function DirectiveResolver() {} + DirectiveResolver.prototype.resolve = function(type) { + var typeMetadata = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(typeMetadata)) { + var metadata = typeMetadata.find(_isDirectiveMetadata); + if (lang_1.isPresent(metadata)) { + var propertyMetadata = reflection_1.reflector.propMetadata(type); + return this._mergeWithPropertyMetadata(metadata, propertyMetadata); + } + } + throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); + }; + DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata) { + var inputs = []; + var outputs = []; + var host = {}; + var queries = {}; + collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { + metadata.forEach(function(a) { + if (a instanceof metadata_1.InputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + inputs.push(propName + ": " + a.bindingPropertyName); + } else { + inputs.push(propName); + } + } + if (a instanceof metadata_1.OutputMetadata) { + if (lang_1.isPresent(a.bindingPropertyName)) { + outputs.push(propName + ": " + a.bindingPropertyName); + } else { + outputs.push(propName); + } + } + if (a instanceof metadata_1.HostBindingMetadata) { + if (lang_1.isPresent(a.hostPropertyName)) { + host[("[" + a.hostPropertyName + "]")] = propName; + } else { + host[("[" + propName + "]")] = propName; + } + } + if (a instanceof metadata_1.HostListenerMetadata) { + var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; + host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; + } + if (a instanceof metadata_1.ContentChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildrenMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ContentChildMetadata) { + queries[propName] = a; + } + if (a instanceof metadata_1.ViewChildMetadata) { + queries[propName] = a; + } + }); + }); + return this._merge(dm, inputs, outputs, host, queries); + }; + DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries) { + var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; + var mergedOutputs = lang_1.isPresent(dm.outputs) ? collection_1.ListWrapper.concat(dm.outputs, outputs) : outputs; + var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; + var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; + if (dm instanceof metadata_1.ComponentMetadata) { + return new metadata_1.ComponentMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + changeDetection: dm.changeDetection, + providers: dm.providers, + viewProviders: dm.viewProviders + }); + } else { + return new metadata_1.DirectiveMetadata({ + selector: dm.selector, + inputs: mergedInputs, + outputs: mergedOutputs, + host: mergedHost, + exportAs: dm.exportAs, + moduleId: dm.moduleId, + queries: mergedQueries, + providers: dm.providers + }); + } + }; + DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DirectiveResolver); + return DirectiveResolver; + })(); + exports.DirectiveResolver = DirectiveResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var ViewResolver = (function() { + function ViewResolver() { + this._cache = new collection_1.Map(); + } + ViewResolver.prototype.resolve = function(component) { + var view = this._cache.get(component); + if (lang_1.isBlank(view)) { + view = this._resolve(component); + this._cache.set(component, view); + } + return view; + }; + ViewResolver.prototype._resolve = function(component) { + var compMeta; + var viewMeta; + reflection_1.reflector.annotations(component).forEach(function(m) { + if (m instanceof view_1.ViewMetadata) { + viewMeta = m; + } + if (m instanceof directives_1.ComponentMetadata) { + compMeta = m; + } + }); + if (lang_1.isPresent(compMeta)) { + if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template', 'templateUrl', or '@View' set."); + } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("template", component); + } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("templateUrl", component); + } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("directives", component); + } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("pipes", component); + } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("encapsulation", component); + } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styles", component); + } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { + this._throwMixingViewAndComponent("styleUrls", component); + } else if (lang_1.isPresent(viewMeta)) { + return viewMeta; + } else { + return new view_1.ViewMetadata({ + templateUrl: compMeta.templateUrl, + template: compMeta.template, + directives: compMeta.directives, + pipes: compMeta.pipes, + encapsulation: compMeta.encapsulation, + styles: compMeta.styles, + styleUrls: compMeta.styleUrls + }); + } + } else { + if (lang_1.isBlank(viewMeta)) { + throw new exceptions_1.BaseException("No View decorator found on component '" + lang_1.stringify(component) + "'"); + } else { + return viewMeta; + } + } + return null; + }; + ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { + throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); + }; + ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewResolver); + return ViewResolver; + })(); + exports.ViewResolver = ViewResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var metadata_1 = require("angular2/src/core/metadata"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + function _isPipeMetadata(type) { + return type instanceof metadata_1.PipeMetadata; + } + var PipeResolver = (function() { + function PipeResolver() {} + PipeResolver.prototype.resolve = function(type) { + var metas = reflection_1.reflector.annotations(di_1.resolveForwardRef(type)); + if (lang_1.isPresent(metas)) { + var annotation = metas.find(_isPipeMetadata); + if (lang_1.isPresent(annotation)) { + return annotation; + } + } + throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); + }; + PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], PipeResolver); + return PipeResolver; + })(); + exports.PipeResolver = PipeResolver; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); + exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var CssAnimationOptions = (function() { + function CssAnimationOptions() { + this.classesToAdd = []; + this.classesToRemove = []; + this.animationClasses = []; + } + return CssAnimationOptions; + })(); + exports.CssAnimationOptions = CssAnimationOptions; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + exports.Math = lang_1.global.Math; + exports.NaN = typeof exports.NaN; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var math_1 = require("angular2/src/facade/math"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var BrowserDetails = (function() { + function BrowserDetails() { + this.elapsedTimeIncludesDelay = false; + this.doesElapsedTimeIncludesDelay(); + } + BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { + var _this = this; + var div = dom_adapter_1.DOM.createElement('div'); + dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); + this.raf(function(timestamp) { + dom_adapter_1.DOM.on(div, 'transitionend', function(event) { + var elapsed = math_1.Math.round(event.elapsedTime * 1000); + _this.elapsedTimeIncludesDelay = elapsed == 2; + dom_adapter_1.DOM.remove(div); + }); + dom_adapter_1.DOM.setStyle(div, 'width', '2px'); + }, 2); + }; + BrowserDetails.prototype.raf = function(callback, frames) { + if (frames === void 0) { + frames = 1; + } + var queue = new RafQueue(callback, frames); + return function() { + return queue.cancel(); + }; + }; + BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); + return BrowserDetails; + })(); + exports.BrowserDetails = BrowserDetails; + var RafQueue = (function() { + function RafQueue(callback, frames) { + this.callback = callback; + this.frames = frames; + this._raf(); + } + RafQueue.prototype._raf = function() { + var _this = this; + this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { + return _this._nextFrame(timestamp); + }); + }; + RafQueue.prototype._nextFrame = function(timestamp) { + this.frames--; + if (this.frames > 0) { + this._raf(); + } else { + this.callback(timestamp); + } + }; + RafQueue.prototype.cancel = function() { + dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); + this.currentFrameId = null; + }; + return RafQueue; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/core/zone/ng_zone", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var di_1 = require("angular2/src/core/di"); + exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); + var EventManager = (function() { + function EventManager(plugins, _zone) { + var _this = this; + this._zone = _zone; + plugins.forEach(function(p) { + return p.manager = _this; + }); + this._plugins = collection_1.ListWrapper.reversed(plugins); + } + EventManager.prototype.addEventListener = function(element, eventName, handler) { + var plugin = this._findPluginFor(eventName); + plugin.addEventListener(element, eventName, handler); + }; + EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { + var plugin = this._findPluginFor(eventName); + return plugin.addGlobalEventListener(target, eventName, handler); + }; + EventManager.prototype.getZone = function() { + return this._zone; + }; + EventManager.prototype._findPluginFor = function(eventName) { + var plugins = this._plugins; + for (var i = 0; i < plugins.length; i++) { + var plugin = plugins[i]; + if (plugin.supports(eventName)) { + return plugin; + } + } + throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); + }; + EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); + return EventManager; + })(); + exports.EventManager = EventManager; + var EventManagerPlugin = (function() { + function EventManagerPlugin() {} + EventManagerPlugin.prototype.supports = function(eventName) { + return false; + }; + EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { + throw "not implemented"; + }; + return EventManagerPlugin; + })(); + exports.EventManagerPlugin = EventManagerPlugin; + var DomEventsPlugin = (function(_super) { + __extends(DomEventsPlugin, _super); + function DomEventsPlugin() { + _super.apply(this, arguments); + } + DomEventsPlugin.prototype.supports = function(eventName) { + return true; + }; + DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + this.manager.getZone().runOutsideAngular(function() { + dom_adapter_1.DOM.on(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { + var element = dom_adapter_1.DOM.getGlobalEventTarget(target); + var zone = this.manager.getZone(); + var outsideHandler = function(event) { + return zone.run(function() { + return handler(event); + }); + }; + return this.manager.getZone().runOutsideAngular(function() { + return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); + }); + }; + DomEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); + return DomEventsPlugin; + })(EventManagerPlugin); + exports.DomEventsPlugin = DomEventsPlugin; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view", ["angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var DefaultProtoViewRef = (function(_super) { + __extends(DefaultProtoViewRef, _super); + function DefaultProtoViewRef(template, cmds) { + _super.call(this); + this.template = template; + this.cmds = cmds; + } + return DefaultProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.DefaultProtoViewRef = DefaultProtoViewRef; + var DefaultRenderFragmentRef = (function(_super) { + __extends(DefaultRenderFragmentRef, _super); + function DefaultRenderFragmentRef(nodes) { + _super.call(this); + this.nodes = nodes; + } + return DefaultRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.DefaultRenderFragmentRef = DefaultRenderFragmentRef; + var DefaultRenderView = (function(_super) { + __extends(DefaultRenderView, _super); + function DefaultRenderView(fragments, boundTextNodes, boundElements, nativeShadowRoots, globalEventAdders, rootContentInsertionPoints) { + _super.call(this); + this.fragments = fragments; + this.boundTextNodes = boundTextNodes; + this.boundElements = boundElements; + this.nativeShadowRoots = nativeShadowRoots; + this.globalEventAdders = globalEventAdders; + this.rootContentInsertionPoints = rootContentInsertionPoints; + this.hydrated = false; + this.eventDispatcher = null; + this.globalEventRemovers = null; + } + DefaultRenderView.prototype.hydrate = function() { + if (this.hydrated) + throw new exceptions_1.BaseException('The view is already hydrated.'); + this.hydrated = true; + this.globalEventRemovers = collection_1.ListWrapper.createFixedSize(this.globalEventAdders.length); + for (var i = 0; i < this.globalEventAdders.length; i++) { + this.globalEventRemovers[i] = this.globalEventAdders[i](); + } + }; + DefaultRenderView.prototype.dehydrate = function() { + if (!this.hydrated) + throw new exceptions_1.BaseException('The view is already dehydrated.'); + for (var i = 0; i < this.globalEventRemovers.length; i++) { + this.globalEventRemovers[i](); + } + this.globalEventRemovers = null; + this.hydrated = false; + }; + DefaultRenderView.prototype.setEventDispatcher = function(dispatcher) { + this.eventDispatcher = dispatcher; + }; + DefaultRenderView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, event) { + var allowDefaultBehavior = true; + if (lang_1.isPresent(this.eventDispatcher)) { + var locals = new collection_1.Map(); + locals.set('$event', event); + allowDefaultBehavior = this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals); + } + return allowDefaultBehavior; + }; + return DefaultRenderView; + })(api_1.RenderViewRef); + exports.DefaultRenderView = DefaultRenderView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render", ["angular2/src/core/render/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.DOCUMENT = render_1.DOCUMENT; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + exports.ViewResolver = view_resolver_1.ViewResolver; + var compiler_1 = require("angular2/src/core/linker/compiler"); + exports.Compiler = compiler_1.Compiler; + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + exports.AppViewManager = view_manager_1.AppViewManager; + var query_list_1 = require("angular2/src/core/linker/query_list"); + exports.QueryList = query_list_1.QueryList; + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + exports.ElementRef = element_ref_1.ElementRef; + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + exports.TemplateRef = template_ref_1.TemplateRef; + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + exports.ViewRef = view_ref_1.ViewRef; + exports.ProtoViewRef = view_ref_1.ProtoViewRef; + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + exports.ComponentRef = dynamic_component_loader_2.ComponentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_for", ["angular2/src/core/metadata", "angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgFor = (function() { + function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._iterableDiffers = _iterableDiffers; + this._cdr = _cdr; + } + Object.defineProperty(NgFor.prototype, "ngForOf", { + set: function(value) { + this._ngForOf = value; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { + this._differ = this._iterableDiffers.find(value).create(this._cdr); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFor.prototype, "ngForTemplate", { + set: function(value) { + if (lang_1.isPresent(value)) { + this._templateRef = value; + } + }, + enumerable: true, + configurable: true + }); + NgFor.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._ngForOf); + if (lang_1.isPresent(changes)) + this._applyChanges(changes); + } + }; + NgFor.prototype._applyChanges = function(changes) { + var recordViewTuples = []; + changes.forEachRemovedItem(function(removedRecord) { + return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); + }); + changes.forEachMovedItem(function(movedRecord) { + return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); + }); + var insertTuples = this._bulkRemove(recordViewTuples); + changes.forEachAddedItem(function(addedRecord) { + return insertTuples.push(new RecordViewTuple(addedRecord, null)); + }); + this._bulkInsert(insertTuples); + for (var i = 0; i < insertTuples.length; i++) { + this._perViewChange(insertTuples[i].view, insertTuples[i].record); + } + for (var i = 0, + ilen = this._viewContainer.length; i < ilen; i++) { + this._viewContainer.get(i).setLocal('last', i === ilen - 1); + } + }; + NgFor.prototype._perViewChange = function(view, record) { + view.setLocal('\$implicit', record.item); + view.setLocal('index', record.currentIndex); + view.setLocal('even', (record.currentIndex % 2 == 0)); + view.setLocal('odd', (record.currentIndex % 2 == 1)); + }; + NgFor.prototype._bulkRemove = function(tuples) { + tuples.sort(function(a, b) { + return a.record.previousIndex - b.record.previousIndex; + }); + var movedTuples = []; + for (var i = tuples.length - 1; i >= 0; i--) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.record.currentIndex)) { + tuple.view = this._viewContainer.detach(tuple.record.previousIndex); + movedTuples.push(tuple); + } else { + this._viewContainer.remove(tuple.record.previousIndex); + } + } + return movedTuples; + }; + NgFor.prototype._bulkInsert = function(tuples) { + tuples.sort(function(a, b) { + return a.record.currentIndex - b.record.currentIndex; + }); + for (var i = 0; i < tuples.length; i++) { + var tuple = tuples[i]; + if (lang_1.isPresent(tuple.view)) { + this._viewContainer.insert(tuple.view, tuple.record.currentIndex); + } else { + tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); + } + } + return tuples; + }; + NgFor = __decorate([metadata_1.Directive({ + selector: '[ng-for][ng-for-of]', + inputs: ['ngForOf', 'ngForTemplate'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, change_detection_1.IterableDiffers, change_detection_1.ChangeDetectorRef])], NgFor); + return NgFor; + })(); + exports.NgFor = NgFor; + var RecordViewTuple = (function() { + function RecordViewTuple(record, view) { + this.record = record; + this.view = view; + } + return RecordViewTuple; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_if", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var NgIf = (function() { + function NgIf(_viewContainer, _templateRef) { + this._viewContainer = _viewContainer; + this._templateRef = _templateRef; + this._prevCondition = null; + } + Object.defineProperty(NgIf.prototype, "ngIf", { + set: function(newCondition) { + if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { + this._prevCondition = true; + this._viewContainer.createEmbeddedView(this._templateRef); + } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { + this._prevCondition = false; + this._viewContainer.clear(); + } + }, + enumerable: true, + configurable: true + }); + NgIf = __decorate([metadata_1.Directive({ + selector: '[ng-if]', + inputs: ['ngIf'] + }), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef])], NgIf); + return NgIf; + })(); + exports.NgIf = NgIf; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_style", ["angular2/src/core/change_detection", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var change_detection_1 = require("angular2/src/core/change_detection"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var lang_1 = require("angular2/src/facade/lang"); + var NgStyle = (function() { + function NgStyle(_differs, _ngEl, _renderer) { + this._differs = _differs; + this._ngEl = _ngEl; + this._renderer = _renderer; + } + Object.defineProperty(NgStyle.prototype, "rawStyle", { + set: function(v) { + this._rawStyle = v; + if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { + this._differ = this._differs.find(this._rawStyle).create(null); + } + }, + enumerable: true, + configurable: true + }); + NgStyle.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawStyle); + if (lang_1.isPresent(changes)) { + this._applyChanges(changes); + } + } + }; + NgStyle.prototype._applyChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._setStyle(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + _this._setStyle(record.key, null); + }); + }; + NgStyle.prototype._setStyle = function(name, val) { + this._renderer.setElementStyle(this._ngEl, name, val); + }; + NgStyle = __decorate([metadata_1.Directive({ + selector: '[ng-style]', + inputs: ['rawStyle: ng-style'] + }), __metadata('design:paramtypes', [change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgStyle); + return NgStyle; + })(); + exports.NgStyle = NgStyle; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_switch", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/linker", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var linker_1 = require("angular2/src/core/linker"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); + var SwitchView = (function() { + function SwitchView(_viewContainerRef, _templateRef) { + this._viewContainerRef = _viewContainerRef; + this._templateRef = _templateRef; + } + SwitchView.prototype.create = function() { + this._viewContainerRef.createEmbeddedView(this._templateRef); + }; + SwitchView.prototype.destroy = function() { + this._viewContainerRef.clear(); + }; + return SwitchView; + })(); + exports.SwitchView = SwitchView; + var NgSwitch = (function() { + function NgSwitch() { + this._useDefault = false; + this._valueViews = new collection_1.Map(); + this._activeViews = []; + } + Object.defineProperty(NgSwitch.prototype, "ngSwitch", { + set: function(value) { + this._emptyAllActiveViews(); + this._useDefault = false; + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + this._useDefault = true; + views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); + } + this._activateViews(views); + this._switchValue = value; + }, + enumerable: true, + configurable: true + }); + NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { + this._deregisterView(oldWhen, view); + this._registerView(newWhen, view); + if (oldWhen === this._switchValue) { + view.destroy(); + collection_1.ListWrapper.remove(this._activeViews, view); + } else if (newWhen === this._switchValue) { + if (this._useDefault) { + this._useDefault = false; + this._emptyAllActiveViews(); + } + view.create(); + this._activeViews.push(view); + } + if (this._activeViews.length === 0 && !this._useDefault) { + this._useDefault = true; + this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); + } + }; + NgSwitch.prototype._emptyAllActiveViews = function() { + var activeContainers = this._activeViews; + for (var i = 0; i < activeContainers.length; i++) { + activeContainers[i].destroy(); + } + this._activeViews = []; + }; + NgSwitch.prototype._activateViews = function(views) { + if (lang_1.isPresent(views)) { + for (var i = 0; i < views.length; i++) { + views[i].create(); + } + this._activeViews = views; + } + }; + NgSwitch.prototype._registerView = function(value, view) { + var views = this._valueViews.get(value); + if (lang_1.isBlank(views)) { + views = []; + this._valueViews.set(value, views); + } + views.push(view); + }; + NgSwitch.prototype._deregisterView = function(value, view) { + if (value === _WHEN_DEFAULT) + return ; + var views = this._valueViews.get(value); + if (views.length == 1) { + this._valueViews.delete(value); + } else { + collection_1.ListWrapper.remove(views, view); + } + }; + NgSwitch = __decorate([metadata_1.Directive({ + selector: '[ng-switch]', + inputs: ['ngSwitch'] + }), __metadata('design:paramtypes', [])], NgSwitch); + return NgSwitch; + })(); + exports.NgSwitch = NgSwitch; + var NgSwitchWhen = (function() { + function NgSwitchWhen(viewContainer, templateRef, _switch) { + this._switch = _switch; + this._value = _WHEN_DEFAULT; + this._view = new SwitchView(viewContainer, templateRef); + } + Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { + set: function(value) { + this._switch._onWhenValueChanged(this._value, value, this._view); + this._value = value; + }, + enumerable: true, + configurable: true + }); + NgSwitchWhen = __decorate([metadata_1.Directive({ + selector: '[ng-switch-when]', + inputs: ['ngSwitchWhen'] + }), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchWhen); + return NgSwitchWhen; + })(); + exports.NgSwitchWhen = NgSwitchWhen; + var NgSwitchDefault = (function() { + function NgSwitchDefault(viewContainer, templateRef, sswitch) { + sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); + } + NgSwitchDefault = __decorate([metadata_1.Directive({selector: '[ng-switch-default]'}), __param(2, di_1.Host()), __metadata('design:paramtypes', [linker_1.ViewContainerRef, linker_1.TemplateRef, NgSwitch])], NgSwitchDefault); + return NgSwitchDefault; + })(); + exports.NgSwitchDefault = NgSwitchDefault; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var promise_1 = require("angular2/src/facade/promise"); + var collection_1 = require("angular2/src/facade/collection"); + exports.VALID = "VALID"; + exports.INVALID = "INVALID"; + exports.PENDING = "PENDING"; + function isControl(control) { + return control instanceof AbstractControl; + } + exports.isControl = isControl; + function _find(control, path) { + if (lang_1.isBlank(path)) + return null; + if (!(path instanceof Array)) { + path = path.split("/"); + } + if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) + return null; + return path.reduce(function(v, name) { + if (v instanceof ControlGroup) { + return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; + } else if (v instanceof ControlArray) { + var index = name; + return lang_1.isPresent(v.at(index)) ? v.at(index) : null; + } else { + return null; + } + }, control); + } + function toObservable(r) { + return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; + } + var AbstractControl = (function() { + function AbstractControl(validator, asyncValidator) { + this.validator = validator; + this.asyncValidator = asyncValidator; + this._pristine = true; + this._touched = false; + } + Object.defineProperty(AbstractControl.prototype, "value", { + get: function() { + return this._value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "status", { + get: function() { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valid", { + get: function() { + return this._status === exports.VALID; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "errors", { + get: function() { + return this._errors; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pristine", { + get: function() { + return this._pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "dirty", { + get: function() { + return !this.pristine; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "touched", { + get: function() { + return this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "untouched", { + get: function() { + return !this._touched; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "valueChanges", { + get: function() { + return this._valueChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "statusChanges", { + get: function() { + return this._statusChanges; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControl.prototype, "pending", { + get: function() { + return this._status == exports.PENDING; + }, + enumerable: true, + configurable: true + }); + AbstractControl.prototype.markAsTouched = function() { + this._touched = true; + }; + AbstractControl.prototype.markAsDirty = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._pristine = false; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsDirty({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.markAsPending = function(_a) { + var onlySelf = (_a === void 0 ? {} : _a).onlySelf; + onlySelf = lang_1.normalizeBool(onlySelf); + this._status = exports.PENDING; + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.markAsPending({onlySelf: onlySelf}); + } + }; + AbstractControl.prototype.setParent = function(parent) { + this._parent = parent; + }; + AbstractControl.prototype.updateValueAndValidity = function(_a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent; + onlySelf = lang_1.normalizeBool(onlySelf); + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._updateValue(); + this._errors = this._runValidator(); + this._status = this._calculateStatus(); + if (this._status == exports.VALID || this._status == exports.PENDING) { + this._runAsyncValidator(emitEvent); + } + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._valueChanges, this._value); + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent) && !onlySelf) { + this._parent.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + } + }; + AbstractControl.prototype._runValidator = function() { + return lang_1.isPresent(this.validator) ? this.validator(this) : null; + }; + AbstractControl.prototype._runAsyncValidator = function(emitEvent) { + var _this = this; + if (lang_1.isPresent(this.asyncValidator)) { + this._status = exports.PENDING; + this._cancelExistingSubscription(); + var obs = toObservable(this.asyncValidator(this)); + this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { + return _this.setErrors(res, {emitEvent: emitEvent}); + }); + } + }; + AbstractControl.prototype._cancelExistingSubscription = function() { + if (lang_1.isPresent(this._asyncValidationSubscription)) { + async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); + } + }; + AbstractControl.prototype.setErrors = function(errors, _a) { + var emitEvent = (_a === void 0 ? {} : _a).emitEvent; + emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; + this._errors = errors; + this._status = this._calculateStatus(); + if (emitEvent) { + async_1.ObservableWrapper.callNext(this._statusChanges, this._status); + } + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype.find = function(path) { + return _find(this, path); + }; + AbstractControl.prototype.getError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; + if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { + return collection_1.StringMapWrapper.get(control._errors, errorCode); + } else { + return null; + } + }; + AbstractControl.prototype.hasError = function(errorCode, path) { + if (path === void 0) { + path = null; + } + return lang_1.isPresent(this.getError(errorCode, path)); + }; + AbstractControl.prototype._updateControlsErrors = function() { + this._status = this._calculateStatus(); + if (lang_1.isPresent(this._parent)) { + this._parent._updateControlsErrors(); + } + }; + AbstractControl.prototype._initObservables = function() { + this._valueChanges = new async_1.EventEmitter(); + this._statusChanges = new async_1.EventEmitter(); + }; + AbstractControl.prototype._calculateStatus = function() { + if (lang_1.isPresent(this._errors)) + return exports.INVALID; + if (this._anyControlsHaveStatus(exports.PENDING)) + return exports.PENDING; + if (this._anyControlsHaveStatus(exports.INVALID)) + return exports.INVALID; + return exports.VALID; + }; + return AbstractControl; + })(); + exports.AbstractControl = AbstractControl; + var Control = (function(_super) { + __extends(Control, _super); + function Control(value, validator, asyncValidator) { + if (value === void 0) { + value = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this._value = value; + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + this._initObservables(); + } + Control.prototype.updateValue = function(value, _a) { + var _b = _a === void 0 ? {} : _a, + onlySelf = _b.onlySelf, + emitEvent = _b.emitEvent, + emitModelToViewChange = _b.emitModelToViewChange; + emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; + this._value = value; + if (lang_1.isPresent(this._onChange) && emitModelToViewChange) + this._onChange(this._value); + this.updateValueAndValidity({ + onlySelf: onlySelf, + emitEvent: emitEvent + }); + }; + Control.prototype._updateValue = function() {}; + Control.prototype._anyControlsHaveStatus = function(status) { + return false; + }; + Control.prototype.registerOnChange = function(fn) { + this._onChange = fn; + }; + return Control; + })(AbstractControl); + exports.Control = Control; + var ControlGroup = (function(_super) { + __extends(ControlGroup, _super); + function ControlGroup(controls, optionals, validator, asyncValidator) { + if (optionals === void 0) { + optionals = null; + } + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._optionals = lang_1.isPresent(optionals) ? optionals : {}; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlGroup.prototype.addControl = function(name, control) { + this.controls[name] = control; + control.setParent(this); + }; + ControlGroup.prototype.removeControl = function(name) { + collection_1.StringMapWrapper.delete(this.controls, name); + }; + ControlGroup.prototype.include = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, true); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.exclude = function(controlName) { + collection_1.StringMapWrapper.set(this._optionals, controlName, false); + this.updateValueAndValidity(); + }; + ControlGroup.prototype.contains = function(controlName) { + var c = collection_1.StringMapWrapper.contains(this.controls, controlName); + return c && this._included(controlName); + }; + ControlGroup.prototype._setParentForControls = function() { + var _this = this; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + control.setParent(_this); + }); + }; + ControlGroup.prototype._updateValue = function() { + this._value = this._reduceValue(); + }; + ControlGroup.prototype._anyControlsHaveStatus = function(status) { + var _this = this; + var res = false; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + res = res || (_this.contains(name) && control.status == status); + }); + return res; + }; + ControlGroup.prototype._reduceValue = function() { + return this._reduceChildren({}, function(acc, control, name) { + acc[name] = control.value; + return acc; + }); + }; + ControlGroup.prototype._reduceChildren = function(initValue, fn) { + var _this = this; + var res = initValue; + collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { + if (_this._included(name)) { + res = fn(res, control, name); + } + }); + return res; + }; + ControlGroup.prototype._included = function(controlName) { + var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); + return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); + }; + return ControlGroup; + })(AbstractControl); + exports.ControlGroup = ControlGroup; + var ControlArray = (function(_super) { + __extends(ControlArray, _super); + function ControlArray(controls, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + _super.call(this, validator, asyncValidator); + this.controls = controls; + this._initObservables(); + this._setParentForControls(); + this.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + ControlArray.prototype.at = function(index) { + return this.controls[index]; + }; + ControlArray.prototype.push = function(control) { + this.controls.push(control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.insert = function(index, control) { + collection_1.ListWrapper.insert(this.controls, index, control); + control.setParent(this); + this.updateValueAndValidity(); + }; + ControlArray.prototype.removeAt = function(index) { + collection_1.ListWrapper.removeAt(this.controls, index); + this.updateValueAndValidity(); + }; + Object.defineProperty(ControlArray.prototype, "length", { + get: function() { + return this.controls.length; + }, + enumerable: true, + configurable: true + }); + ControlArray.prototype._updateValue = function() { + this._value = this.controls.map(function(control) { + return control.value; + }); + }; + ControlArray.prototype._anyControlsHaveStatus = function(status) { + return this.controls.some(function(c) { + return c.status == status; + }); + }; + ControlArray.prototype._setParentForControls = function() { + var _this = this; + this.controls.forEach(function(control) { + control.setParent(_this); + }); + }; + return ControlArray; + })(AbstractControl); + exports.ControlArray = ControlArray; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var AbstractControlDirective = (function() { + function AbstractControlDirective() {} + Object.defineProperty(AbstractControlDirective.prototype, "control", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "value", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.value : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "valid", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.valid : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "errors", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.errors : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "pristine", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.pristine : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "dirty", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.dirty : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "touched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.touched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "untouched", { + get: function() { + return lang_1.isPresent(this.control) ? this.control.untouched : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractControlDirective.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return AbstractControlDirective; + })(); + exports.AbstractControlDirective = AbstractControlDirective; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var ControlContainer = (function(_super) { + __extends(ControlContainer, _super); + function ControlContainer() { + _super.apply(this, arguments); + } + Object.defineProperty(ControlContainer.prototype, "formDirective", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ControlContainer.prototype, "path", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + return ControlContainer; + })(abstract_control_directive_1.AbstractControlDirective); + exports.ControlContainer = ControlContainer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var NgControl = (function(_super) { + __extends(NgControl, _super); + function NgControl() { + _super.apply(this, arguments); + this.name = null; + this.valueAccessor = null; + } + Object.defineProperty(NgControl.prototype, "validator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControl.prototype, "asyncValidator", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return NgControl; + })(abstract_control_directive_1.AbstractControlDirective); + exports.NgControl = NgControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValueAccessor")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + exports.NG_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgValidators")); + exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new di_1.OpaqueToken("NgAsyncValidators")); + var Validators = (function() { + function Validators() {} + Validators.required = function(control) { + return lang_1.isBlank(control.value) || control.value == "" ? {"required": true} : null; + }; + Validators.minLength = function(minLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length < minLength ? {"minlength": { + "requiredLength": minLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.maxLength = function(maxLength) { + return function(control) { + if (lang_1.isPresent(Validators.required(control))) + return null; + var v = control.value; + return v.length > maxLength ? {"maxlength": { + "requiredLength": maxLength, + "actualLength": v.length + }} : null; + }; + }; + Validators.nullValidator = function(c) { + return null; + }; + Validators.compose = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + return _mergeErrors(_executeValidators(control, presentValidators)); + }; + }; + Validators.composeAsync = function(validators) { + if (lang_1.isBlank(validators)) + return null; + var presentValidators = validators.filter(lang_1.isPresent); + if (presentValidators.length == 0) + return null; + return function(control) { + var promises = _executeValidators(control, presentValidators).map(_convertToPromise); + return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); + }; + }; + return Validators; + })(); + exports.Validators = Validators; + function _convertToPromise(obj) { + return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); + } + function _executeValidators(control, validators) { + return validators.map(function(v) { + return v(control); + }); + } + function _mergeErrors(arrayOfErrors) { + var res = arrayOfErrors.reduce(function(res, errors) { + return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; + }, {}); + return collection_1.StringMapWrapper.isEmpty(res) ? null : res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return DefaultValueAccessor; + }), + multi: true + })); + var DefaultValueAccessor = (function() { + function DefaultValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + DefaultValueAccessor.prototype.writeValue = function(value) { + var normalizedValue = lang_1.isBlank(value) ? '' : value; + shared_1.setProperty(this._renderer, this._elementRef, 'value', normalizedValue); + }; + DefaultValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + DefaultValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + DefaultValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [DEFAULT_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], DefaultValueAccessor); + return DefaultValueAccessor; + })(); + exports.DefaultValueAccessor = DefaultValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/render", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var render_1 = require("angular2/src/core/render"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return NumberValueAccessor; + }), + multi: true + })); + var NumberValueAccessor = (function() { + function NumberValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + NumberValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, 'value', value); + }; + NumberValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = function(value) { + fn(lang_1.NumberWrapper.parseFloat(value)); + }; + }; + NumberValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + NumberValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=number][ng-control],input[type=number][ng-form-control],input[type=number][ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [NUMBER_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], NumberValueAccessor); + return NumberValueAccessor; + })(); + exports.NumberValueAccessor = NumberValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/src/core/metadata", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var metadata_1 = require("angular2/src/core/metadata"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return CheckboxControlValueAccessor; + }), + multi: true + })); + var CheckboxControlValueAccessor = (function() { + function CheckboxControlValueAccessor(_renderer, _elementRef) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + } + CheckboxControlValueAccessor.prototype.writeValue = function(value) { + shared_1.setProperty(this._renderer, this._elementRef, "checked", value); + }; + CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + CheckboxControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]', + host: { + '(change)': 'onChange($event.target.checked)', + '(blur)': 'onTouched()' + }, + bindings: [CHECKBOX_VALUE_ACCESSOR] + }), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef])], CheckboxControlValueAccessor); + return CheckboxControlValueAccessor; + })(); + exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/src/core/di", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/metadata", "angular2/src/facade/async", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var render_1 = require("angular2/src/core/render"); + var linker_1 = require("angular2/src/core/linker"); + var metadata_1 = require("angular2/src/core/metadata"); + var async_1 = require("angular2/src/facade/async"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var lang_1 = require("angular2/src/facade/lang"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new di_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { + useExisting: di_1.forwardRef(function() { + return SelectControlValueAccessor; + }), + multi: true + })); + var NgSelectOption = (function() { + function NgSelectOption() {} + NgSelectOption = __decorate([metadata_1.Directive({selector: 'option'}), __metadata('design:paramtypes', [])], NgSelectOption); + return NgSelectOption; + })(); + exports.NgSelectOption = NgSelectOption; + var SelectControlValueAccessor = (function() { + function SelectControlValueAccessor(_renderer, _elementRef, query) { + this._renderer = _renderer; + this._elementRef = _elementRef; + this.onChange = function(_) {}; + this.onTouched = function() {}; + this._updateValueWhenListOfOptionsChanges(query); + } + SelectControlValueAccessor.prototype.writeValue = function(value) { + this.value = value; + shared_1.setProperty(this._renderer, this._elementRef, "value", value); + }; + SelectControlValueAccessor.prototype.registerOnChange = function(fn) { + this.onChange = fn; + }; + SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { + this.onTouched = fn; + }; + SelectControlValueAccessor.prototype._updateValueWhenListOfOptionsChanges = function(query) { + var _this = this; + async_1.ObservableWrapper.subscribe(query.changes, function(_) { + return _this.writeValue(_this.value); + }); + }; + SelectControlValueAccessor = __decorate([metadata_1.Directive({ + selector: 'select[ng-control],select[ng-form-control],select[ng-model]', + host: { + '(change)': 'onChange($event.target.value)', + '(input)': 'onChange($event.target.value)', + '(blur)': 'onTouched()' + }, + bindings: [SELECT_VALUE_ACCESSOR] + }), __param(2, metadata_1.Query(NgSelectOption, {descendants: true})), __metadata('design:paramtypes', [render_1.Renderer, linker_1.ElementRef, linker_1.QueryList])], SelectControlValueAccessor); + return SelectControlValueAccessor; + })(); + exports.SelectControlValueAccessor = SelectControlValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function normalizeValidator(validator) { + if (validator.validate !== undefined) { + return function(c) { + return validator.validate(c); + }; + } else { + return validator; + } + } + exports.normalizeValidator = normalizeValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var validators_1 = require("angular2/src/common/forms/validators"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgFormControl; + })})); + var NgFormControl = (function(_super) { + __extends(NgFormControl, _super); + function NgFormControl(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgFormControl.prototype.onChanges = function(changes) { + if (this._isControlChanged(changes)) { + shared_1.setUpControl(this.form, this); + this.form.updateValueAndValidity({emitEvent: false}); + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.form.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgFormControl.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormControl.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + NgFormControl.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgFormControl.prototype._isControlChanged = function(changes) { + return collection_1.StringMapWrapper.contains(changes, "form"); + }; + NgFormControl = __decorate([metadata_1.Directive({ + selector: '[ng-form-control]', + bindings: [formControlBinding], + inputs: ['form: ngFormControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); + return NgFormControl; + })(ng_control_1.NgControl); + exports.NgFormControl = NgFormControl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var model_1 = require("angular2/src/common/forms/model"); + var validators_1 = require("angular2/src/common/forms/validators"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var formControlBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgModel; + })})); + var NgModel = (function(_super) { + __extends(NgModel, _super); + function NgModel(_validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._control = new model_1.Control(); + this._added = false; + this.update = new async_1.EventEmitter(); + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgModel.prototype.onChanges = function(changes) { + if (!this._added) { + shared_1.setUpControl(this._control, this); + this._control.updateValueAndValidity({emitEvent: false}); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this._control.updateValue(this.model); + this.viewModel = this.model; + } + }; + Object.defineProperty(NgModel.prototype, "control", { + get: function() { + return this._control; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgModel.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgModel.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + NgModel = __decorate([metadata_1.Directive({ + selector: '[ng-model]:not([ng-control]):not([ng-form-control])', + bindings: [formControlBinding], + inputs: ['model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); + return NgModel; + })(ng_control_1.NgControl); + exports.NgModel = NgModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlGroupProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgControlGroup; + })})); + var NgControlGroup = (function(_super) { + __extends(NgControlGroup, _super); + function NgControlGroup(parent, _validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this._parent = parent; + } + NgControlGroup.prototype.onInit = function() { + this.formDirective.addControlGroup(this); + }; + NgControlGroup.prototype.onDestroy = function() { + this.formDirective.removeControlGroup(this); + }; + Object.defineProperty(NgControlGroup.prototype, "control", { + get: function() { + return this.formDirective.getControlGroup(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + NgControlGroup = __decorate([metadata_1.Directive({ + selector: '[ng-control-group]', + providers: [controlGroupProvider], + inputs: ['name: ng-control-group'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); + return NgControlGroup; + })(control_container_1.ControlContainer); + exports.NgControlGroup = NgControlGroup; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgFormModel; + })})); + var NgFormModel = (function(_super) { + __extends(NgFormModel, _super); + function NgFormModel(_validators, _asyncValidators) { + _super.call(this); + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.form = null; + this.directives = []; + this.ngSubmit = new async_1.EventEmitter(); + } + NgFormModel.prototype.onChanges = function(changes) { + if (collection_1.StringMapWrapper.contains(changes, "form")) { + var sync = shared_1.composeValidators(this._validators); + this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); + var async = shared_1.composeAsyncValidators(this._asyncValidators); + this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); + this.form.updateValueAndValidity({ + onlySelf: true, + emitEvent: false + }); + } + this._updateDomValue(); + }; + Object.defineProperty(NgFormModel.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgFormModel.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + NgFormModel.prototype.addControl = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControl(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + this.directives.push(dir); + }; + NgFormModel.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.removeControl = function(dir) { + collection_1.ListWrapper.remove(this.directives, dir); + }; + NgFormModel.prototype.addControlGroup = function(dir) { + var ctrl = this.form.find(dir.path); + shared_1.setUpControlGroup(ctrl, dir); + ctrl.updateValueAndValidity({emitEvent: false}); + }; + NgFormModel.prototype.removeControlGroup = function(dir) {}; + NgFormModel.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgFormModel.prototype.updateModel = function(dir, value) { + var ctrl = this.form.find(dir.path); + ctrl.updateValue(value); + }; + NgFormModel.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgFormModel.prototype._updateDomValue = function() { + var _this = this; + this.directives.forEach(function(dir) { + var ctrl = _this.form.find(dir.path); + dir.valueAccessor.writeValue(ctrl.value); + }); + }; + NgFormModel = __decorate([metadata_1.Directive({ + selector: '[ng-form-model]', + bindings: [formDirectiveProvider], + inputs: ['form: ng-form-model'], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); + return NgFormModel; + })(control_container_1.ControlContainer); + exports.NgFormModel = NgFormModel; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var model_1 = require("angular2/src/common/forms/model"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var formDirectiveProvider = lang_1.CONST_EXPR(new di_1.Provider(control_container_1.ControlContainer, {useExisting: di_1.forwardRef(function() { + return NgForm; + })})); + var NgForm = (function(_super) { + __extends(NgForm, _super); + function NgForm(validators, asyncValidators) { + _super.call(this); + this.ngSubmit = new async_1.EventEmitter(); + this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); + } + Object.defineProperty(NgForm.prototype, "formDirective", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "control", { + get: function() { + return this.form; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "path", { + get: function() { + return []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgForm.prototype, "controls", { + get: function() { + return this.form.controls; + }, + enumerable: true, + configurable: true + }); + NgForm.prototype.addControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var ctrl = new model_1.Control(); + shared_1.setUpControl(ctrl, dir); + container.addControl(dir.name, ctrl); + ctrl.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.getControl = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.removeControl = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.addControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + var group = new model_1.ControlGroup({}); + shared_1.setUpControlGroup(group, dir); + container.addControl(dir.name, group); + group.updateValueAndValidity({emitEvent: false}); + }); + }; + NgForm.prototype.removeControlGroup = function(dir) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var container = _this._findContainer(dir.path); + if (lang_1.isPresent(container)) { + container.removeControl(dir.name); + container.updateValueAndValidity({emitEvent: false}); + } + }); + }; + NgForm.prototype.getControlGroup = function(dir) { + return this.form.find(dir.path); + }; + NgForm.prototype.updateModel = function(dir, value) { + var _this = this; + async_1.PromiseWrapper.scheduleMicrotask(function() { + var ctrl = _this.form.find(dir.path); + ctrl.updateValue(value); + }); + }; + NgForm.prototype.onSubmit = function() { + async_1.ObservableWrapper.callNext(this.ngSubmit, null); + return false; + }; + NgForm.prototype._findContainer = function(path) { + path.pop(); + return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); + }; + NgForm = __decorate([metadata_1.Directive({ + selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]', + bindings: [formDirectiveProvider], + host: {'(submit)': 'onSubmit()'}, + outputs: ['ngSubmit'], + exportAs: 'form' + }), __param(0, di_1.Optional()), __param(0, di_1.Inject(validators_1.NG_VALIDATORS)), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); + return NgForm; + })(control_container_1.ControlContainer); + exports.NgForm = NgForm; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var lang_1 = require("angular2/src/facade/lang"); + var NgControlStatus = (function() { + function NgControlStatus(cd) { + this._cd = cd; + } + Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { + get: function() { + return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; + }, + enumerable: true, + configurable: true + }); + NgControlStatus = __decorate([metadata_1.Directive({ + selector: '[ng-control],[ng-model],[ng-form-control]', + host: { + '[class.ng-untouched]': 'ngClassUntouched', + '[class.ng-touched]': 'ngClassTouched', + '[class.ng-pristine]': 'ngClassPristine', + '[class.ng-dirty]': 'ngClassDirty', + '[class.ng-valid]': 'ngClassValid', + '[class.ng-invalid]': 'ngClassInvalid' + } + }), __param(0, di_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); + return NgControlStatus; + })(); + exports.NgControlStatus = NgControlStatus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/validators", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var validators_1 = require("angular2/src/common/forms/validators"); + var lang_2 = require("angular2/src/facade/lang"); + var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useValue: validators_1.Validators.required, + multi: true + })); + var RequiredValidator = (function() { + function RequiredValidator() {} + RequiredValidator = __decorate([metadata_1.Directive({ + selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]', + providers: [REQUIRED_VALIDATOR] + }), __metadata('design:paramtypes', [])], RequiredValidator); + return RequiredValidator; + })(); + exports.RequiredValidator = RequiredValidator; + var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MinLengthValidator; + }), + multi: true + })); + var MinLengthValidator = (function() { + function MinLengthValidator(minLength) { + this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MinLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MinLengthValidator = __decorate([metadata_1.Directive({ + selector: '[minlength][ng-control],[minlength][ng-form-control],[minlength][ng-model]', + providers: [MIN_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); + return MinLengthValidator; + })(); + exports.MinLengthValidator = MinLengthValidator; + var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new di_1.Provider(validators_1.NG_VALIDATORS, { + useExisting: di_1.forwardRef(function() { + return MaxLengthValidator; + }), + multi: true + })); + var MaxLengthValidator = (function() { + function MaxLengthValidator(minLength) { + this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(minLength, 10)); + } + MaxLengthValidator.prototype.validate = function(c) { + return this._validator(c); + }; + MaxLengthValidator = __decorate([metadata_1.Directive({ + selector: '[maxlength][ng-control],[maxlength][ng-form-control],[maxlength][ng-model]', + providers: [MAX_LENGTH_VALIDATOR] + }), __param(0, metadata_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); + return MaxLengthValidator; + })(); + exports.MaxLengthValidator = MaxLengthValidator; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/form_builder", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var modelModule = require("angular2/src/common/forms/model"); + var FormBuilder = (function() { + function FormBuilder() {} + FormBuilder.prototype.group = function(controlsConfig, extra) { + if (extra === void 0) { + extra = null; + } + var controls = this._reduceControls(controlsConfig); + var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null; + var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; + var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; + return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); + }; + FormBuilder.prototype.control = function(value, validator, asyncValidator) { + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + return new modelModule.Control(value, validator, asyncValidator); + }; + FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { + var _this = this; + if (validator === void 0) { + validator = null; + } + if (asyncValidator === void 0) { + asyncValidator = null; + } + var controls = controlsConfig.map(function(c) { + return _this._createControl(c); + }); + return new modelModule.ControlArray(controls, validator, asyncValidator); + }; + FormBuilder.prototype._reduceControls = function(controlsConfig) { + var _this = this; + var controls = {}; + collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { + controls[controlName] = _this._createControl(controlConfig); + }); + return controls; + }; + FormBuilder.prototype._createControl = function(controlConfig) { + if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { + return controlConfig; + } else if (lang_1.isArray(controlConfig)) { + var value = controlConfig[0]; + var validator = controlConfig.length > 1 ? controlConfig[1] : null; + var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; + return this.control(value, validator, asyncValidator); + } else { + return this.control(controlConfig); + } + }; + FormBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); + return FormBuilder; + })(); + exports.FormBuilder = FormBuilder; + exports.FORM_PROVIDERS = lang_1.CONST_EXPR([FormBuilder]); + exports.FORM_BINDINGS = exports.FORM_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var forms_1 = require("angular2/src/common/forms"); + var directives_1 = require("angular2/src/common/directives"); + exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/app_root_url", ["angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var AppRootUrl = (function() { + function AppRootUrl(value) { + this.value = value; + } + AppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [String])], AppRootUrl); + return AppRootUrl; + })(); + exports.AppRootUrl = AppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + function createWithoutPackagePrefix() { + return new UrlResolver(); + } + exports.createWithoutPackagePrefix = createWithoutPackagePrefix; + var UrlResolver = (function() { + function UrlResolver() {} + UrlResolver.prototype.resolve = function(baseUrl, url) { + return _resolveUrl(baseUrl, url); + }; + UrlResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], UrlResolver); + return UrlResolver; + })(); + exports.UrlResolver = UrlResolver; + function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { + var out = []; + if (lang_1.isPresent(opt_scheme)) { + out.push(opt_scheme + ':'); + } + if (lang_1.isPresent(opt_domain)) { + out.push('//'); + if (lang_1.isPresent(opt_userInfo)) { + out.push(opt_userInfo + '@'); + } + out.push(opt_domain); + if (lang_1.isPresent(opt_port)) { + out.push(':' + opt_port); + } + } + if (lang_1.isPresent(opt_path)) { + out.push(opt_path); + } + if (lang_1.isPresent(opt_queryData)) { + out.push('?' + opt_queryData); + } + if (lang_1.isPresent(opt_fragment)) { + out.push('#' + opt_fragment); + } + return out.join(''); + } + var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); + var _ComponentIndex; + (function(_ComponentIndex) { + _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; + _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; + _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; + _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; + _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; + _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; + _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; + })(_ComponentIndex || (_ComponentIndex = {})); + function _split(uri) { + return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); + } + function _removeDotSegments(path) { + if (path == '/') + return '/'; + var leadingSlash = path[0] == '/' ? '/' : ''; + var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; + var segments = path.split('/'); + var out = []; + var up = 0; + for (var pos = 0; pos < segments.length; pos++) { + var segment = segments[pos]; + switch (segment) { + case '': + case '.': + break; + case '..': + if (out.length > 0) { + out.pop(); + } else { + up++; + } + break; + default: + out.push(segment); + } + } + if (leadingSlash == '') { + while (up-- > 0) { + out.unshift('..'); + } + if (out.length === 0) + out.push('.'); + } + return leadingSlash + out.join('/') + trailingSlash; + } + function _joinAndCanonicalizePath(parts) { + var path = parts[_ComponentIndex.Path]; + path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); + parts[_ComponentIndex.Path] = path; + return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); + } + function _resolveUrl(base, url) { + var parts = _split(encodeURI(url)); + var baseParts = _split(base); + if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { + return _joinAndCanonicalizePath(parts); + } else { + parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; + } + for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { + if (lang_1.isBlank(parts[i])) { + parts[i] = baseParts[i]; + } + } + if (parts[_ComponentIndex.Path][0] == '/') { + return _joinAndCanonicalizePath(parts); + } + var path = baseParts[_ComponentIndex.Path]; + if (lang_1.isBlank(path)) + path = '/'; + var index = path.lastIndexOf('/'); + path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; + parts[_ComponentIndex.Path] = path; + return _joinAndCanonicalizePath(parts); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services/title", ["angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Title = (function() { + function Title() {} + Title.prototype.getTitle = function() { + return dom_adapter_1.DOM.getTitle(); + }; + Title.prototype.setTitle = function(newTitle) { + dom_adapter_1.DOM.setTitle(newTitle); + }; + return Title; + })(); + exports.Title = Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + exports.NgZone = ng_zone_1.NgZone; + exports.NgZoneError = ng_zone_1.NgZoneError; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_1 = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var DebugElement = (function() { + function DebugElement() {} + Object.defineProperty(DebugElement.prototype, "componentInstance", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "nativeElement", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "elementRef", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "children", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(DebugElement.prototype, "componentViewChildren", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + DebugElement.prototype.query = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var results = this.queryAll(predicate, scope); + return results.length > 0 ? results[0] : null; + }; + DebugElement.prototype.queryAll = function(predicate, scope) { + if (scope === void 0) { + scope = Scope.all; + } + var elementsInScope = scope(this); + return elementsInScope.filter(predicate); + }; + return DebugElement; + })(); + exports.DebugElement = DebugElement; + var DebugElement_ = (function(_super) { + __extends(DebugElement_, _super); + function DebugElement_(_parentView, _boundElementIndex) { + _super.call(this); + this._parentView = _parentView; + this._boundElementIndex = _boundElementIndex; + this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex]; + } + Object.defineProperty(DebugElement_.prototype, "componentInstance", { + get: function() { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.getComponent(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "nativeElement", { + get: function() { + return this.elementRef.nativeElement; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "elementRef", { + get: function() { + return this._parentView.elementRefs[this._boundElementIndex]; + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.getDirectiveInstance = function(directiveIndex) { + return this._elementInjector.getDirectiveAtIndex(directiveIndex); + }; + Object.defineProperty(DebugElement_.prototype, "children", { + get: function() { + return this._getChildElements(this._parentView, this._boundElementIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DebugElement_.prototype, "componentViewChildren", { + get: function() { + var shadowView = this._parentView.getNestedView(this._boundElementIndex); + if (!lang_1.isPresent(shadowView) || shadowView.proto.type !== view_1.ViewType.COMPONENT) { + return []; + } + return this._getChildElements(shadowView, null); + }, + enumerable: true, + configurable: true + }); + DebugElement_.prototype.triggerEventHandler = function(eventName, eventObj) { + this._parentView.triggerEventHandlers(eventName, eventObj, this._boundElementIndex); + }; + DebugElement_.prototype.hasDirective = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return false; + } + return this._elementInjector.hasDirective(type); + }; + DebugElement_.prototype.inject = function(type) { + if (!lang_1.isPresent(this._elementInjector)) { + return null; + } + return this._elementInjector.get(type); + }; + DebugElement_.prototype.getLocal = function(name) { + return this._parentView.locals.get(name); + }; + DebugElement_.prototype._getChildElements = function(view, parentBoundElementIndex) { + var _this = this; + var els = []; + var parentElementBinder = null; + if (lang_1.isPresent(parentBoundElementIndex)) { + parentElementBinder = view.proto.elementBinders[parentBoundElementIndex - view.elementOffset]; + } + for (var i = 0; i < view.proto.elementBinders.length; ++i) { + var binder = view.proto.elementBinders[i]; + if (binder.parent == parentElementBinder) { + els.push(new DebugElement_(view, view.elementOffset + i)); + var views = view.viewContainers[view.elementOffset + i]; + if (lang_1.isPresent(views)) { + views.views.forEach(function(nextView) { + els = els.concat(_this._getChildElements(nextView, null)); + }); + } + } + } + return els; + }; + return DebugElement_; + })(DebugElement); + exports.DebugElement_ = DebugElement_; + function inspectElement(elementRef) { + return new DebugElement_(view_ref_1.internalView(elementRef.parentView), elementRef.boundElementIndex); + } + exports.inspectElement = inspectElement; + function asNativeElements(arr) { + return arr.map(function(debugEl) { + return debugEl.nativeElement; + }); + } + exports.asNativeElements = asNativeElements; + var Scope = (function() { + function Scope() {} + Scope.all = function(debugElement) { + var scope = []; + scope.push(debugElement); + debugElement.children.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + debugElement.componentViewChildren.forEach(function(child) { + return scope = scope.concat(Scope.all(child)); + }); + return scope; + }; + Scope.light = function(debugElement) { + var scope = []; + debugElement.children.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + Scope.view = function(debugElement) { + var scope = []; + debugElement.componentViewChildren.forEach(function(child) { + scope.push(child); + scope = scope.concat(Scope.light(child)); + }); + return scope; + }; + return Scope; + })(); + exports.Scope = Scope; + var By = (function() { + function By() {} + By.all = function() { + return function(debugElement) { + return true; + }; + }; + By.css = function(selector) { + return function(debugElement) { + return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; + }; + }; + By.directive = function(type) { + return function(debugElement) { + return debugElement.hasDirective(type); + }; + }; + return By; + })(); + exports.By = By; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug/debug_element_view_listener", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/linker/view_listener", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/api", "angular2/src/core/debug/debug_element"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var api_1 = require("angular2/src/core/render/api"); + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + var NG_ID_PROPERTY = 'ngid'; + var INSPECT_GLOBAL_NAME = 'ng.probe'; + var NG_ID_SEPARATOR = '#'; + var _allIdsByView = new collection_1.Map(); + var _allViewsById = new collection_1.Map(); + var _nextId = 0; + function _setElementId(element, indices) { + if (lang_1.isPresent(element)) { + dom_adapter_1.DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); + } + } + function _getElementId(element) { + var elId = dom_adapter_1.DOM.getData(element, NG_ID_PROPERTY); + if (lang_1.isPresent(elId)) { + return elId.split(NG_ID_SEPARATOR).map(function(partStr) { + return lang_1.NumberWrapper.parseInt(partStr, 10); + }); + } else { + return null; + } + } + function inspectNativeElement(element) { + var elId = _getElementId(element); + if (lang_1.isPresent(elId)) { + var view = _allViewsById.get(elId[0]); + if (lang_1.isPresent(view)) { + return new debug_element_1.DebugElement_(view, elId[1]); + } + } + return null; + } + exports.inspectNativeElement = inspectNativeElement; + var DebugElementViewListener = (function() { + function DebugElementViewListener(_renderer) { + this._renderer = _renderer; + dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); + } + DebugElementViewListener.prototype.onViewCreated = function(view) { + var viewId = _nextId++; + _allViewsById.set(viewId, view); + _allIdsByView.set(view, viewId); + for (var i = 0; i < view.elementRefs.length; i++) { + var el = view.elementRefs[i]; + _setElementId(this._renderer.getNativeElementSync(el), [viewId, i]); + } + }; + DebugElementViewListener.prototype.onViewDestroyed = function(view) { + var viewId = _allIdsByView.get(view); + _allIdsByView.delete(view); + _allViewsById.delete(viewId); + }; + DebugElementViewListener = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [api_1.Renderer])], DebugElementViewListener); + return DebugElementViewListener; + })(); + exports.DebugElementViewListener = DebugElementViewListener; + exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([DebugElementViewListener, lang_1.CONST_EXPR(new di_1.Provider(view_listener_1.AppViewListener, {useExisting: DebugElementViewListener}))]); + exports.ELEMENT_PROBE_BINDINGS = exports.ELEMENT_PROBE_PROVIDERS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/profile", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var profile_1 = require("angular2/src/core/profile/profile"); + exports.wtfCreateScope = profile_1.wtfCreateScope; + exports.wtfLeave = profile_1.wtfLeave; + exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; + exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/post_message_bus", ["angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var PostMessageBus = (function() { + function PostMessageBus(sink, source) { + this.sink = sink; + this.source = source; + } + PostMessageBus.prototype.attachToZone = function(zone) { + this.source.attachToZone(zone); + this.sink.attachToZone(zone); + }; + PostMessageBus.prototype.initChannel = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this.source.initChannel(channel, runInZone); + this.sink.initChannel(channel, runInZone); + }; + PostMessageBus.prototype.from = function(channel) { + return this.source.from(channel); + }; + PostMessageBus.prototype.to = function(channel) { + return this.sink.to(channel); + }; + PostMessageBus = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [PostMessageBusSink, PostMessageBusSource])], PostMessageBus); + return PostMessageBus; + })(); + exports.PostMessageBus = PostMessageBus; + var PostMessageBusSink = (function() { + function PostMessageBusSink(_postMessageTarget) { + this._postMessageTarget = _postMessageTarget; + this._channels = collection_1.StringMapWrapper.create(); + this._messageBuffer = []; + } + PostMessageBusSink.prototype.attachToZone = function(zone) { + var _this = this; + this._zone = zone; + this._zone.overrideOnEventDone(function() { + return _this._handleOnEventDone(); + }, false); + }; + PostMessageBusSink.prototype.initChannel = function(channel, runInZone) { + var _this = this; + if (runInZone === void 0) { + runInZone = true; + } + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + throw new exceptions_1.BaseException(channel + " has already been initialized"); + } + var emitter = new async_1.EventEmitter(); + var channelInfo = new _Channel(emitter, runInZone); + this._channels[channel] = channelInfo; + emitter.subscribe(function(data) { + var message = { + channel: channel, + message: data + }; + if (runInZone) { + _this._messageBuffer.push(message); + } else { + _this._sendMessages([message]); + } + }); + }; + PostMessageBusSink.prototype.to = function(channel) { + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + return this._channels[channel].emitter; + } else { + throw new exceptions_1.BaseException(channel + " is not set up. Did you forget to call initChannel?"); + } + }; + PostMessageBusSink.prototype._handleOnEventDone = function() { + if (this._messageBuffer.length > 0) { + this._sendMessages(this._messageBuffer); + this._messageBuffer = []; + } + }; + PostMessageBusSink.prototype._sendMessages = function(messages) { + this._postMessageTarget.postMessage(messages); + }; + return PostMessageBusSink; + })(); + exports.PostMessageBusSink = PostMessageBusSink; + var PostMessageBusSource = (function() { + function PostMessageBusSource(eventTarget) { + var _this = this; + this._channels = collection_1.StringMapWrapper.create(); + if (eventTarget) { + eventTarget.addEventListener("message", function(ev) { + return _this._handleMessages(ev); + }); + } else { + addEventListener("message", function(ev) { + return _this._handleMessages(ev); + }); + } + } + PostMessageBusSource.prototype.attachToZone = function(zone) { + this._zone = zone; + }; + PostMessageBusSource.prototype.initChannel = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + throw new exceptions_1.BaseException(channel + " has already been initialized"); + } + var emitter = new async_1.EventEmitter(); + var channelInfo = new _Channel(emitter, runInZone); + this._channels[channel] = channelInfo; + }; + PostMessageBusSource.prototype.from = function(channel) { + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + return this._channels[channel].emitter; + } else { + throw new exceptions_1.BaseException(channel + " is not set up. Did you forget to call initChannel?"); + } + }; + PostMessageBusSource.prototype._handleMessages = function(ev) { + var messages = ev.data; + for (var i = 0; i < messages.length; i++) { + this._handleMessage(messages[i]); + } + }; + PostMessageBusSource.prototype._handleMessage = function(data) { + var channel = data.channel; + if (collection_1.StringMapWrapper.contains(this._channels, channel)) { + var channelInfo = this._channels[channel]; + if (channelInfo.runInZone) { + this._zone.run(function() { + channelInfo.emitter.next(data.message); + }); + } else { + channelInfo.emitter.next(data.message); + } + } + }; + return PostMessageBusSource; + })(); + exports.PostMessageBusSource = PostMessageBusSource; + var _Channel = (function() { + function _Channel(emitter, runInZone) { + this.emitter = emitter; + this.runInZone = runInZone; + } + return _Channel; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var XHR = (function() { + function XHR() {} + XHR.prototype.get = function(url) { + return null; + }; + return XHR; + })(); + exports.XHR = XHR; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/message_bus", ["angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_1 = require("angular2/src/facade/async"); + exports.EventEmitter = async_1.EventEmitter; + exports.Observable = async_1.Observable; + var MessageBus = (function() { + function MessageBus() {} + return MessageBus; + })(); + exports.MessageBus = MessageBus; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/api", ["angular2/src/facade/lang", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + exports.ON_WEB_WORKER = lang_1.CONST_EXPR(new di_1.OpaqueToken('WebWorker.onWebWorker')); + var WebWorkerElementRef = (function() { + function WebWorkerElementRef(renderView, boundElementIndex) { + this.renderView = renderView; + this.boundElementIndex = boundElementIndex; + } + return WebWorkerElementRef; + })(); + exports.WebWorkerElementRef = WebWorkerElementRef; + var WebWorkerTemplateCmd = (function() { + function WebWorkerTemplateCmd() {} + WebWorkerTemplateCmd.prototype.visit = function(visitor, context) { + return null; + }; + return WebWorkerTemplateCmd; + })(); + exports.WebWorkerTemplateCmd = WebWorkerTemplateCmd; + var WebWorkerTextCmd = (function() { + function WebWorkerTextCmd(isBound, ngContentIndex, value) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.value = value; + } + WebWorkerTextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return WebWorkerTextCmd; + })(); + exports.WebWorkerTextCmd = WebWorkerTextCmd; + var WebWorkerNgContentCmd = (function() { + function WebWorkerNgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + } + WebWorkerNgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return WebWorkerNgContentCmd; + })(); + exports.WebWorkerNgContentCmd = WebWorkerNgContentCmd; + var WebWorkerBeginElementCmd = (function() { + function WebWorkerBeginElementCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + } + WebWorkerBeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + return WebWorkerBeginElementCmd; + })(); + exports.WebWorkerBeginElementCmd = WebWorkerBeginElementCmd; + var WebWorkerEndElementCmd = (function() { + function WebWorkerEndElementCmd() {} + WebWorkerEndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + return WebWorkerEndElementCmd; + })(); + exports.WebWorkerEndElementCmd = WebWorkerEndElementCmd; + var WebWorkerBeginComponentCmd = (function() { + function WebWorkerBeginComponentCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, templateId) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.templateId = templateId; + } + WebWorkerBeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + return WebWorkerBeginComponentCmd; + })(); + exports.WebWorkerBeginComponentCmd = WebWorkerBeginComponentCmd; + var WebWorkerEndComponentCmd = (function() { + function WebWorkerEndComponentCmd() {} + WebWorkerEndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + return WebWorkerEndComponentCmd; + })(); + exports.WebWorkerEndComponentCmd = WebWorkerEndComponentCmd; + var WebWorkerEmbeddedTemplateCmd = (function() { + function WebWorkerEmbeddedTemplateCmd(isBound, ngContentIndex, name, attrNameAndValues, eventTargetAndNames, isMerged, children) { + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.isMerged = isMerged; + this.children = children; + } + WebWorkerEmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return WebWorkerEmbeddedTemplateCmd; + })(); + exports.WebWorkerEmbeddedTemplateCmd = WebWorkerEmbeddedTemplateCmd; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_proto_view_ref_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var RenderProtoViewRefStore = (function() { + function RenderProtoViewRefStore(onWebworker) { + this._lookupByIndex = new Map(); + this._lookupByProtoView = new Map(); + this._nextIndex = 0; + this._onWebworker = onWebworker; + } + RenderProtoViewRefStore.prototype.allocate = function() { + var index = this._nextIndex++; + var result = new WebWorkerRenderProtoViewRef(index); + this.store(result, index); + return result; + }; + RenderProtoViewRefStore.prototype.store = function(ref, index) { + this._lookupByProtoView.set(ref, index); + this._lookupByIndex.set(index, ref); + }; + RenderProtoViewRefStore.prototype.deserialize = function(index) { + if (index == null) { + return null; + } + return this._lookupByIndex.get(index); + }; + RenderProtoViewRefStore.prototype.serialize = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebworker) { + return ref.refNumber; + } else { + return this._lookupByProtoView.get(ref); + } + }; + RenderProtoViewRefStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderProtoViewRefStore); + return RenderProtoViewRefStore; + })(); + exports.RenderProtoViewRefStore = RenderProtoViewRefStore; + var WebWorkerRenderProtoViewRef = (function(_super) { + __extends(WebWorkerRenderProtoViewRef, _super); + function WebWorkerRenderProtoViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + return WebWorkerRenderProtoViewRef; + })(api_1.RenderProtoViewRef); + exports.WebWorkerRenderProtoViewRef = WebWorkerRenderProtoViewRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/render_view_with_fragments_store", ["angular2/src/core/di", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var collection_1 = require("angular2/src/facade/collection"); + var RenderViewWithFragmentsStore = (function() { + function RenderViewWithFragmentsStore(onWebWorker) { + this._nextIndex = 0; + this._onWebWorker = onWebWorker; + this._lookupByIndex = new Map(); + this._lookupByView = new Map(); + this._viewFragments = new Map(); + } + RenderViewWithFragmentsStore.prototype.allocate = function(fragmentCount) { + var initialIndex = this._nextIndex; + var viewRef = new WebWorkerRenderViewRef(this._nextIndex++); + var fragmentRefs = collection_1.ListWrapper.createGrowableSize(fragmentCount); + for (var i = 0; i < fragmentCount; i++) { + fragmentRefs[i] = new WebWorkerRenderFragmentRef(this._nextIndex++); + } + var renderViewWithFragments = new api_1.RenderViewWithFragments(viewRef, fragmentRefs); + this.store(renderViewWithFragments, initialIndex); + return renderViewWithFragments; + }; + RenderViewWithFragmentsStore.prototype.store = function(view, startIndex) { + var _this = this; + this._lookupByIndex.set(startIndex, view.viewRef); + this._lookupByView.set(view.viewRef, startIndex); + startIndex++; + view.fragmentRefs.forEach(function(ref) { + _this._lookupByIndex.set(startIndex, ref); + _this._lookupByView.set(ref, startIndex); + startIndex++; + }); + this._viewFragments.set(view.viewRef, view.fragmentRefs); + }; + RenderViewWithFragmentsStore.prototype.remove = function(view) { + var _this = this; + this._removeRef(view); + var fragments = this._viewFragments.get(view); + fragments.forEach(function(fragment) { + _this._removeRef(fragment); + }); + this._viewFragments.delete(view); + }; + RenderViewWithFragmentsStore.prototype._removeRef = function(ref) { + var index = this._lookupByView.get(ref); + this._lookupByView.delete(ref); + this._lookupByIndex.delete(index); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderViewRef = function(viewRef) { + return this._serializeRenderFragmentOrViewRef(viewRef); + }; + RenderViewWithFragmentsStore.prototype.serializeRenderFragmentRef = function(fragmentRef) { + return this._serializeRenderFragmentOrViewRef(fragmentRef); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderViewRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype.deserializeRenderFragmentRef = function(ref) { + if (ref == null) { + return null; + } + return this._retrieve(ref); + }; + RenderViewWithFragmentsStore.prototype._retrieve = function(ref) { + if (ref == null) { + return null; + } + if (!this._lookupByIndex.has(ref)) { + return null; + } + return this._lookupByIndex.get(ref); + }; + RenderViewWithFragmentsStore.prototype._serializeRenderFragmentOrViewRef = function(ref) { + if (ref == null) { + return null; + } + if (this._onWebWorker) { + return ref.serialize(); + } else { + return this._lookupByView.get(ref); + } + }; + RenderViewWithFragmentsStore.prototype.serializeViewWithFragments = function(view) { + var _this = this; + if (view == null) { + return null; + } + if (this._onWebWorker) { + return { + 'viewRef': view.viewRef.serialize(), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return val.serialize(); + }) + }; + } else { + return { + 'viewRef': this._lookupByView.get(view.viewRef), + 'fragmentRefs': view.fragmentRefs.map(function(val) { + return _this._lookupByView.get(val); + }) + }; + } + }; + RenderViewWithFragmentsStore.prototype.deserializeViewWithFragments = function(obj) { + var _this = this; + if (obj == null) { + return null; + } + var viewRef = this.deserializeRenderViewRef(obj['viewRef']); + var fragments = obj['fragmentRefs'].map(function(val) { + return _this.deserializeRenderFragmentRef(val); + }); + return new api_1.RenderViewWithFragments(viewRef, fragments); + }; + RenderViewWithFragmentsStore = __decorate([di_1.Injectable(), __param(0, di_1.Inject(api_2.ON_WEB_WORKER)), __metadata('design:paramtypes', [Object])], RenderViewWithFragmentsStore); + return RenderViewWithFragmentsStore; + })(); + exports.RenderViewWithFragmentsStore = RenderViewWithFragmentsStore; + var WebWorkerRenderViewRef = (function(_super) { + __extends(WebWorkerRenderViewRef, _super); + function WebWorkerRenderViewRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderViewRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderViewRef.deserialize = function(ref) { + return new WebWorkerRenderViewRef(ref); + }; + return WebWorkerRenderViewRef; + })(api_1.RenderViewRef); + exports.WebWorkerRenderViewRef = WebWorkerRenderViewRef; + var WebWorkerRenderFragmentRef = (function(_super) { + __extends(WebWorkerRenderFragmentRef, _super); + function WebWorkerRenderFragmentRef(refNumber) { + _super.call(this); + this.refNumber = refNumber; + } + WebWorkerRenderFragmentRef.prototype.serialize = function() { + return this.refNumber; + }; + WebWorkerRenderFragmentRef.deserialize = function(ref) { + return new WebWorkerRenderFragmentRef(ref); + }; + return WebWorkerRenderFragmentRef; + })(api_1.RenderFragmentRef); + exports.WebWorkerRenderFragmentRef = WebWorkerRenderFragmentRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/messaging_api", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.SETUP_CHANNEL = "ng-WebWorkerSetup"; + exports.RENDERER_CHANNEL = "ng-Renderer"; + exports.XHR_CHANNEL = "ng-XHR"; + exports.EVENT_CHANNEL = "ng-events"; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/event_deserializer", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function deserializeGenericEvent(serializedEvent) { + return serializedEvent; + } + exports.deserializeGenericEvent = deserializeGenericEvent; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/service_message_broker", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/web_workers/shared/serializer", "angular2/src/facade/lang", "angular2/src/web_workers/shared/message_bus", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var lang_1 = require("angular2/src/facade/lang"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var async_1 = require("angular2/src/facade/async"); + var ServiceMessageBrokerFactory = (function() { + function ServiceMessageBrokerFactory() {} + return ServiceMessageBrokerFactory; + })(); + exports.ServiceMessageBrokerFactory = ServiceMessageBrokerFactory; + var ServiceMessageBrokerFactory_ = (function(_super) { + __extends(ServiceMessageBrokerFactory_, _super); + function ServiceMessageBrokerFactory_(_messageBus, _serializer) { + _super.call(this); + this._messageBus = _messageBus; + this._serializer = _serializer; + } + ServiceMessageBrokerFactory_.prototype.createMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this._messageBus.initChannel(channel, runInZone); + return new ServiceMessageBroker_(this._messageBus, this._serializer, channel); + }; + ServiceMessageBrokerFactory_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, serializer_1.Serializer])], ServiceMessageBrokerFactory_); + return ServiceMessageBrokerFactory_; + })(ServiceMessageBrokerFactory); + exports.ServiceMessageBrokerFactory_ = ServiceMessageBrokerFactory_; + var ServiceMessageBroker = (function() { + function ServiceMessageBroker() {} + return ServiceMessageBroker; + })(); + exports.ServiceMessageBroker = ServiceMessageBroker; + var ServiceMessageBroker_ = (function(_super) { + __extends(ServiceMessageBroker_, _super); + function ServiceMessageBroker_(messageBus, _serializer, channel) { + var _this = this; + _super.call(this); + this._serializer = _serializer; + this.channel = channel; + this._methods = new collection_1.Map(); + this._sink = messageBus.to(channel); + var source = messageBus.from(channel); + async_1.ObservableWrapper.subscribe(source, function(message) { + return _this._handleMessage(message); + }); + } + ServiceMessageBroker_.prototype.registerMethod = function(methodName, signature, method, returnType) { + var _this = this; + this._methods.set(methodName, function(message) { + var serializedArgs = message.args; + var deserializedArgs = collection_1.ListWrapper.createFixedSize(signature.length); + for (var i = 0; i < signature.length; i++) { + var serializedArg = serializedArgs[i]; + deserializedArgs[i] = _this._serializer.deserialize(serializedArg, signature[i]); + } + var promise = lang_1.FunctionWrapper.apply(method, deserializedArgs); + if (lang_1.isPresent(returnType) && lang_1.isPresent(promise)) { + _this._wrapWebWorkerPromise(message.id, promise, returnType); + } + }); + }; + ServiceMessageBroker_.prototype._handleMessage = function(map) { + var message = new ReceivedMessage(map); + if (this._methods.has(message.method)) { + this._methods.get(message.method)(message); + } + }; + ServiceMessageBroker_.prototype._wrapWebWorkerPromise = function(id, promise, type) { + var _this = this; + async_1.PromiseWrapper.then(promise, function(result) { + async_1.ObservableWrapper.callNext(_this._sink, { + 'type': 'result', + 'value': _this._serializer.serialize(result, type), + 'id': id + }); + }); + }; + return ServiceMessageBroker_; + })(ServiceMessageBroker); + exports.ServiceMessageBroker_ = ServiceMessageBroker_; + var ReceivedMessage = (function() { + function ReceivedMessage(data) { + this.method = data['method']; + this.args = data['args']; + this.id = data['id']; + this.type = data['type']; + } + return ReceivedMessage; + })(); + exports.ReceivedMessage = ReceivedMessage; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var _EMPTY_ATTR_VALUE = ''; + var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); + var CssSelector = (function() { + function CssSelector() { + this.element = null; + this.classNames = []; + this.attrs = []; + this.notSelectors = []; + } + CssSelector.parse = function(selector) { + var results = []; + var _addResult = function(res, cssSel) { + if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { + cssSel.element = "*"; + } + res.push(cssSel); + }; + var cssSelector = new CssSelector(); + var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); + var match; + var current = cssSelector; + var inNot = false; + while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { + if (lang_1.isPresent(match[1])) { + if (inNot) { + throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); + } + inNot = true; + current = new CssSelector(); + cssSelector.notSelectors.push(current); + } + if (lang_1.isPresent(match[2])) { + current.setElement(match[2]); + } + if (lang_1.isPresent(match[3])) { + current.addClassName(match[3]); + } + if (lang_1.isPresent(match[4])) { + current.addAttribute(match[4], match[5]); + } + if (lang_1.isPresent(match[6])) { + inNot = false; + current = cssSelector; + } + if (lang_1.isPresent(match[7])) { + if (inNot) { + throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); + } + _addResult(results, cssSelector); + cssSelector = current = new CssSelector(); + } + } + _addResult(results, cssSelector); + return results; + }; + CssSelector.prototype.isElementSelector = function() { + return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; + }; + CssSelector.prototype.setElement = function(element) { + if (element === void 0) { + element = null; + } + if (lang_1.isPresent(element)) { + element = element.toLowerCase(); + } + this.element = element; + }; + CssSelector.prototype.getMatchingElementTemplate = function() { + var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; + var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; + var attrs = ''; + for (var i = 0; i < this.attrs.length; i += 2) { + var attrName = this.attrs[i]; + var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; + attrs += " " + attrName + attrValue; + } + return "<" + tagName + classAttr + attrs + ">"; + }; + CssSelector.prototype.addAttribute = function(name, value) { + if (value === void 0) { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(name.toLowerCase()); + if (lang_1.isPresent(value)) { + value = value.toLowerCase(); + } else { + value = _EMPTY_ATTR_VALUE; + } + this.attrs.push(value); + }; + CssSelector.prototype.addClassName = function(name) { + this.classNames.push(name.toLowerCase()); + }; + CssSelector.prototype.toString = function() { + var res = ''; + if (lang_1.isPresent(this.element)) { + res += this.element; + } + if (lang_1.isPresent(this.classNames)) { + for (var i = 0; i < this.classNames.length; i++) { + res += '.' + this.classNames[i]; + } + } + if (lang_1.isPresent(this.attrs)) { + for (var i = 0; i < this.attrs.length; ) { + var attrName = this.attrs[i++]; + var attrValue = this.attrs[i++]; + res += '[' + attrName; + if (attrValue.length > 0) { + res += '=' + attrValue; + } + res += ']'; + } + } + this.notSelectors.forEach(function(notSelector) { + return res += ":not(" + notSelector + ")"; + }); + return res; + }; + return CssSelector; + })(); + exports.CssSelector = CssSelector; + var SelectorMatcher = (function() { + function SelectorMatcher() { + this._elementMap = new collection_1.Map(); + this._elementPartialMap = new collection_1.Map(); + this._classMap = new collection_1.Map(); + this._classPartialMap = new collection_1.Map(); + this._attrValueMap = new collection_1.Map(); + this._attrValuePartialMap = new collection_1.Map(); + this._listContexts = []; + } + SelectorMatcher.createNotMatcher = function(notSelectors) { + var notMatcher = new SelectorMatcher(); + notMatcher.addSelectables(notSelectors, null); + return notMatcher; + }; + SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { + var listContext = null; + if (cssSelectors.length > 1) { + listContext = new SelectorListContext(cssSelectors); + this._listContexts.push(listContext); + } + for (var i = 0; i < cssSelectors.length; i++) { + this._addSelectable(cssSelectors[i], callbackCtxt, listContext); + } + }; + SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { + var matcher = this; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); + if (lang_1.isPresent(element)) { + var isTerminal = attrs.length === 0 && classNames.length === 0; + if (isTerminal) { + this._addTerminal(matcher._elementMap, element, selectable); + } else { + matcher = this._addPartial(matcher._elementPartialMap, element); + } + } + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var isTerminal = attrs.length === 0 && index === classNames.length - 1; + var className = classNames[index]; + if (isTerminal) { + this._addTerminal(matcher._classMap, className, selectable); + } else { + matcher = this._addPartial(matcher._classPartialMap, className); + } + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var isTerminal = index === attrs.length - 2; + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + if (isTerminal) { + var terminalMap = matcher._attrValueMap; + var terminalValuesMap = terminalMap.get(attrName); + if (lang_1.isBlank(terminalValuesMap)) { + terminalValuesMap = new collection_1.Map(); + terminalMap.set(attrName, terminalValuesMap); + } + this._addTerminal(terminalValuesMap, attrValue, selectable); + } else { + var parttialMap = matcher._attrValuePartialMap; + var partialValuesMap = parttialMap.get(attrName); + if (lang_1.isBlank(partialValuesMap)) { + partialValuesMap = new collection_1.Map(); + parttialMap.set(attrName, partialValuesMap); + } + matcher = this._addPartial(partialValuesMap, attrValue); + } + } + } + }; + SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { + var terminalList = map.get(name); + if (lang_1.isBlank(terminalList)) { + terminalList = []; + map.set(name, terminalList); + } + terminalList.push(selectable); + }; + SelectorMatcher.prototype._addPartial = function(map, name) { + var matcher = map.get(name); + if (lang_1.isBlank(matcher)) { + matcher = new SelectorMatcher(); + map.set(name, matcher); + } + return matcher; + }; + SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { + var result = false; + var element = cssSelector.element; + var classNames = cssSelector.classNames; + var attrs = cssSelector.attrs; + for (var i = 0; i < this._listContexts.length; i++) { + this._listContexts[i].alreadyMatched = false; + } + result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; + if (lang_1.isPresent(classNames)) { + for (var index = 0; index < classNames.length; index++) { + var className = classNames[index]; + result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; + result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; + } + } + if (lang_1.isPresent(attrs)) { + for (var index = 0; index < attrs.length; ) { + var attrName = attrs[index++]; + var attrValue = attrs[index++]; + var terminalValuesMap = this._attrValueMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; + var partialValuesMap = this._attrValuePartialMap.get(attrName); + if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { + result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; + } + result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; + } + } + return result; + }; + SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var selectables = map.get(name); + var starSelectables = map.get("*"); + if (lang_1.isPresent(starSelectables)) { + selectables = selectables.concat(starSelectables); + } + if (lang_1.isBlank(selectables)) { + return false; + } + var selectable; + var result = false; + for (var index = 0; index < selectables.length; index++) { + selectable = selectables[index]; + result = selectable.finalize(cssSelector, matchedCallback) || result; + } + return result; + }; + SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { + if (lang_1.isBlank(map) || lang_1.isBlank(name)) { + return false; + } + var nestedSelector = map.get(name); + if (lang_1.isBlank(nestedSelector)) { + return false; + } + return nestedSelector.match(cssSelector, matchedCallback); + }; + return SelectorMatcher; + })(); + exports.SelectorMatcher = SelectorMatcher; + var SelectorListContext = (function() { + function SelectorListContext(selectors) { + this.selectors = selectors; + this.alreadyMatched = false; + } + return SelectorListContext; + })(); + exports.SelectorListContext = SelectorListContext; + var SelectorContext = (function() { + function SelectorContext(selector, cbContext, listContext) { + this.selector = selector; + this.cbContext = cbContext; + this.listContext = listContext; + this.notSelectors = selector.notSelectors; + } + SelectorContext.prototype.finalize = function(cssSelector, callback) { + var result = true; + if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); + result = !notMatcher.match(cssSelector, null); + } + if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { + if (lang_1.isPresent(this.listContext)) { + this.listContext.alreadyMatched = true; + } + callback(this.selector, this.cbContext); + } + return result; + }; + return SelectorContext; + })(); + exports.SelectorContext = SelectorContext; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var CAMEL_CASE_REGEXP = /([A-Z])/g; + var DASH_CASE_REGEXP = /-([a-z])/g; + var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\$/g; + var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\$/g; + exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; + function camelCaseToDashCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { + return '-' + m[1].toLowerCase(); + }); + } + exports.camelCaseToDashCase = camelCaseToDashCase; + function dashCaseToCamelCase(input) { + return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { + return m[1].toUpperCase(); + }); + } + exports.dashCaseToCamelCase = dashCaseToCamelCase; + function escapeSingleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; + } + exports.escapeSingleQuoteString = escapeSingleQuoteString; + function escapeDoubleQuoteString(input) { + if (lang_1.isBlank(input)) { + return null; + } + return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; + } + exports.escapeDoubleQuoteString = escapeDoubleQuoteString; + function escapeString(input, re) { + return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { + if (match[0] == '$') { + return lang_1.IS_DART ? '\\$' : '$'; + } else if (match[0] == '\n') { + return '\\n'; + } else { + return "\\" + match[0]; + } + }); + } + function codeGenExportVariable(name) { + if (lang_1.IS_DART) { + return "const " + name + " = "; + } else { + return "var " + name + " = exports['" + name + "'] = "; + } + } + exports.codeGenExportVariable = codeGenExportVariable; + function codeGenConstConstructorCall(name) { + if (lang_1.IS_DART) { + return "const " + name; + } else { + return "new " + name; + } + } + exports.codeGenConstConstructorCall = codeGenConstConstructorCall; + function codeGenValueFn(params, value, fnName) { + if (fnName === void 0) { + fnName = ''; + } + if (lang_1.IS_DART) { + return fnName + "(" + params.join(',') + ") => " + value; + } else { + return "function " + fnName + "(" + params.join(',') + ") { return " + value + "; }"; + } + } + exports.codeGenValueFn = codeGenValueFn; + function codeGenToString(expr) { + if (lang_1.IS_DART) { + return "'${" + expr + "}'"; + } else { + return expr; + } + } + exports.codeGenToString = codeGenToString; + function splitAtColon(input, defaultValues) { + var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); + if (parts.length > 1) { + return parts; + } else { + return defaultValues; + } + } + exports.splitAtColon = splitAtColon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; + function moduleRef(moduleUrl) { + return "#MODULE[" + moduleUrl + "]"; + } + exports.moduleRef = moduleRef; + var SourceModule = (function() { + function SourceModule(moduleUrl, sourceWithModuleRefs) { + this.moduleUrl = moduleUrl; + this.sourceWithModuleRefs = sourceWithModuleRefs; + } + SourceModule.prototype.getSourceWithImports = function() { + var _this = this; + var moduleAliases = {}; + var imports = []; + var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { + var moduleUrl = match[1]; + var alias = moduleAliases[moduleUrl]; + if (lang_1.isBlank(alias)) { + if (moduleUrl == _this.moduleUrl) { + alias = ''; + } else { + alias = "import" + imports.length; + imports.push([moduleUrl, alias]); + } + moduleAliases[moduleUrl] = alias; + } + return alias.length > 0 ? alias + "." : ''; + }); + return new SourceWithImports(newSource, imports); + }; + return SourceModule; + })(); + exports.SourceModule = SourceModule; + var SourceExpression = (function() { + function SourceExpression(declarations, expression) { + this.declarations = declarations; + this.expression = expression; + } + return SourceExpression; + })(); + exports.SourceExpression = SourceExpression; + var SourceExpressions = (function() { + function SourceExpressions(declarations, expressions) { + this.declarations = declarations; + this.expressions = expressions; + } + return SourceExpressions; + })(); + exports.SourceExpressions = SourceExpressions; + var SourceWithImports = (function() { + function SourceWithImports(source, imports) { + this.source = source; + this.imports = imports; + } + return SourceWithImports; + })(); + exports.SourceWithImports = SourceWithImports; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var TextAst = (function() { + function TextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + TextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return TextAst; + })(); + exports.TextAst = TextAst; + var BoundTextAst = (function() { + function BoundTextAst(value, ngContentIndex, sourceInfo) { + this.value = value; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + BoundTextAst.prototype.visit = function(visitor, context) { + return visitor.visitBoundText(this, context); + }; + return BoundTextAst; + })(); + exports.BoundTextAst = BoundTextAst; + var AttrAst = (function() { + function AttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + AttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return AttrAst; + })(); + exports.AttrAst = AttrAst; + var BoundElementPropertyAst = (function() { + function BoundElementPropertyAst(name, type, value, unit, sourceInfo) { + this.name = name; + this.type = type; + this.value = value; + this.unit = unit; + this.sourceInfo = sourceInfo; + } + BoundElementPropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitElementProperty(this, context); + }; + return BoundElementPropertyAst; + })(); + exports.BoundElementPropertyAst = BoundElementPropertyAst; + var BoundEventAst = (function() { + function BoundEventAst(name, target, handler, sourceInfo) { + this.name = name; + this.target = target; + this.handler = handler; + this.sourceInfo = sourceInfo; + } + BoundEventAst.prototype.visit = function(visitor, context) { + return visitor.visitEvent(this, context); + }; + Object.defineProperty(BoundEventAst.prototype, "fullName", { + get: function() { + if (lang_1.isPresent(this.target)) { + return this.target + ":" + this.name; + } else { + return this.name; + } + }, + enumerable: true, + configurable: true + }); + return BoundEventAst; + })(); + exports.BoundEventAst = BoundEventAst; + var VariableAst = (function() { + function VariableAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + VariableAst.prototype.visit = function(visitor, context) { + return visitor.visitVariable(this, context); + }; + return VariableAst; + })(); + exports.VariableAst = VariableAst; + var ElementAst = (function() { + function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.inputs = inputs; + this.outputs = outputs; + this.exportAsVars = exportAsVars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + ElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + ElementAst.prototype.isBound = function() { + return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); + }; + ElementAst.prototype.getComponent = function() { + return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; + }; + return ElementAst; + })(); + exports.ElementAst = ElementAst; + var EmbeddedTemplateAst = (function() { + function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceInfo) { + this.attrs = attrs; + this.outputs = outputs; + this.vars = vars; + this.directives = directives; + this.children = children; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + EmbeddedTemplateAst.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + return EmbeddedTemplateAst; + })(); + exports.EmbeddedTemplateAst = EmbeddedTemplateAst; + var BoundDirectivePropertyAst = (function() { + function BoundDirectivePropertyAst(directiveName, templateName, value, sourceInfo) { + this.directiveName = directiveName; + this.templateName = templateName; + this.value = value; + this.sourceInfo = sourceInfo; + } + BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { + return visitor.visitDirectiveProperty(this, context); + }; + return BoundDirectivePropertyAst; + })(); + exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; + var DirectiveAst = (function() { + function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceInfo) { + this.directive = directive; + this.inputs = inputs; + this.hostProperties = hostProperties; + this.hostEvents = hostEvents; + this.exportAsVars = exportAsVars; + this.sourceInfo = sourceInfo; + } + DirectiveAst.prototype.visit = function(visitor, context) { + return visitor.visitDirective(this, context); + }; + return DirectiveAst; + })(); + exports.DirectiveAst = DirectiveAst; + var NgContentAst = (function() { + function NgContentAst(index, ngContentIndex, sourceInfo) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.sourceInfo = sourceInfo; + } + NgContentAst.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + return NgContentAst; + })(); + exports.NgContentAst = NgContentAst; + (function(PropertyBindingType) { + PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; + PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; + PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; + PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; + })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); + var PropertyBindingType = exports.PropertyBindingType; + function templateVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.templateVisitAll = templateVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Codegen = (function() { + function Codegen(moduleAlias) {} + Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { + throw "Not implemented in JS"; + }; + Codegen.prototype.toString = function() { + throw "Not implemented in JS"; + }; + return Codegen; + })(); + exports.Codegen = Codegen; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var ShadowCss = (function() { + function ShadowCss() { + this.strictStyling = true; + } + ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { + if (hostSelector === void 0) { + hostSelector = ''; + } + cssText = stripComments(cssText); + cssText = this._insertDirectives(cssText); + return this._scopeCssText(cssText, selector, hostSelector); + }; + ShadowCss.prototype._insertDirectives = function(cssText) { + cssText = this._insertPolyfillDirectivesInCssText(cssText); + return this._insertPolyfillRulesInCssText(cssText); + }; + ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { + return m[1] + '{'; + }); + }; + ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { + return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[1], ''); + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + return m[3] + rule; + }); + }; + ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { + var unscoped = this._extractUnscopedRulesFromCssText(cssText); + cssText = this._insertPolyfillHostInCssText(cssText); + cssText = this._convertColonHost(cssText); + cssText = this._convertColonHostContext(cssText); + cssText = this._convertShadowDOMSelectors(cssText); + if (lang_1.isPresent(scopeSelector)) { + cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); + } + cssText = cssText + '\n' + unscoped; + return cssText.trim(); + }; + ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { + var r = '', + m; + var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); + while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { + var rule = m[0]; + rule = lang_1.StringWrapper.replace(rule, m[2], ''); + rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); + r += rule + '\n\n'; + } + return r; + }; + ShadowCss.prototype._convertColonHost = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); + }; + ShadowCss.prototype._convertColonHostContext = function(cssText) { + return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); + }; + ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { + return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { + if (lang_1.isPresent(m[2])) { + var parts = m[2].split(','), + r = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + if (lang_1.isBlank(p)) + break; + p = p.trim(); + r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); + } + return r.join(','); + } else { + return _polyfillHostNoCombinator + m[3]; + } + }); + }; + ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { + if (lang_1.StringWrapper.contains(part, _polyfillHost)) { + return this._colonHostPartReplacer(host, part, suffix); + } else { + return host + part + suffix + ', ' + part + ' ' + host + suffix; + } + }; + ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { + return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; + }; + ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { + for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { + cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); + } + return cssText; + }; + ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { + var _this = this; + return processRules(cssText, function(rule) { + var selector = rule.selector; + var content = rule.content; + if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { + selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); + } else if (rule.selector.startsWith('@media')) { + content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); + } + return new CssRule(selector, content); + }); + }; + ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { + var r = [], + parts = selector.split(','); + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + p = p.trim(); + if (this._selectorNeedsScoping(p, scopeSelector)) { + p = strict && !lang_1.StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector); + } + r.push(p); + } + return r.join(', '); + }; + ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { + var re = this._makeScopeMatcher(scopeSelector); + return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); + }; + ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { + var lre = /\[/g; + var rre = /\]/g; + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); + scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); + return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); + }; + ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { + return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); + }; + ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { + if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { + var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; + selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); + return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); + } else { + return scopeSelector + ' ' + selector; + } + }; + ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { + var isRe = /\[is=([^\]]*)\]/g; + scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { + return m[1]; + }); + var splits = [' ', '>', '+', '~'], + scoped = selector, + attrName = '[' + scopeSelector + ']'; + for (var i = 0; i < splits.length; i++) { + var sep = splits[i]; + var parts = scoped.split(sep); + scoped = parts.map(function(p) { + var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); + if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { + var re = /([^:]*)(:*)(.*)/g; + var m = lang_1.RegExpWrapper.firstMatch(re, t); + if (lang_1.isPresent(m)) { + p = m[1] + attrName + m[2] + m[3]; + } + } + return p; + }).join(sep); + } + return scoped; + }; + ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); + selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); + return selector; + }; + return ShadowCss; + })(); + exports.ShadowCss = ShadowCss; + var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; + var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; + var _polyfillHost = '-shadowcsshost'; + var _polyfillHostContext = '-shadowcsscontext'; + var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; + var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); + var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); + var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; + var _shadowDOMSelectorsRe = [/>>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow-deep\//g, /\/shadow\//g]; + var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; + var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); + var _colonHostRe = /:host/gim; + var _colonHostContextRe = /:host-context/gim; + var _commentRe = /\/\*[\s\S]*?\*\//g; + function stripComments(input) { + return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { + return ''; + }); + } + var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; + var _curlyRe = /([{}])/g; + var OPEN_CURLY = '{'; + var CLOSE_CURLY = '}'; + var BLOCK_PLACEHOLDER = '%BLOCK%'; + var CssRule = (function() { + function CssRule(selector, content) { + this.selector = selector; + this.content = content; + } + return CssRule; + })(); + exports.CssRule = CssRule; + function processRules(input, ruleCallback) { + var inputWithEscapedBlocks = escapeBlocks(input); + var nextBlockIndex = 0; + return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { + var selector = m[2]; + var content = ''; + var suffix = m[4]; + var contentPrefix = ''; + if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { + content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; + suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); + contentPrefix = '{'; + } + var rule = ruleCallback(new CssRule(selector, content)); + return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; + }); + } + exports.processRules = processRules; + var StringWithEscapedBlocks = (function() { + function StringWithEscapedBlocks(escapedString, blocks) { + this.escapedString = escapedString; + this.blocks = blocks; + } + return StringWithEscapedBlocks; + })(); + function escapeBlocks(input) { + var inputParts = lang_1.StringWrapper.split(input, _curlyRe); + var resultParts = []; + var escapedBlocks = []; + var bracketCount = 0; + var currentBlockParts = []; + for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { + var part = inputParts[partIndex]; + if (part == CLOSE_CURLY) { + bracketCount--; + } + if (bracketCount > 0) { + currentBlockParts.push(part); + } else { + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + currentBlockParts = []; + } + resultParts.push(part); + } + if (part == OPEN_CURLY) { + bracketCount++; + } + } + if (currentBlockParts.length > 0) { + escapedBlocks.push(currentBlockParts.join('')); + resultParts.push(BLOCK_PLACEHOLDER); + } + return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var StyleWithImports = (function() { + function StyleWithImports(style, styleUrls) { + this.style = style; + this.styleUrls = styleUrls; + } + return StyleWithImports; + })(); + exports.StyleWithImports = StyleWithImports; + function isStyleUrlResolvable(url) { + if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') + return false; + var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); + return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; + } + exports.isStyleUrlResolvable = isStyleUrlResolvable; + function extractStyleUrls(resolver, baseUrl, cssText) { + var foundUrls = []; + var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { + var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; + if (!isStyleUrlResolvable(url)) { + return m[0]; + } + foundUrls.push(resolver.resolve(baseUrl, url)); + return ''; + }); + return new StyleWithImports(modifiedCssText, foundUrls); + } + exports.extractStyleUrls = extractStyleUrls; + var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; + var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/command_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/linker/template_commands", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + exports.TEMPLATE_COMMANDS_MODULE_REF = source_module_1.moduleRef("package:angular2/src/core/linker/template_commands" + util_1.MODULE_SUFFIX); + var IMPLICIT_TEMPLATE_VAR = '\$implicit'; + var CLASS_ATTR = 'class'; + var STYLE_ATTR = 'style'; + var CommandCompiler = (function() { + function CommandCompiler() {} + CommandCompiler.prototype.compileComponentRuntime = function(component, template, changeDetectorFactories, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories), 0); + template_ast_1.templateVisitAll(visitor, template); + return visitor.result; + }; + CommandCompiler.prototype.compileComponentCodeGen = function(component, template, changeDetectorFactoryExpressions, componentTemplateFactory) { + var visitor = new CommandBuilderVisitor(new CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions), 0); + template_ast_1.templateVisitAll(visitor, template); + return new source_module_1.SourceExpression([], codeGenArray(visitor.result)); + }; + CommandCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], CommandCompiler); + return CommandCompiler; + })(); + exports.CommandCompiler = CommandCompiler; + var RuntimeCommandFactory = (function() { + function RuntimeCommandFactory(component, componentTemplateFactory, changeDetectorFactories) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactories = changeDetectorFactories; + } + RuntimeCommandFactory.prototype._mapDirectives = function(directives) { + return directives.map(function(directive) { + return directive.type.runtime; + }); + }; + RuntimeCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new template_commands_1.TextCmd(value, isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new template_commands_1.NgContentCmd(index, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + return new template_commands_1.BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), isBound, ngContentIndex); + }; + RuntimeCommandFactory.prototype.createEndElement = function() { + return new template_commands_1.EndElementCmd(); + }; + RuntimeCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var nestedTemplateAccessor = this.componentTemplateFactory(directives[0]); + return new template_commands_1.BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, this._mapDirectives(directives), encapsulation, ngContentIndex, nestedTemplateAccessor); + }; + RuntimeCommandFactory.prototype.createEndComponent = function() { + return new template_commands_1.EndComponentCmd(); + }; + RuntimeCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new template_commands_1.EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, this._mapDirectives(directives), isMerged, ngContentIndex, this.changeDetectorFactories[embeddedTemplateIndex], children); + }; + return RuntimeCommandFactory; + })(); + var CodegenCommandFactory = (function() { + function CodegenCommandFactory(component, componentTemplateFactory, changeDetectorFactoryExpressions) { + this.component = component; + this.componentTemplateFactory = componentTemplateFactory; + this.changeDetectorFactoryExpressions = changeDetectorFactoryExpressions; + } + CodegenCommandFactory.prototype.createText = function(value, isBound, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'TextCmd') + "(" + util_1.escapeSingleQuoteString(value) + ", " + isBound + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createNgContent = function(index, ngContentIndex) { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'NgContentCmd') + "(" + index + ", " + ngContentIndex + ")"); + }; + CodegenCommandFactory.prototype.createBeginElement = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginElementCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + isBound + ", " + ngContentIndex + ")")); + }; + CodegenCommandFactory.prototype.createEndElement = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndElementCmd') + "()"); + }; + CodegenCommandFactory.prototype.createBeginComponent = function(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex) { + var attrsExpression = codeGenArray(attrNameAndValues); + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'BeginComponentCmd') + "(" + util_1.escapeSingleQuoteString(name) + ", " + attrsExpression + ", ") + (codeGenArray(eventTargetAndNames) + ", " + codeGenArray(variableNameAndValues) + ", " + codeGenDirectivesArray(directives) + ", " + codeGenViewEncapsulation(encapsulation) + ", " + ngContentIndex + ", " + this.componentTemplateFactory(directives[0]) + ")")); + }; + CodegenCommandFactory.prototype.createEndComponent = function() { + return new Expression(util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EndComponentCmd') + "()"); + }; + CodegenCommandFactory.prototype.createEmbeddedTemplate = function(embeddedTemplateIndex, attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, children) { + return new Expression((util_1.codeGenConstConstructorCall(exports.TEMPLATE_COMMANDS_MODULE_REF + 'EmbeddedTemplateCmd') + "(" + codeGenArray(attrNameAndValues) + ", " + codeGenArray(variableNameAndValues) + ", ") + (codeGenDirectivesArray(directives) + ", " + isMerged + ", " + ngContentIndex + ", " + this.changeDetectorFactoryExpressions[embeddedTemplateIndex] + ", " + codeGenArray(children) + ")")); + }; + return CodegenCommandFactory; + })(); + function visitAndReturnContext(visitor, asts, context) { + template_ast_1.templateVisitAll(visitor, asts, context); + return context; + } + var CommandBuilderVisitor = (function() { + function CommandBuilderVisitor(commandFactory, embeddedTemplateIndex) { + this.commandFactory = commandFactory; + this.embeddedTemplateIndex = embeddedTemplateIndex; + this.result = []; + this.transitiveNgContentCount = 0; + } + CommandBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { + var attrs = keyValueArrayToMap(visitAndReturnContext(this, attrAsts, [])); + directives.forEach(function(directiveMeta) { + collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { + var prevValue = attrs[name]; + attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; + }); + }); + return mapToKeyValueArray(attrs); + }; + CommandBuilderVisitor.prototype.visitNgContent = function(ast, context) { + this.transitiveNgContentCount++; + this.result.push(this.commandFactory.createNgContent(ast.index, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + var _this = this; + this.embeddedTemplateIndex++; + var childVisitor = new CommandBuilderVisitor(this.commandFactory, this.embeddedTemplateIndex); + template_ast_1.templateVisitAll(childVisitor, ast.children); + var isMerged = childVisitor.transitiveNgContentCount > 0; + var variableNameAndValues = []; + ast.vars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR); + }); + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, [], [], directives)); + }); + this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex, this._readAttrNameAndValues(directives, ast.attrs), variableNameAndValues, directives, isMerged, ast.ngContentIndex, childVisitor.result)); + this.transitiveNgContentCount += childVisitor.transitiveNgContentCount; + this.embeddedTemplateIndex = childVisitor.embeddedTemplateIndex; + return null; + }; + CommandBuilderVisitor.prototype.visitElement = function(ast, context) { + var _this = this; + var component = ast.getComponent(); + var eventTargetAndNames = visitAndReturnContext(this, ast.outputs, []); + var variableNameAndValues = []; + if (lang_1.isBlank(component)) { + ast.exportAsVars.forEach(function(varAst) { + variableNameAndValues.push(varAst.name); + variableNameAndValues.push(null); + }); + } + var directives = []; + collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { + directiveAst.visit(_this, new DirectiveContext(index, eventTargetAndNames, variableNameAndValues, directives)); + }); + eventTargetAndNames = removeKeyValueArrayDuplicates(eventTargetAndNames); + var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); + if (lang_1.isPresent(component)) { + this.result.push(this.commandFactory.createBeginComponent(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, component.template.encapsulation, ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndComponent()); + } else { + this.result.push(this.commandFactory.createBeginElement(ast.name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, ast.isBound(), ast.ngContentIndex)); + template_ast_1.templateVisitAll(this, ast.children); + this.result.push(this.commandFactory.createEndElement()); + } + return null; + }; + CommandBuilderVisitor.prototype.visitVariable = function(ast, ctx) { + return null; + }; + CommandBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { + attrNameAndValues.push(ast.name); + attrNameAndValues.push(ast.value); + return null; + }; + CommandBuilderVisitor.prototype.visitBoundText = function(ast, context) { + this.result.push(this.commandFactory.createText(null, true, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitText = function(ast, context) { + this.result.push(this.commandFactory.createText(ast.value, false, ast.ngContentIndex)); + return null; + }; + CommandBuilderVisitor.prototype.visitDirective = function(ast, ctx) { + ctx.targetDirectives.push(ast.directive); + template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.eventTargetAndNames); + ast.exportAsVars.forEach(function(varAst) { + ctx.targetVariableNameAndValues.push(varAst.name); + ctx.targetVariableNameAndValues.push(ctx.index); + }); + return null; + }; + CommandBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { + eventTargetAndNames.push(ast.target); + eventTargetAndNames.push(ast.name); + return null; + }; + CommandBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { + return null; + }; + CommandBuilderVisitor.prototype.visitElementProperty = function(ast, context) { + return null; + }; + return CommandBuilderVisitor; + })(); + function removeKeyValueArrayDuplicates(keyValueArray) { + var knownPairs = new Set(); + var resultKeyValueArray = []; + for (var i = 0; i < keyValueArray.length; i += 2) { + var key = keyValueArray[i]; + var value = keyValueArray[i + 1]; + var pairId = key + ":" + value; + if (!collection_1.SetWrapper.has(knownPairs, pairId)) { + resultKeyValueArray.push(key); + resultKeyValueArray.push(value); + knownPairs.add(pairId); + } + } + return resultKeyValueArray; + } + function keyValueArrayToMap(keyValueArr) { + var data = {}; + for (var i = 0; i < keyValueArr.length; i += 2) { + data[keyValueArr[i]] = keyValueArr[i + 1]; + } + return data; + } + function mapToKeyValueArray(data) { + var entryArray = []; + collection_1.StringMapWrapper.forEach(data, function(value, name) { + entryArray.push([name, value]); + }); + collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + var keyValueArray = []; + entryArray.forEach(function(entry) { + keyValueArray.push(entry[0]); + keyValueArray.push(entry[1]); + }); + return keyValueArray; + } + function mergeAttributeValue(attrName, attrValue1, attrValue2) { + if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { + return attrValue1 + " " + attrValue2; + } else { + return attrValue2; + } + } + var DirectiveContext = (function() { + function DirectiveContext(index, eventTargetAndNames, targetVariableNameAndValues, targetDirectives) { + this.index = index; + this.eventTargetAndNames = eventTargetAndNames; + this.targetVariableNameAndValues = targetVariableNameAndValues; + this.targetDirectives = targetDirectives; + } + return DirectiveContext; + })(); + var Expression = (function() { + function Expression(value) { + this.value = value; + } + return Expression; + })(); + function escapeValue(value) { + if (value instanceof Expression) { + return value.value; + } else if (lang_1.isString(value)) { + return util_1.escapeSingleQuoteString(value); + } else if (lang_1.isBlank(value)) { + return 'null'; + } else { + return "" + value; + } + } + function codeGenArray(data) { + var base = "[" + data.map(escapeValue).join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenDirectivesArray(directives) { + var expressions = directives.map(function(directiveType) { + return ("" + source_module_1.moduleRef(directiveType.type.moduleUrl) + directiveType.type.name); + }); + var base = "[" + expressions.join(',') + "]"; + return lang_1.IS_DART ? "const " + base : base; + } + function codeGenViewEncapsulation(value) { + if (lang_1.IS_DART) { + return "" + exports.TEMPLATE_COMMANDS_MODULE_REF + value; + } else { + return "" + value; + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var HtmlTextAst = (function() { + function HtmlTextAst(value, sourceInfo) { + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlTextAst.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + return HtmlTextAst; + })(); + exports.HtmlTextAst = HtmlTextAst; + var HtmlAttrAst = (function() { + function HtmlAttrAst(name, value, sourceInfo) { + this.name = name; + this.value = value; + this.sourceInfo = sourceInfo; + } + HtmlAttrAst.prototype.visit = function(visitor, context) { + return visitor.visitAttr(this, context); + }; + return HtmlAttrAst; + })(); + exports.HtmlAttrAst = HtmlAttrAst; + var HtmlElementAst = (function() { + function HtmlElementAst(name, attrs, children, sourceInfo) { + this.name = name; + this.attrs = attrs; + this.children = children; + this.sourceInfo = sourceInfo; + } + HtmlElementAst.prototype.visit = function(visitor, context) { + return visitor.visitElement(this, context); + }; + return HtmlElementAst; + })(); + exports.HtmlElementAst = HtmlElementAst; + function htmlVisitAll(visitor, asts, context) { + if (context === void 0) { + context = null; + } + var result = []; + asts.forEach(function(ast) { + var astResult = ast.visit(visitor, context); + if (lang_1.isPresent(astResult)) { + result.push(astResult); + } + }); + return result; + } + exports.htmlVisitAll = htmlVisitAll; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ElementSchemaRegistry = (function() { + function ElementSchemaRegistry() {} + ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + return true; + }; + ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + return propName; + }; + return ElementSchemaRegistry; + })(); + exports.ElementSchemaRegistry = ElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var NG_CONTENT_SELECT_ATTR = 'select'; + var NG_CONTENT_ELEMENT = 'ng-content'; + var LINK_ELEMENT = 'link'; + var LINK_STYLE_REL_ATTR = 'rel'; + var LINK_STYLE_HREF_ATTR = 'href'; + var LINK_STYLE_REL_VALUE = 'stylesheet'; + var STYLE_ELEMENT = 'style'; + var SCRIPT_ELEMENT = 'script'; + var NG_NON_BINDABLE_ATTR = 'ng-non-bindable'; + function preparseElement(ast) { + var selectAttr = null; + var hrefAttr = null; + var relAttr = null; + var nonBindable = false; + ast.attrs.forEach(function(attr) { + if (attr.name == NG_CONTENT_SELECT_ATTR) { + selectAttr = attr.value; + } else if (attr.name == LINK_STYLE_HREF_ATTR) { + hrefAttr = attr.value; + } else if (attr.name == LINK_STYLE_REL_ATTR) { + relAttr = attr.value; + } else if (attr.name == NG_NON_BINDABLE_ATTR) { + nonBindable = true; + } + }); + selectAttr = normalizeNgContentSelect(selectAttr); + var nodeName = ast.name; + var type = PreparsedElementType.OTHER; + if (nodeName == NG_CONTENT_ELEMENT) { + type = PreparsedElementType.NG_CONTENT; + } else if (nodeName == STYLE_ELEMENT) { + type = PreparsedElementType.STYLE; + } else if (nodeName == SCRIPT_ELEMENT) { + type = PreparsedElementType.SCRIPT; + } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { + type = PreparsedElementType.STYLESHEET; + } + return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable); + } + exports.preparseElement = preparseElement; + (function(PreparsedElementType) { + PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; + PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; + PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; + PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; + PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; + })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); + var PreparsedElementType = exports.PreparsedElementType; + var PreparsedElement = (function() { + function PreparsedElement(type, selectAttr, hrefAttr, nonBindable) { + this.type = type; + this.selectAttr = selectAttr; + this.hrefAttr = hrefAttr; + this.nonBindable = nonBindable; + } + return PreparsedElement; + })(); + exports.PreparsedElement = PreparsedElement; + function normalizeNgContentSelect(selectAttr) { + if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { + return '*'; + } + return selectAttr; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var di_1 = require("angular2/src/core/di"); + var view_1 = require("angular2/src/core/metadata/view"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var TemplateNormalizer = (function() { + function TemplateNormalizer(_xhr, _urlResolver, _domParser) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._domParser = _domParser; + } + TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { + var _this = this; + if (lang_1.isPresent(template.template)) { + return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); + } else if (lang_1.isPresent(template.templateUrl)) { + var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); + return this._xhr.get(sourceAbsUrl).then(function(templateContent) { + return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); + }); + } else { + throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); + } + }; + TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { + var _this = this; + var domNodes = this._domParser.parse(template, directiveType.name); + var visitor = new TemplatePreparseVisitor(); + html_ast_1.htmlVisitAll(visitor, domNodes); + var allStyles = templateMeta.styles.concat(visitor.styles); + var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(templateAbsUrl, url); + }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { + return _this._urlResolver.resolve(directiveType.moduleUrl, url); + })); + var allResolvedStyles = allStyles.map(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); + styleWithImports.styleUrls.forEach(function(styleUrl) { + return allStyleAbsUrls.push(styleUrl); + }); + return styleWithImports.style; + }); + var encapsulation = templateMeta.encapsulation; + if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { + encapsulation = view_1.ViewEncapsulation.None; + } + return new directive_metadata_1.CompileTemplateMetadata({ + encapsulation: encapsulation, + template: template, + templateUrl: templateAbsUrl, + styles: allResolvedStyles, + styleUrls: allStyleAbsUrls, + ngContentSelectors: visitor.ngContentSelectors + }); + }; + TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); + return TemplateNormalizer; + })(); + exports.TemplateNormalizer = TemplateNormalizer; + var TemplatePreparseVisitor = (function() { + function TemplatePreparseVisitor() { + this.ngContentSelectors = []; + this.styles = []; + this.styleUrls = []; + this.ngNonBindableStackCount = 0; + } + TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { + var preparsedElement = template_preparser_1.preparseElement(ast); + switch (preparsedElement.type) { + case template_preparser_1.PreparsedElementType.NG_CONTENT: + if (this.ngNonBindableStackCount === 0) { + this.ngContentSelectors.push(preparsedElement.selectAttr); + } + break; + case template_preparser_1.PreparsedElementType.STYLE: + var textContent = ''; + ast.children.forEach(function(child) { + if (child instanceof html_ast_1.HtmlTextAst) { + textContent += child.value; + } + }); + this.styles.push(textContent); + break; + case template_preparser_1.PreparsedElementType.STYLESHEET: + this.styleUrls.push(preparsedElement.hrefAttr); + break; + } + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount++; + } + html_ast_1.htmlVisitAll(this, ast.children); + if (preparsedElement.nonBindable) { + this.ngNonBindableStackCount--; + } + return null; + }; + TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + TemplatePreparseVisitor.prototype.visitText = function(ast, context) { + return null; + }; + return TemplatePreparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cpl = require("angular2/src/compiler/directive_metadata"); + var md = require("angular2/src/core/metadata/directives"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var di_2 = require("angular2/src/core/di"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var util_1 = require("angular2/src/compiler/util"); + var RuntimeMetadataResolver = (function() { + function RuntimeMetadataResolver(_directiveResolver, _viewResolver, _platformDirectives) { + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._platformDirectives = _platformDirectives; + this._cache = new Map(); + } + RuntimeMetadataResolver.prototype.getMetadata = function(directiveType) { + var meta = this._cache.get(directiveType); + if (lang_1.isBlank(meta)) { + var dirMeta = this._directiveResolver.resolve(directiveType); + var moduleUrl = calcModuleUrl(directiveType, dirMeta); + var templateMeta = null; + var changeDetectionStrategy = null; + if (dirMeta instanceof md.ComponentMetadata) { + var cmpMeta = dirMeta; + var viewMeta = this._viewResolver.resolve(directiveType); + templateMeta = new cpl.CompileTemplateMetadata({ + encapsulation: viewMeta.encapsulation, + template: viewMeta.template, + templateUrl: viewMeta.templateUrl, + styles: viewMeta.styles, + styleUrls: viewMeta.styleUrls + }); + changeDetectionStrategy = cmpMeta.changeDetection; + } + meta = cpl.CompileDirectiveMetadata.create({ + selector: dirMeta.selector, + exportAs: dirMeta.exportAs, + isComponent: lang_1.isPresent(templateMeta), + dynamicLoadable: true, + type: new cpl.CompileTypeMetadata({ + name: lang_1.stringify(directiveType), + moduleUrl: moduleUrl, + runtime: directiveType + }), + template: templateMeta, + changeDetection: changeDetectionStrategy, + inputs: dirMeta.inputs, + outputs: dirMeta.outputs, + host: dirMeta.host, + lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { + return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); + }) + }); + this._cache.set(directiveType, meta); + } + return meta; + }; + RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { + var _this = this; + var view = this._viewResolver.resolve(component); + var directives = flattenDirectives(view, this._platformDirectives); + for (var i = 0; i < directives.length; i++) { + if (!isValidDirective(directives[i])) { + throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); + } + } + return removeDuplicates(directives).map(function(type) { + return _this.getMetadata(type); + }); + }; + RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(2, di_2.Optional()), __param(2, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, Array])], RuntimeMetadataResolver); + return RuntimeMetadataResolver; + })(); + exports.RuntimeMetadataResolver = RuntimeMetadataResolver; + function removeDuplicates(items) { + var m = new Map(); + items.forEach(function(i) { + return m.set(i, null); + }); + return collection_1.MapWrapper.keys(m); + } + function flattenDirectives(view, platformDirectives) { + var directives = []; + if (lang_1.isPresent(platformDirectives)) { + flattenArray(platformDirectives, directives); + } + if (lang_1.isPresent(view.directives)) { + flattenArray(view.directives, directives); + } + return directives; + } + function flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + flattenArray(item, out); + } else { + out.push(item); + } + } + } + function isValidDirective(value) { + return lang_1.isPresent(value) && (value instanceof lang_1.Type); + } + function calcModuleUrl(type, dirMeta) { + if (lang_1.isPresent(dirMeta.moduleId)) { + return "package:" + dirMeta.moduleId + util_1.MODULE_SUFFIX; + } else { + return reflection_1.reflector.importUri(type); + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var DomElementSchemaRegistry = (function(_super) { + __extends(DomElementSchemaRegistry, _super); + function DomElementSchemaRegistry() { + _super.apply(this, arguments); + this._protoElements = new Map(); + } + DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { + var element = this._protoElements.get(tagName); + if (lang_1.isBlank(element)) { + element = dom_adapter_1.DOM.createElement(tagName); + this._protoElements.set(tagName, element); + } + return element; + }; + DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { + if (tagName.indexOf('-') !== -1) { + return true; + } else { + var elm = this._getProtoElement(tagName); + return dom_adapter_1.DOM.hasProperty(elm, propName); + } + }; + DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { + var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); + return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; + }; + DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); + return DomElementSchemaRegistry; + })(element_schema_registry_1.ElementSchemaRegistry); + exports.DomElementSchemaRegistry = DomElementSchemaRegistry; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/anchor_based_app_root_url", ["angular2/src/compiler/app_root_url", "angular2/src/core/dom/dom_adapter", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var AnchorBasedAppRootUrl = (function(_super) { + __extends(AnchorBasedAppRootUrl, _super); + function AnchorBasedAppRootUrl() { + _super.call(this, ""); + var a = dom_adapter_1.DOM.createElement('a'); + dom_adapter_1.DOM.resolveAndSetHref(a, './', null); + this.value = dom_adapter_1.DOM.getHref(a); + } + AnchorBasedAppRootUrl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AnchorBasedAppRootUrl); + return AnchorBasedAppRootUrl; + })(app_root_url_1.AppRootUrl); + exports.AnchorBasedAppRootUrl = AnchorBasedAppRootUrl; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/common/unicode", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.REPLACEMENT_CHARACTER = '\uFFFD'; + exports.CODE_POINTS = { + EOF: -1, + NULL: 0x00, + TABULATION: 0x09, + CARRIAGE_RETURN: 0x0D, + LINE_FEED: 0x0A, + FORM_FEED: 0x0C, + SPACE: 0x20, + EXCLAMATION_MARK: 0x21, + QUOTATION_MARK: 0x22, + NUMBER_SIGN: 0x23, + AMPERSAND: 0x26, + APOSTROPHE: 0x27, + HYPHEN_MINUS: 0x2D, + SOLIDUS: 0x2F, + DIGIT_0: 0x30, + DIGIT_9: 0x39, + SEMICOLON: 0x3B, + LESS_THAN_SIGN: 0x3C, + EQUALS_SIGN: 0x3D, + GREATER_THAN_SIGN: 0x3E, + QUESTION_MARK: 0x3F, + LATIN_CAPITAL_A: 0x41, + LATIN_CAPITAL_F: 0x46, + LATIN_CAPITAL_X: 0x58, + LATIN_CAPITAL_Z: 0x5A, + GRAVE_ACCENT: 0x60, + LATIN_SMALL_A: 0x61, + LATIN_SMALL_F: 0x66, + LATIN_SMALL_X: 0x78, + LATIN_SMALL_Z: 0x7A, + BOM: 0xFEFF, + REPLACEMENT_CHARACTER: 0xFFFD + }; + exports.CODE_POINT_SEQUENCES = { + DASH_DASH_STRING: [0x2D, 0x2D], + DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], + CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], + CDATA_END_STRING: [0x5D, 0x5D, 0x3E], + SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], + PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], + SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tokenization/named_entity_trie", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + module.exports = { + 0x41: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [193]}}, + c: [193] + }}}}}}}}}, + 0x62: {l: {0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [258]}}}}}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [194]}}, + c: [194] + }}}}}, + 0x79: {l: {0x3B: {c: [1040]}}} + }}, + 0x45: {l: {0x6C: {l: {0x69: {l: {0x67: { + l: {0x3B: {c: [198]}}, + c: [198] + }}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120068]}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [192]}}, + c: [192] + }}}}}}}}}, + 0x6C: {l: {0x70: {l: {0x68: {l: {0x61: {l: {0x3B: {c: [913]}}}}}}}}}, + 0x6D: {l: {0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [256]}}}}}}}}}, + 0x4D: {l: {0x50: { + l: {0x3B: {c: [38]}}, + c: [38] + }}}, + 0x6E: {l: {0x64: {l: {0x3B: {c: [10835]}}}}}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [260]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120120]}}}}} + }}, + 0x70: {l: {0x70: {l: {0x6C: {l: {0x79: {l: {0x46: {l: {0x75: {l: {0x6E: {l: {0x63: {l: {0x74: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8289]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x6E: {l: {0x67: { + l: {0x3B: {c: [197]}}, + c: [197] + }}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119964]}}}}}, + 0x73: {l: {0x69: {l: {0x67: {l: {0x6E: {l: {0x3B: {c: [8788]}}}}}}}}} + }}, + 0x74: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [195]}}, + c: [195] + }}}}}}}}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [196]}}, + c: [196] + }}}}} + }}, + 0x61: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [225]}}, + c: [225] + }}}}}}}}}, + 0x62: {l: {0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [259]}}}}}}}}}}}, + 0x63: {l: { + 0x3B: {c: [8766]}, + 0x64: {l: {0x3B: {c: [8767]}}}, + 0x45: {l: {0x3B: {c: [8766, 819]}}}, + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [226]}}, + c: [226] + }}}}}, + 0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [180]}}, + c: [180] + }}}}}, + 0x79: {l: {0x3B: {c: [1072]}}} + }}, + 0x65: {l: {0x6C: {l: {0x69: {l: {0x67: { + l: {0x3B: {c: [230]}}, + c: [230] + }}}}}}}, + 0x66: {l: { + 0x3B: {c: [8289]}, + 0x72: {l: {0x3B: {c: [120094]}}} + }}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [224]}}, + c: [224] + }}}}}}}}}, + 0x6C: {l: { + 0x65: {l: { + 0x66: {l: {0x73: {l: {0x79: {l: {0x6D: {l: {0x3B: {c: [8501]}}}}}}}}}, + 0x70: {l: {0x68: {l: {0x3B: {c: [8501]}}}}} + }}, + 0x70: {l: {0x68: {l: {0x61: {l: {0x3B: {c: [945]}}}}}}} + }}, + 0x6D: {l: { + 0x61: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [257]}}}}}, + 0x6C: {l: {0x67: {l: {0x3B: {c: [10815]}}}}} + }}, + 0x70: { + l: {0x3B: {c: [38]}}, + c: [38] + } + }}, + 0x6E: {l: { + 0x64: {l: { + 0x61: {l: {0x6E: {l: {0x64: {l: {0x3B: {c: [10837]}}}}}}}, + 0x3B: {c: [8743]}, + 0x64: {l: {0x3B: {c: [10844]}}}, + 0x73: {l: {0x6C: {l: {0x6F: {l: {0x70: {l: {0x65: {l: {0x3B: {c: [10840]}}}}}}}}}}}, + 0x76: {l: {0x3B: {c: [10842]}}} + }}, + 0x67: {l: { + 0x3B: {c: [8736]}, + 0x65: {l: {0x3B: {c: [10660]}}}, + 0x6C: {l: {0x65: {l: {0x3B: {c: [8736]}}}}}, + 0x6D: {l: {0x73: {l: {0x64: {l: { + 0x61: {l: { + 0x61: {l: {0x3B: {c: [10664]}}}, + 0x62: {l: {0x3B: {c: [10665]}}}, + 0x63: {l: {0x3B: {c: [10666]}}}, + 0x64: {l: {0x3B: {c: [10667]}}}, + 0x65: {l: {0x3B: {c: [10668]}}}, + 0x66: {l: {0x3B: {c: [10669]}}}, + 0x67: {l: {0x3B: {c: [10670]}}}, + 0x68: {l: {0x3B: {c: [10671]}}} + }}, + 0x3B: {c: [8737]} + }}}}}}, + 0x72: {l: {0x74: {l: { + 0x3B: {c: [8735]}, + 0x76: {l: {0x62: {l: { + 0x3B: {c: [8894]}, + 0x64: {l: {0x3B: {c: [10653]}}} + }}}} + }}}}, + 0x73: {l: { + 0x70: {l: {0x68: {l: {0x3B: {c: [8738]}}}}}, + 0x74: {l: {0x3B: {c: [197]}}} + }}, + 0x7A: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [9084]}}}}}}}}} + }} + }}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [261]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120146]}}}}} + }}, + 0x70: {l: { + 0x61: {l: {0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10863]}}}}}}}}}, + 0x3B: {c: [8776]}, + 0x45: {l: {0x3B: {c: [10864]}}}, + 0x65: {l: {0x3B: {c: [8778]}}}, + 0x69: {l: {0x64: {l: {0x3B: {c: [8779]}}}}}, + 0x6F: {l: {0x73: {l: {0x3B: {c: [39]}}}}}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: { + 0x3B: {c: [8776]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8778]}}}}} + }}}}}}}} + }}, + 0x72: {l: {0x69: {l: {0x6E: {l: {0x67: { + l: {0x3B: {c: [229]}}, + c: [229] + }}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119990]}}}}}, + 0x74: {l: {0x3B: {c: [42]}}}, + 0x79: {l: {0x6D: {l: {0x70: {l: { + 0x3B: {c: [8776]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8781]}}}}} + }}}}}} + }}, + 0x74: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [227]}}, + c: [227] + }}}}}}}}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [228]}}, + c: [228] + }}}}}, + 0x77: {l: { + 0x63: {l: {0x6F: {l: {0x6E: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8755]}}}}}}}}}}}}}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10769]}}}}}}} + }} + }}, + 0x62: {l: { + 0x61: {l: { + 0x63: {l: {0x6B: {l: { + 0x63: {l: {0x6F: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [8780]}}}}}}}}}, + 0x65: {l: {0x70: {l: {0x73: {l: {0x69: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [1014]}}}}}}}}}}}}}}}, + 0x70: {l: {0x72: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [8245]}}}}}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: { + 0x3B: {c: [8765]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8909]}}}}} + }}}}}} + }}}}, + 0x72: {l: { + 0x76: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8893]}}}}}}}, + 0x77: {l: {0x65: {l: {0x64: {l: { + 0x3B: {c: [8965]}, + 0x67: {l: {0x65: {l: {0x3B: {c: [8965]}}}}} + }}}}}} + }} + }}, + 0x62: {l: {0x72: {l: {0x6B: {l: { + 0x3B: {c: [9141]}, + 0x74: {l: {0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [9142]}}}}}}}}} + }}}}}}, + 0x63: {l: { + 0x6F: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [8780]}}}}}}}, + 0x79: {l: {0x3B: {c: [1073]}}} + }}, + 0x64: {l: {0x71: {l: {0x75: {l: {0x6F: {l: {0x3B: {c: [8222]}}}}}}}}}, + 0x65: {l: { + 0x63: {l: {0x61: {l: {0x75: {l: {0x73: {l: { + 0x3B: {c: [8757]}, + 0x65: {l: {0x3B: {c: [8757]}}} + }}}}}}}}, + 0x6D: {l: {0x70: {l: {0x74: {l: {0x79: {l: {0x76: {l: {0x3B: {c: [10672]}}}}}}}}}}}, + 0x70: {l: {0x73: {l: {0x69: {l: {0x3B: {c: [1014]}}}}}}}, + 0x72: {l: {0x6E: {l: {0x6F: {l: {0x75: {l: {0x3B: {c: [8492]}}}}}}}}}, + 0x74: {l: { + 0x61: {l: {0x3B: {c: [946]}}}, + 0x68: {l: {0x3B: {c: [8502]}}}, + 0x77: {l: {0x65: {l: {0x65: {l: {0x6E: {l: {0x3B: {c: [8812]}}}}}}}}} + }} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120095]}}}}}, + 0x69: {l: {0x67: {l: { + 0x63: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [8898]}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [9711]}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [8899]}}}}} + }}, + 0x6F: {l: { + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10752]}}}}}}}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10753]}}}}}}}}}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [10754]}}}}}}}}}}} + }}, + 0x73: {l: { + 0x71: {l: {0x63: {l: {0x75: {l: {0x70: {l: {0x3B: {c: [10758]}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [9733]}}}}}}} + }}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [9661]}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [9651]}}}}} + }}}}}}}}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10756]}}}}}}}}}}}, + 0x76: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8897]}}}}}}}, + 0x77: {l: {0x65: {l: {0x64: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [8896]}}}}}}}}}}} + }}}}, + 0x6B: {l: {0x61: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10509]}}}}}}}}}}}, + 0x6C: {l: { + 0x61: {l: { + 0x63: {l: {0x6B: {l: { + 0x6C: {l: {0x6F: {l: {0x7A: {l: {0x65: {l: {0x6E: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [10731]}}}}}}}}}}}}}}}, + 0x73: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [9642]}}}}}}}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x3B: {c: [9652]}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [9662]}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [9666]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [9656]}}}}}}}}}}} + }}}}}}}}}}}}}}}} + }}}}, + 0x6E: {l: {0x6B: {l: {0x3B: {c: [9251]}}}}} + }}, + 0x6B: {l: { + 0x31: {l: { + 0x32: {l: {0x3B: {c: [9618]}}}, + 0x34: {l: {0x3B: {c: [9617]}}} + }}, + 0x33: {l: {0x34: {l: {0x3B: {c: [9619]}}}}} + }}, + 0x6F: {l: {0x63: {l: {0x6B: {l: {0x3B: {c: [9608]}}}}}}} + }}, + 0x6E: {l: { + 0x65: {l: { + 0x3B: {c: [61, 8421]}, + 0x71: {l: {0x75: {l: {0x69: {l: {0x76: {l: {0x3B: {c: [8801, 8421]}}}}}}}}} + }}, + 0x6F: {l: {0x74: {l: {0x3B: {c: [8976]}}}}} + }}, + 0x4E: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10989]}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [120147]}}}}}, + 0x74: {l: { + 0x3B: {c: [8869]}, + 0x74: {l: {0x6F: {l: {0x6D: {l: {0x3B: {c: [8869]}}}}}}} + }}, + 0x77: {l: {0x74: {l: {0x69: {l: {0x65: {l: {0x3B: {c: [8904]}}}}}}}}}, + 0x78: {l: { + 0x62: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10697]}}}}}}}, + 0x64: {l: { + 0x6C: {l: {0x3B: {c: [9488]}}}, + 0x4C: {l: {0x3B: {c: [9557]}}}, + 0x72: {l: {0x3B: {c: [9484]}}}, + 0x52: {l: {0x3B: {c: [9554]}}} + }}, + 0x44: {l: { + 0x6C: {l: {0x3B: {c: [9558]}}}, + 0x4C: {l: {0x3B: {c: [9559]}}}, + 0x72: {l: {0x3B: {c: [9555]}}}, + 0x52: {l: {0x3B: {c: [9556]}}} + }}, + 0x68: {l: { + 0x3B: {c: [9472]}, + 0x64: {l: {0x3B: {c: [9516]}}}, + 0x44: {l: {0x3B: {c: [9573]}}}, + 0x75: {l: {0x3B: {c: [9524]}}}, + 0x55: {l: {0x3B: {c: [9576]}}} + }}, + 0x48: {l: { + 0x3B: {c: [9552]}, + 0x64: {l: {0x3B: {c: [9572]}}}, + 0x44: {l: {0x3B: {c: [9574]}}}, + 0x75: {l: {0x3B: {c: [9575]}}}, + 0x55: {l: {0x3B: {c: [9577]}}} + }}, + 0x6D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8863]}}}}}}}}}}}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8862]}}}}}}}}}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8864]}}}}}}}}}}}, + 0x75: {l: { + 0x6C: {l: {0x3B: {c: [9496]}}}, + 0x4C: {l: {0x3B: {c: [9563]}}}, + 0x72: {l: {0x3B: {c: [9492]}}}, + 0x52: {l: {0x3B: {c: [9560]}}} + }}, + 0x55: {l: { + 0x6C: {l: {0x3B: {c: [9564]}}}, + 0x4C: {l: {0x3B: {c: [9565]}}}, + 0x72: {l: {0x3B: {c: [9561]}}}, + 0x52: {l: {0x3B: {c: [9562]}}} + }}, + 0x76: {l: { + 0x3B: {c: [9474]}, + 0x68: {l: {0x3B: {c: [9532]}}}, + 0x48: {l: {0x3B: {c: [9578]}}}, + 0x6C: {l: {0x3B: {c: [9508]}}}, + 0x4C: {l: {0x3B: {c: [9569]}}}, + 0x72: {l: {0x3B: {c: [9500]}}}, + 0x52: {l: {0x3B: {c: [9566]}}} + }}, + 0x56: {l: { + 0x3B: {c: [9553]}, + 0x68: {l: {0x3B: {c: [9579]}}}, + 0x48: {l: {0x3B: {c: [9580]}}}, + 0x6C: {l: {0x3B: {c: [9570]}}}, + 0x4C: {l: {0x3B: {c: [9571]}}}, + 0x72: {l: {0x3B: {c: [9567]}}}, + 0x52: {l: {0x3B: {c: [9568]}}} + }} + }} + }}, + 0x70: {l: {0x72: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [8245]}}}}}}}}}}}, + 0x72: {l: { + 0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [728]}}}}}}}, + 0x76: {l: {0x62: {l: {0x61: {l: {0x72: { + l: {0x3B: {c: [166]}}, + c: [166] + }}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119991]}}}}}, + 0x65: {l: {0x6D: {l: {0x69: {l: {0x3B: {c: [8271]}}}}}}}, + 0x69: {l: {0x6D: {l: { + 0x3B: {c: [8765]}, + 0x65: {l: {0x3B: {c: [8909]}}} + }}}}, + 0x6F: {l: {0x6C: {l: { + 0x62: {l: {0x3B: {c: [10693]}}}, + 0x3B: {c: [92]}, + 0x68: {l: {0x73: {l: {0x75: {l: {0x62: {l: {0x3B: {c: [10184]}}}}}}}}} + }}}} + }}, + 0x75: {l: { + 0x6C: {l: {0x6C: {l: { + 0x3B: {c: [8226]}, + 0x65: {l: {0x74: {l: {0x3B: {c: [8226]}}}}} + }}}}, + 0x6D: {l: {0x70: {l: { + 0x3B: {c: [8782]}, + 0x45: {l: {0x3B: {c: [10926]}}}, + 0x65: {l: { + 0x3B: {c: [8783]}, + 0x71: {l: {0x3B: {c: [8783]}}} + }} + }}}} + }} + }}, + 0x42: {l: { + 0x61: {l: { + 0x63: {l: {0x6B: {l: {0x73: {l: {0x6C: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8726]}}}}}}}}}}}}}}}, + 0x72: {l: { + 0x76: {l: {0x3B: {c: [10983]}}}, + 0x77: {l: {0x65: {l: {0x64: {l: {0x3B: {c: [8966]}}}}}}} + }} + }}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1041]}}}}}, + 0x65: {l: { + 0x63: {l: {0x61: {l: {0x75: {l: {0x73: {l: {0x65: {l: {0x3B: {c: [8757]}}}}}}}}}}}, + 0x72: {l: {0x6E: {l: {0x6F: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x69: {l: {0x73: {l: {0x3B: {c: [8492]}}}}}}}}}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [914]}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120069]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120121]}}}}}}}, + 0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [728]}}}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [8492]}}}}}}}, + 0x75: {l: {0x6D: {l: {0x70: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [8782]}}}}}}}}}}} + }}, + 0x43: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [262]}}}}}}}}}, + 0x70: {l: { + 0x3B: {c: [8914]}, + 0x69: {l: {0x74: {l: {0x61: {l: {0x6C: {l: {0x44: {l: {0x69: {l: {0x66: {l: {0x66: {l: {0x65: {l: {0x72: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x61: {l: {0x6C: {l: {0x44: {l: {0x3B: {c: [8517]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x79: {l: {0x6C: {l: {0x65: {l: {0x79: {l: {0x73: {l: {0x3B: {c: [8493]}}}}}}}}}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [268]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: { + l: {0x3B: {c: [199]}}, + c: [199] + }}}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [264]}}}}}}}, + 0x6F: {l: {0x6E: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8752]}}}}}}}}}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [266]}}}}}}}, + 0x65: {l: { + 0x64: {l: {0x69: {l: {0x6C: {l: {0x6C: {l: {0x61: {l: {0x3B: {c: [184]}}}}}}}}}}}, + 0x6E: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [183]}}}}}}}}}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [8493]}}}}}, + 0x48: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1063]}}}}}}}, + 0x68: {l: {0x69: {l: {0x3B: {c: [935]}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x6C: {l: {0x65: {l: { + 0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8857]}}}}}}}, + 0x4D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8854]}}}}}}}}}}}, + 0x50: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8853]}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8855]}}}}}}}}}}} + }}}}}}}}}}, + 0x6C: {l: {0x6F: {l: { + 0x63: {l: {0x6B: {l: {0x77: {l: {0x69: {l: {0x73: {l: {0x65: {l: {0x43: {l: {0x6F: {l: {0x6E: {l: {0x74: {l: {0x6F: {l: {0x75: {l: {0x72: {l: {0x49: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8754]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x73: {l: {0x65: {l: {0x43: {l: {0x75: {l: {0x72: {l: {0x6C: {l: {0x79: {l: { + 0x44: {l: {0x6F: {l: {0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x51: {l: {0x75: {l: {0x6F: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [8221]}}}}}}}}}}}}}}}}}}}}}}}, + 0x51: {l: {0x75: {l: {0x6F: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [8217]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}}}, + 0x6F: {l: { + 0x6C: {l: {0x6F: {l: {0x6E: {l: { + 0x3B: {c: [8759]}, + 0x65: {l: {0x3B: {c: [10868]}}} + }}}}}}, + 0x6E: {l: { + 0x67: {l: {0x72: {l: {0x75: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8801]}}}}}}}}}}}}}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8751]}}}}}}}, + 0x74: {l: {0x6F: {l: {0x75: {l: {0x72: {l: {0x49: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8750]}}}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x70: {l: { + 0x66: {l: {0x3B: {c: [8450]}}}, + 0x72: {l: {0x6F: {l: {0x64: {l: {0x75: {l: {0x63: {l: {0x74: {l: {0x3B: {c: [8720]}}}}}}}}}}}}} + }}, + 0x75: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x43: {l: {0x6C: {l: {0x6F: {l: {0x63: {l: {0x6B: {l: {0x77: {l: {0x69: {l: {0x73: {l: {0x65: {l: {0x43: {l: {0x6F: {l: {0x6E: {l: {0x74: {l: {0x6F: {l: {0x75: {l: {0x72: {l: {0x49: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8755]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x4F: {l: {0x50: {l: {0x59: { + l: {0x3B: {c: [169]}}, + c: [169] + }}}}}, + 0x72: {l: {0x6F: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10799]}}}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119966]}}}}}}}, + 0x75: {l: {0x70: {l: { + 0x43: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [8781]}}}}}}}, + 0x3B: {c: [8915]} + }}}} + }}, + 0x63: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [263]}}}}}}}}}, + 0x70: {l: { + 0x61: {l: {0x6E: {l: {0x64: {l: {0x3B: {c: [10820]}}}}}}}, + 0x62: {l: {0x72: {l: {0x63: {l: {0x75: {l: {0x70: {l: {0x3B: {c: [10825]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10827]}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [10823]}}}}} + }}, + 0x3B: {c: [8745]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10816]}}}}}}}, + 0x73: {l: {0x3B: {c: [8745, 65024]}}} + }}, + 0x72: {l: { + 0x65: {l: {0x74: {l: {0x3B: {c: [8257]}}}}}, + 0x6F: {l: {0x6E: {l: {0x3B: {c: [711]}}}}} + }} + }}, + 0x63: {l: { + 0x61: {l: { + 0x70: {l: {0x73: {l: {0x3B: {c: [10829]}}}}}, + 0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [269]}}}}}}} + }}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: { + l: {0x3B: {c: [231]}}, + c: [231] + }}}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [265]}}}}}}}, + 0x75: {l: {0x70: {l: {0x73: {l: { + 0x3B: {c: [10828]}, + 0x73: {l: {0x6D: {l: {0x3B: {c: [10832]}}}}} + }}}}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [267]}}}}}}}, + 0x65: {l: { + 0x64: {l: {0x69: {l: {0x6C: { + l: {0x3B: {c: [184]}}, + c: [184] + }}}}}, + 0x6D: {l: {0x70: {l: {0x74: {l: {0x79: {l: {0x76: {l: {0x3B: {c: [10674]}}}}}}}}}}}, + 0x6E: {l: {0x74: { + l: { + 0x3B: {c: [162]}, + 0x65: {l: {0x72: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [183]}}}}}}}}}}} + }, + c: [162] + }}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120096]}}}}}, + 0x68: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1095]}}}}}, + 0x65: {l: {0x63: {l: {0x6B: {l: { + 0x3B: {c: [10003]}, + 0x6D: {l: {0x61: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10003]}}}}}}}}} + }}}}}}, + 0x69: {l: {0x3B: {c: [967]}}} + }}, + 0x69: {l: {0x72: {l: { + 0x63: {l: { + 0x3B: {c: [710]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8791]}}}}}, + 0x6C: {l: {0x65: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8634]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8635]}}}}}}}}}}} + }}}}}}}}}}, + 0x64: {l: { + 0x61: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [8859]}}}}}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [8858]}}}}}}}}}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8861]}}}}}}}}}, + 0x52: {l: {0x3B: {c: [174]}}}, + 0x53: {l: {0x3B: {c: [9416]}}} + }} + }}}} + }}, + 0x3B: {c: [9675]}, + 0x45: {l: {0x3B: {c: [10691]}}}, + 0x65: {l: {0x3B: {c: [8791]}}}, + 0x66: {l: {0x6E: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10768]}}}}}}}}}}}, + 0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [10991]}}}}}}}, + 0x73: {l: {0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10690]}}}}}}}}} + }}}}, + 0x6C: {l: {0x75: {l: {0x62: {l: {0x73: {l: { + 0x3B: {c: [9827]}, + 0x75: {l: {0x69: {l: {0x74: {l: {0x3B: {c: [9827]}}}}}}} + }}}}}}}}, + 0x6F: {l: { + 0x6C: {l: {0x6F: {l: {0x6E: {l: { + 0x3B: {c: [58]}, + 0x65: {l: { + 0x3B: {c: [8788]}, + 0x71: {l: {0x3B: {c: [8788]}}} + }} + }}}}}}, + 0x6D: {l: { + 0x6D: {l: {0x61: {l: { + 0x3B: {c: [44]}, + 0x74: {l: {0x3B: {c: [64]}}} + }}}}, + 0x70: {l: { + 0x3B: {c: [8705]}, + 0x66: {l: {0x6E: {l: {0x3B: {c: [8728]}}}}}, + 0x6C: {l: {0x65: {l: { + 0x6D: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8705]}}}}}}}}}, + 0x78: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8450]}}}}}}} + }}}} + }} + }}, + 0x6E: {l: { + 0x67: {l: { + 0x3B: {c: [8773]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10861]}}}}}}} + }}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8750]}}}}}}} + }}, + 0x70: {l: { + 0x66: {l: {0x3B: {c: [120148]}}}, + 0x72: {l: {0x6F: {l: {0x64: {l: {0x3B: {c: [8720]}}}}}}}, + 0x79: { + l: { + 0x3B: {c: [169]}, + 0x73: {l: {0x72: {l: {0x3B: {c: [8471]}}}}} + }, + c: [169] + } + }} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8629]}}}}}}}, + 0x6F: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10007]}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119992]}}}}}, + 0x75: {l: { + 0x62: {l: { + 0x3B: {c: [10959]}, + 0x65: {l: {0x3B: {c: [10961]}}} + }}, + 0x70: {l: { + 0x3B: {c: [10960]}, + 0x65: {l: {0x3B: {c: [10962]}}} + }} + }} + }}, + 0x74: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8943]}}}}}}}}}, + 0x75: {l: { + 0x64: {l: {0x61: {l: {0x72: {l: {0x72: {l: { + 0x6C: {l: {0x3B: {c: [10552]}}}, + 0x72: {l: {0x3B: {c: [10549]}}} + }}}}}}}}, + 0x65: {l: { + 0x70: {l: {0x72: {l: {0x3B: {c: [8926]}}}}}, + 0x73: {l: {0x63: {l: {0x3B: {c: [8927]}}}}} + }}, + 0x6C: {l: {0x61: {l: {0x72: {l: {0x72: {l: { + 0x3B: {c: [8630]}, + 0x70: {l: {0x3B: {c: [10557]}}} + }}}}}}}}, + 0x70: {l: { + 0x62: {l: {0x72: {l: {0x63: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [10824]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10822]}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [10826]}}}}} + }}, + 0x3B: {c: [8746]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8845]}}}}}}}, + 0x6F: {l: {0x72: {l: {0x3B: {c: [10821]}}}}}, + 0x73: {l: {0x3B: {c: [8746, 65024]}}} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: { + 0x3B: {c: [8631]}, + 0x6D: {l: {0x3B: {c: [10556]}}} + }}}}}}, + 0x6C: {l: {0x79: {l: { + 0x65: {l: {0x71: {l: { + 0x70: {l: {0x72: {l: {0x65: {l: {0x63: {l: {0x3B: {c: [8926]}}}}}}}}}, + 0x73: {l: {0x75: {l: {0x63: {l: {0x63: {l: {0x3B: {c: [8927]}}}}}}}}} + }}}}, + 0x76: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8910]}}}}}}}, + 0x77: {l: {0x65: {l: {0x64: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [8911]}}}}}}}}}}} + }}}}, + 0x72: {l: {0x65: {l: {0x6E: { + l: {0x3B: {c: [164]}}, + c: [164] + }}}}}, + 0x76: {l: {0x65: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8630]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8631]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}, + 0x76: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8910]}}}}}}}, + 0x77: {l: {0x65: {l: {0x64: {l: {0x3B: {c: [8911]}}}}}}} + }}, + 0x77: {l: { + 0x63: {l: {0x6F: {l: {0x6E: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8754]}}}}}}}}}}}}}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8753]}}}}}}} + }}, + 0x79: {l: {0x6C: {l: {0x63: {l: {0x74: {l: {0x79: {l: {0x3B: {c: [9005]}}}}}}}}}}} + }}, + 0x64: {l: { + 0x61: {l: { + 0x67: {l: {0x67: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8224]}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x74: {l: {0x68: {l: {0x3B: {c: [8504]}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8595]}}}}}, + 0x73: {l: {0x68: {l: { + 0x3B: {c: [8208]}, + 0x76: {l: {0x3B: {c: [8867]}}} + }}}} + }}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8659]}}}}}}}, + 0x62: {l: { + 0x6B: {l: {0x61: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10511]}}}}}}}}}}}, + 0x6C: {l: {0x61: {l: {0x63: {l: {0x3B: {c: [733]}}}}}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [271]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1076]}}} + }}, + 0x64: {l: { + 0x61: {l: { + 0x67: {l: {0x67: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8225]}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8650]}}}}} + }}, + 0x3B: {c: [8518]}, + 0x6F: {l: {0x74: {l: {0x73: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [10871]}}}}}}}}}}} + }}, + 0x65: {l: { + 0x67: { + l: {0x3B: {c: [176]}}, + c: [176] + }, + 0x6C: {l: {0x74: {l: {0x61: {l: {0x3B: {c: [948]}}}}}}}, + 0x6D: {l: {0x70: {l: {0x74: {l: {0x79: {l: {0x76: {l: {0x3B: {c: [10673]}}}}}}}}}}} + }}, + 0x66: {l: { + 0x69: {l: {0x73: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [10623]}}}}}}}}}, + 0x72: {l: {0x3B: {c: [120097]}}} + }}, + 0x48: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10597]}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: { + 0x6C: {l: {0x3B: {c: [8643]}}}, + 0x72: {l: {0x3B: {c: [8642]}}} + }}}}}}, + 0x69: {l: { + 0x61: {l: {0x6D: {l: { + 0x3B: {c: [8900]}, + 0x6F: {l: {0x6E: {l: {0x64: {l: { + 0x3B: {c: [8900]}, + 0x73: {l: {0x75: {l: {0x69: {l: {0x74: {l: {0x3B: {c: [9830]}}}}}}}}} + }}}}}}, + 0x73: {l: {0x3B: {c: [9830]}}} + }}}}, + 0x65: {l: {0x3B: {c: [168]}}}, + 0x67: {l: {0x61: {l: {0x6D: {l: {0x6D: {l: {0x61: {l: {0x3B: {c: [989]}}}}}}}}}}}, + 0x73: {l: {0x69: {l: {0x6E: {l: {0x3B: {c: [8946]}}}}}}}, + 0x76: {l: { + 0x3B: {c: [247]}, + 0x69: {l: {0x64: {l: {0x65: { + l: { + 0x3B: {c: [247]}, + 0x6F: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8903]}}}}}}}}}}}}}}} + }, + c: [247] + }}}}}, + 0x6F: {l: {0x6E: {l: {0x78: {l: {0x3B: {c: [8903]}}}}}}} + }} + }}, + 0x6A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1106]}}}}}}}, + 0x6C: {l: {0x63: {l: { + 0x6F: {l: {0x72: {l: {0x6E: {l: {0x3B: {c: [8990]}}}}}}}, + 0x72: {l: {0x6F: {l: {0x70: {l: {0x3B: {c: [8973]}}}}}}} + }}}}, + 0x6F: {l: { + 0x6C: {l: {0x6C: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [36]}}}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120149]}}}}}, + 0x74: {l: { + 0x3B: {c: [729]}, + 0x65: {l: {0x71: {l: { + 0x3B: {c: [8784]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8785]}}}}}}} + }}}}, + 0x6D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8760]}}}}}}}}}}}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8724]}}}}}}}}}, + 0x73: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [8865]}}}}}}}}}}}}} + }}, + 0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x62: {l: {0x61: {l: {0x72: {l: {0x77: {l: {0x65: {l: {0x64: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [8966]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x77: {l: {0x6E: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8595]}}}}}}}}}}}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x73: {l: {0x3B: {c: [8650]}}}}}}}}}}}}}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8643]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8642]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}}} + }}, + 0x72: {l: { + 0x62: {l: {0x6B: {l: {0x61: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10512]}}}}}}}}}}}}}, + 0x63: {l: { + 0x6F: {l: {0x72: {l: {0x6E: {l: {0x3B: {c: [8991]}}}}}}}, + 0x72: {l: {0x6F: {l: {0x70: {l: {0x3B: {c: [8972]}}}}}}} + }} + }}, + 0x73: {l: { + 0x63: {l: { + 0x72: {l: {0x3B: {c: [119993]}}}, + 0x79: {l: {0x3B: {c: [1109]}}} + }}, + 0x6F: {l: {0x6C: {l: {0x3B: {c: [10742]}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [273]}}}}}}}}} + }}, + 0x74: {l: { + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8945]}}}}}}}, + 0x72: {l: {0x69: {l: { + 0x3B: {c: [9663]}, + 0x66: {l: {0x3B: {c: [9662]}}} + }}}} + }}, + 0x75: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8693]}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10607]}}}}}}} + }}, + 0x77: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [10662]}}}}}}}}}}}}}, + 0x7A: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1119]}}}}}, + 0x69: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10239]}}}}}}}}}}}}} + }} + }}, + 0x44: {l: { + 0x61: {l: { + 0x67: {l: {0x67: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8225]}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8609]}}}}}, + 0x73: {l: {0x68: {l: {0x76: {l: {0x3B: {c: [10980]}}}}}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [270]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1044]}}} + }}, + 0x44: {l: { + 0x3B: {c: [8517]}, + 0x6F: {l: {0x74: {l: {0x72: {l: {0x61: {l: {0x68: {l: {0x64: {l: {0x3B: {c: [10513]}}}}}}}}}}}}} + }}, + 0x65: {l: {0x6C: {l: { + 0x3B: {c: [8711]}, + 0x74: {l: {0x61: {l: {0x3B: {c: [916]}}}}} + }}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120071]}}}}}, + 0x69: {l: { + 0x61: {l: { + 0x63: {l: {0x72: {l: {0x69: {l: {0x74: {l: {0x69: {l: {0x63: {l: {0x61: {l: {0x6C: {l: { + 0x41: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [180]}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: { + 0x74: {l: {0x3B: {c: [729]}}}, + 0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x41: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [733]}}}}}}}}}}}}}}}}}}} + }}}}, + 0x47: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [96]}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [732]}}}}}}}}}}} + }}}}}}}}}}}}}}}}, + 0x6D: {l: {0x6F: {l: {0x6E: {l: {0x64: {l: {0x3B: {c: [8900]}}}}}}}}} + }}, + 0x66: {l: {0x66: {l: {0x65: {l: {0x72: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x61: {l: {0x6C: {l: {0x44: {l: {0x3B: {c: [8518]}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x4A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1026]}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [120123]}}}}}, + 0x74: {l: { + 0x3B: {c: [168]}, + 0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8412]}}}}}}}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8784]}}}}}}}}}}} + }}, + 0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: { + 0x43: {l: {0x6F: {l: {0x6E: {l: {0x74: {l: {0x6F: {l: {0x75: {l: {0x72: {l: {0x49: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8751]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: { + 0x74: {l: {0x3B: {c: [168]}}}, + 0x77: {l: {0x6E: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8659]}}}}}}}}}}}}}}} + }}}}, + 0x4C: {l: { + 0x65: {l: {0x66: {l: {0x74: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8656]}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8660]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [10980]}}}}}}} + }}}}}}, + 0x6F: {l: {0x6E: {l: {0x67: {l: { + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10232]}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10234]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10233]}}}}}}}}}}}}}}}}}}}}} + }}}}}} + }}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8658]}}}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8872]}}}}}}} + }}}}}}}}}}, + 0x55: {l: {0x70: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8657]}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8661]}}}}}}}}}}}}}}}}}}} + }}}}, + 0x56: {l: {0x65: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x63: {l: {0x61: {l: {0x6C: {l: {0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8741]}}}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x77: {l: {0x6E: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10515]}}}}}}}, + 0x3B: {c: [8595]}, + 0x55: {l: {0x70: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8693]}}}}}}}}}}}}}}} + }}}}}}}}}}, + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8659]}}}}}}}}}}}, + 0x42: {l: {0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [785]}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10576]}}}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10590]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10582]}}}}}}}, + 0x3B: {c: [8637]} + }}}}}}}}}}}} + }}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10591]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10583]}}}}}}}, + 0x3B: {c: [8641]} + }}}}}}}}}}}} + }}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8615]}}}}}}}}}}}, + 0x3B: {c: [8868]} + }}}}}} + }}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119967]}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [272]}}}}}}}}} + }}, + 0x53: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1029]}}}}}}}, + 0x5A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1039]}}}}}}} + }}, + 0x45: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [201]}}, + c: [201] + }}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [282]}}}}}}}}}, + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [202]}}, + c: [202] + }}}}}, + 0x79: {l: {0x3B: {c: [1069]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [278]}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120072]}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [200]}}, + c: [200] + }}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x6D: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8712]}}}}}}}}}}}}}, + 0x6D: {l: { + 0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [274]}}}}}}}, + 0x70: {l: {0x74: {l: {0x79: {l: { + 0x53: {l: {0x6D: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x53: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [9723]}}}}}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x72: {l: {0x79: {l: {0x53: {l: {0x6D: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x53: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [9643]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}}}}} + }}, + 0x4E: {l: {0x47: {l: {0x3B: {c: [330]}}}}}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [280]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120124]}}}}} + }}, + 0x70: {l: {0x73: {l: {0x69: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [917]}}}}}}}}}}}}}, + 0x71: {l: {0x75: {l: { + 0x61: {l: {0x6C: {l: { + 0x3B: {c: [10869]}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8770]}}}}}}}}}}} + }}}}, + 0x69: {l: {0x6C: {l: {0x69: {l: {0x62: {l: {0x72: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x3B: {c: [8652]}}}}}}}}}}}}}}}}} + }}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8496]}}}}}, + 0x69: {l: {0x6D: {l: {0x3B: {c: [10867]}}}}} + }}, + 0x74: {l: {0x61: {l: {0x3B: {c: [919]}}}}}, + 0x54: {l: {0x48: { + l: {0x3B: {c: [208]}}, + c: [208] + }}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [203]}}, + c: [203] + }}}}}, + 0x78: {l: { + 0x69: {l: {0x73: {l: {0x74: {l: {0x73: {l: {0x3B: {c: [8707]}}}}}}}}}, + 0x70: {l: {0x6F: {l: {0x6E: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x61: {l: {0x6C: {l: {0x45: {l: {0x3B: {c: [8519]}}}}}}}}}}}}}}}}}}}}} + }} + }}, + 0x65: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [233]}}, + c: [233] + }}}}}}}, + 0x73: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [10862]}}}}}}}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [283]}}}}}}}}}, + 0x69: {l: {0x72: {l: { + 0x63: { + l: {0x3B: {c: [234]}}, + c: [234] + }, + 0x3B: {c: [8790]} + }}}}, + 0x6F: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8789]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1101]}}} + }}, + 0x44: {l: { + 0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10871]}}}}}}}, + 0x6F: {l: {0x74: {l: {0x3B: {c: [8785]}}}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [279]}}}}}}}, + 0x65: {l: {0x3B: {c: [8519]}}}, + 0x66: {l: { + 0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8786]}}}}}}}, + 0x72: {l: {0x3B: {c: [120098]}}} + }}, + 0x67: {l: { + 0x3B: {c: [10906]}, + 0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [232]}}, + c: [232] + }}}}}}}, + 0x73: {l: { + 0x3B: {c: [10902]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10904]}}}}}}} + }} + }}, + 0x6C: {l: { + 0x3B: {c: [10905]}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x3B: {c: [9191]}}}}}}}}}}}}}, + 0x6C: {l: {0x3B: {c: [8467]}}}, + 0x73: {l: { + 0x3B: {c: [10901]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10903]}}}}}}} + }} + }}, + 0x6D: {l: { + 0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [275]}}}}}}}, + 0x70: {l: {0x74: {l: {0x79: {l: { + 0x3B: {c: [8709]}, + 0x73: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [8709]}}}}}}}, + 0x76: {l: {0x3B: {c: [8709]}}} + }}}}}}, + 0x73: {l: {0x70: {l: { + 0x31: {l: { + 0x33: {l: {0x3B: {c: [8196]}}}, + 0x34: {l: {0x3B: {c: [8197]}}} + }}, + 0x3B: {c: [8195]} + }}}} + }}, + 0x6E: {l: { + 0x67: {l: {0x3B: {c: [331]}}}, + 0x73: {l: {0x70: {l: {0x3B: {c: [8194]}}}}} + }}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [281]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120150]}}}}} + }}, + 0x70: {l: { + 0x61: {l: {0x72: {l: { + 0x3B: {c: [8917]}, + 0x73: {l: {0x6C: {l: {0x3B: {c: [10723]}}}}} + }}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10865]}}}}}}}, + 0x73: {l: {0x69: {l: { + 0x3B: {c: [949]}, + 0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [949]}}}}}}}, + 0x76: {l: {0x3B: {c: [1013]}}} + }}}} + }}, + 0x71: {l: { + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [8790]}}}}}}}, + 0x6F: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8789]}}}}}}}}} + }}, + 0x73: {l: { + 0x69: {l: {0x6D: {l: {0x3B: {c: [8770]}}}}}, + 0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: { + 0x67: {l: {0x74: {l: {0x72: {l: {0x3B: {c: [10902]}}}}}}}, + 0x6C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10901]}}}}}}}}} + }}}}}}}} + }}, + 0x75: {l: { + 0x61: {l: {0x6C: {l: {0x73: {l: {0x3B: {c: [61]}}}}}}}, + 0x65: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [8799]}}}}}}}, + 0x69: {l: {0x76: {l: { + 0x3B: {c: [8801]}, + 0x44: {l: {0x44: {l: {0x3B: {c: [10872]}}}}} + }}}} + }}, + 0x76: {l: {0x70: {l: {0x61: {l: {0x72: {l: {0x73: {l: {0x6C: {l: {0x3B: {c: [10725]}}}}}}}}}}}}} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10609]}}}}}}}, + 0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8787]}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8495]}}}}}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8784]}}}}}}}, + 0x69: {l: {0x6D: {l: {0x3B: {c: [8770]}}}}} + }}, + 0x74: {l: { + 0x61: {l: {0x3B: {c: [951]}}}, + 0x68: { + l: {0x3B: {c: [240]}}, + c: [240] + } + }}, + 0x75: {l: { + 0x6D: {l: {0x6C: { + l: {0x3B: {c: [235]}}, + c: [235] + }}}, + 0x72: {l: {0x6F: {l: {0x3B: {c: [8364]}}}}} + }}, + 0x78: {l: { + 0x63: {l: {0x6C: {l: {0x3B: {c: [33]}}}}}, + 0x69: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [8707]}}}}}}}, + 0x70: {l: { + 0x65: {l: {0x63: {l: {0x74: {l: {0x61: {l: {0x74: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8496]}}}}}}}}}}}}}}}}}, + 0x6F: {l: {0x6E: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x61: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [8519]}}}}}}}}}}}}}}}}}}} + }} + }} + }}, + 0x66: {l: { + 0x61: {l: {0x6C: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x73: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [8786]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1092]}}}}}, + 0x65: {l: {0x6D: {l: {0x61: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [9792]}}}}}}}}}}}, + 0x66: {l: { + 0x69: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [64259]}}}}}}}}}, + 0x6C: {l: { + 0x69: {l: {0x67: {l: {0x3B: {c: [64256]}}}}}, + 0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [64260]}}}}}}} + }}, + 0x72: {l: {0x3B: {c: [120099]}}} + }}, + 0x69: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [64257]}}}}}}}}}, + 0x6A: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [102, 106]}}}}}}}}}, + 0x6C: {l: { + 0x61: {l: {0x74: {l: {0x3B: {c: [9837]}}}}}, + 0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [64258]}}}}}}}, + 0x74: {l: {0x6E: {l: {0x73: {l: {0x3B: {c: [9649]}}}}}}} + }}, + 0x6E: {l: {0x6F: {l: {0x66: {l: {0x3B: {c: [402]}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [120151]}}}}}, + 0x72: {l: { + 0x61: {l: {0x6C: {l: {0x6C: {l: {0x3B: {c: [8704]}}}}}}}, + 0x6B: {l: { + 0x3B: {c: [8916]}, + 0x76: {l: {0x3B: {c: [10969]}}} + }} + }} + }}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10765]}}}}}}}}}}}}}}}, + 0x72: {l: { + 0x61: {l: { + 0x63: {l: { + 0x31: {l: { + 0x32: { + l: {0x3B: {c: [189]}}, + c: [189] + }, + 0x33: {l: {0x3B: {c: [8531]}}}, + 0x34: { + l: {0x3B: {c: [188]}}, + c: [188] + }, + 0x35: {l: {0x3B: {c: [8533]}}}, + 0x36: {l: {0x3B: {c: [8537]}}}, + 0x38: {l: {0x3B: {c: [8539]}}} + }}, + 0x32: {l: { + 0x33: {l: {0x3B: {c: [8532]}}}, + 0x35: {l: {0x3B: {c: [8534]}}} + }}, + 0x33: {l: { + 0x34: { + l: {0x3B: {c: [190]}}, + c: [190] + }, + 0x35: {l: {0x3B: {c: [8535]}}}, + 0x38: {l: {0x3B: {c: [8540]}}} + }}, + 0x34: {l: {0x35: {l: {0x3B: {c: [8536]}}}}}, + 0x35: {l: { + 0x36: {l: {0x3B: {c: [8538]}}}, + 0x38: {l: {0x3B: {c: [8541]}}} + }}, + 0x37: {l: {0x38: {l: {0x3B: {c: [8542]}}}}} + }}, + 0x73: {l: {0x6C: {l: {0x3B: {c: [8260]}}}}} + }}, + 0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [8994]}}}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119995]}}}}}}} + }}, + 0x46: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1060]}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120073]}}}}}, + 0x69: {l: {0x6C: {l: {0x6C: {l: {0x65: {l: {0x64: {l: { + 0x53: {l: {0x6D: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x53: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [9724]}}}}}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x72: {l: {0x79: {l: {0x53: {l: {0x6D: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x53: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [9642]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [120125]}}}}}, + 0x72: {l: {0x41: {l: {0x6C: {l: {0x6C: {l: {0x3B: {c: [8704]}}}}}}}}}, + 0x75: {l: {0x72: {l: {0x69: {l: {0x65: {l: {0x72: {l: {0x74: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8497]}}}}}}}}}}}}}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [8497]}}}}}}} + }}, + 0x67: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [501]}}}}}}}}}, + 0x6D: {l: {0x6D: {l: {0x61: {l: { + 0x3B: {c: [947]}, + 0x64: {l: {0x3B: {c: [989]}}} + }}}}}}, + 0x70: {l: {0x3B: {c: [10886]}}} + }}, + 0x62: {l: {0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [287]}}}}}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [285]}}}}}}}, + 0x79: {l: {0x3B: {c: [1075]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [289]}}}}}}}, + 0x65: {l: { + 0x3B: {c: [8805]}, + 0x6C: {l: {0x3B: {c: [8923]}}}, + 0x71: {l: { + 0x3B: {c: [8805]}, + 0x71: {l: {0x3B: {c: [8807]}}}, + 0x73: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10878]}}}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x63: {l: {0x3B: {c: [10921]}}}}}, + 0x3B: {c: [10878]}, + 0x64: {l: {0x6F: {l: {0x74: {l: { + 0x3B: {c: [10880]}, + 0x6F: {l: { + 0x3B: {c: [10882]}, + 0x6C: {l: {0x3B: {c: [10884]}}} + }} + }}}}}}, + 0x6C: {l: { + 0x3B: {c: [8923, 65024]}, + 0x65: {l: {0x73: {l: {0x3B: {c: [10900]}}}}} + }} + }} + }}, + 0x45: {l: { + 0x3B: {c: [8807]}, + 0x6C: {l: {0x3B: {c: [10892]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120100]}}}}}, + 0x67: {l: { + 0x3B: {c: [8811]}, + 0x67: {l: {0x3B: {c: [8921]}}} + }}, + 0x69: {l: {0x6D: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8503]}}}}}}}}}, + 0x6A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1107]}}}}}}}, + 0x6C: {l: { + 0x61: {l: {0x3B: {c: [10917]}}}, + 0x3B: {c: [8823]}, + 0x45: {l: {0x3B: {c: [10898]}}}, + 0x6A: {l: {0x3B: {c: [10916]}}} + }}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: { + 0x3B: {c: [10890]}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10890]}}}}}}}}} + }}}}, + 0x65: {l: { + 0x3B: {c: [10888]}, + 0x71: {l: { + 0x3B: {c: [10888]}, + 0x71: {l: {0x3B: {c: [8809]}}} + }} + }}, + 0x45: {l: {0x3B: {c: [8809]}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8935]}}}}}}} + }}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120152]}}}}}}}, + 0x72: {l: {0x61: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [96]}}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8458]}}}}}, + 0x69: {l: {0x6D: {l: { + 0x3B: {c: [8819]}, + 0x65: {l: {0x3B: {c: [10894]}}}, + 0x6C: {l: {0x3B: {c: [10896]}}} + }}}} + }}, + 0x74: { + l: { + 0x63: {l: { + 0x63: {l: {0x3B: {c: [10919]}}}, + 0x69: {l: {0x72: {l: {0x3B: {c: [10874]}}}}} + }}, + 0x3B: {c: [62]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8919]}}}}}}}, + 0x6C: {l: {0x50: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10645]}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x65: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [10876]}}}}}}}}}}}, + 0x72: {l: { + 0x61: {l: { + 0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10886]}}}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [10616]}}}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8919]}}}}}}}, + 0x65: {l: {0x71: {l: { + 0x6C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8923]}}}}}}}}}, + 0x71: {l: {0x6C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10892]}}}}}}}}}}} + }}}}, + 0x6C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8823]}}}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8819]}}}}}}} + }} + }, + c: [62] + }, + 0x76: {l: { + 0x65: {l: {0x72: {l: {0x74: {l: {0x6E: {l: {0x65: {l: {0x71: {l: {0x71: {l: {0x3B: {c: [8809, 65024]}}}}}}}}}}}}}}}, + 0x6E: {l: {0x45: {l: {0x3B: {c: [8809, 65024]}}}}} + }} + }}, + 0x47: {l: { + 0x61: {l: {0x6D: {l: {0x6D: {l: {0x61: {l: { + 0x3B: {c: [915]}, + 0x64: {l: {0x3B: {c: [988]}}} + }}}}}}}}, + 0x62: {l: {0x72: {l: {0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [286]}}}}}}}}}}}, + 0x63: {l: { + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [290]}}}}}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [284]}}}}}}}, + 0x79: {l: {0x3B: {c: [1043]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [288]}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120074]}}}}}, + 0x67: {l: {0x3B: {c: [8921]}}}, + 0x4A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1027]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120126]}}}}}}}, + 0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: { + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: { + 0x3B: {c: [8805]}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8923]}}}}}}}}} + }}}}}}}}}}, + 0x46: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8807]}}}}}}}}}}}}}}}}}}}, + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [10914]}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8823]}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10878]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8819]}}}}}}}}}}} + }}}}}}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119970]}}}}}}}, + 0x54: { + l: {0x3B: {c: [62]}}, + c: [62] + }, + 0x74: {l: {0x3B: {c: [8811]}}} + }}, + 0x48: {l: { + 0x61: {l: { + 0x63: {l: {0x65: {l: {0x6B: {l: {0x3B: {c: [711]}}}}}}}, + 0x74: {l: {0x3B: {c: [94]}}} + }}, + 0x41: {l: {0x52: {l: {0x44: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1066]}}}}}}}}}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [292]}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [8460]}}}}}, + 0x69: {l: {0x6C: {l: {0x62: {l: {0x65: {l: {0x72: {l: {0x74: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8459]}}}}}}}}}}}}}}}}}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [8461]}}}}}, + 0x72: {l: {0x69: {l: {0x7A: {l: {0x6F: {l: {0x6E: {l: {0x74: {l: {0x61: {l: {0x6C: {l: {0x4C: {l: {0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [9472]}}}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8459]}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [294]}}}}}}}}} + }}, + 0x75: {l: {0x6D: {l: {0x70: {l: { + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x48: {l: {0x75: {l: {0x6D: {l: {0x70: {l: {0x3B: {c: [8782]}}}}}}}}}}}}}}}}}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8783]}}}}}}}}}}} + }}}}}} + }}, + 0x68: {l: { + 0x61: {l: { + 0x69: {l: {0x72: {l: {0x73: {l: {0x70: {l: {0x3B: {c: [8202]}}}}}}}}}, + 0x6C: {l: {0x66: {l: {0x3B: {c: [189]}}}}}, + 0x6D: {l: {0x69: {l: {0x6C: {l: {0x74: {l: {0x3B: {c: [8459]}}}}}}}}}, + 0x72: {l: { + 0x64: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1098]}}}}}}}, + 0x72: {l: { + 0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10568]}}}}}}}, + 0x3B: {c: [8596]}, + 0x77: {l: {0x3B: {c: [8621]}}} + }} + }} + }}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8660]}}}}}}}, + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8463]}}}}}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [293]}}}}}}}}}, + 0x65: {l: { + 0x61: {l: {0x72: {l: {0x74: {l: {0x73: {l: { + 0x3B: {c: [9829]}, + 0x75: {l: {0x69: {l: {0x74: {l: {0x3B: {c: [9829]}}}}}}} + }}}}}}}}, + 0x6C: {l: {0x6C: {l: {0x69: {l: {0x70: {l: {0x3B: {c: [8230]}}}}}}}}}, + 0x72: {l: {0x63: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8889]}}}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120101]}}}}}, + 0x6B: {l: {0x73: {l: { + 0x65: {l: {0x61: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10533]}}}}}}}}}}}, + 0x77: {l: {0x61: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10534]}}}}}}}}}}} + }}}}, + 0x6F: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8703]}}}}}}}, + 0x6D: {l: {0x74: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8763]}}}}}}}}}, + 0x6F: {l: {0x6B: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8617]}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8618]}}}}}}}}}}}}}}}}}}}}} + }}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120153]}}}}}, + 0x72: {l: {0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8213]}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119997]}}}}}, + 0x6C: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8463]}}}}}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [295]}}}}}}}}} + }}, + 0x79: {l: { + 0x62: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x3B: {c: [8259]}}}}}}}}}, + 0x70: {l: {0x68: {l: {0x65: {l: {0x6E: {l: {0x3B: {c: [8208]}}}}}}}}} + }} + }}, + 0x49: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [205]}}, + c: [205] + }}}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [206]}}, + c: [206] + }}}}}, + 0x79: {l: {0x3B: {c: [1048]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [304]}}}}}}}, + 0x45: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1045]}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [8465]}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [204]}}, + c: [204] + }}}}}}}}}, + 0x4A: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [306]}}}}}}}}}, + 0x6D: {l: { + 0x61: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [298]}}}}}, + 0x67: {l: {0x69: {l: {0x6E: {l: {0x61: {l: {0x72: {l: {0x79: {l: {0x49: {l: {0x3B: {c: [8520]}}}}}}}}}}}}}}} + }}, + 0x3B: {c: [8465]}, + 0x70: {l: {0x6C: {l: {0x69: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8658]}}}}}}}}}}} + }}, + 0x6E: {l: { + 0x74: {l: { + 0x3B: {c: [8748]}, + 0x65: {l: { + 0x67: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8747]}}}}}}}}}, + 0x72: {l: {0x73: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8898]}}}}}}}}}}}}}}}}} + }} + }}, + 0x76: {l: {0x69: {l: {0x73: {l: {0x69: {l: {0x62: {l: {0x6C: {l: {0x65: {l: { + 0x43: {l: {0x6F: {l: {0x6D: {l: {0x6D: {l: {0x61: {l: {0x3B: {c: [8291]}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8290]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}, + 0x4F: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1025]}}}}}}}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [302]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120128]}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [921]}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [8464]}}}}}}}, + 0x74: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [296]}}}}}}}}}}}, + 0x75: {l: { + 0x6B: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1030]}}}}}}}, + 0x6D: {l: {0x6C: { + l: {0x3B: {c: [207]}}, + c: [207] + }}} + }} + }}, + 0x69: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [237]}}, + c: [237] + }}}}}}}}}, + 0x63: {l: { + 0x3B: {c: [8291]}, + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [238]}}, + c: [238] + }}}}}, + 0x79: {l: {0x3B: {c: [1080]}}} + }}, + 0x65: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1077]}}}}}, + 0x78: {l: {0x63: {l: {0x6C: { + l: {0x3B: {c: [161]}}, + c: [161] + }}}}} + }}, + 0x66: {l: { + 0x66: {l: {0x3B: {c: [8660]}}}, + 0x72: {l: {0x3B: {c: [120102]}}} + }}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [236]}}, + c: [236] + }}}}}}}}}, + 0x69: {l: { + 0x3B: {c: [8520]}, + 0x69: {l: { + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10764]}}}}}}}, + 0x6E: {l: {0x74: {l: {0x3B: {c: [8749]}}}}} + }}, + 0x6E: {l: {0x66: {l: {0x69: {l: {0x6E: {l: {0x3B: {c: [10716]}}}}}}}}}, + 0x6F: {l: {0x74: {l: {0x61: {l: {0x3B: {c: [8489]}}}}}}} + }}, + 0x6A: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [307]}}}}}}}}}, + 0x6D: {l: { + 0x61: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [299]}}}}}, + 0x67: {l: { + 0x65: {l: {0x3B: {c: [8465]}}}, + 0x6C: {l: {0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [8464]}}}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x74: {l: {0x3B: {c: [8465]}}}}}}}}} + }}, + 0x74: {l: {0x68: {l: {0x3B: {c: [305]}}}}} + }}, + 0x6F: {l: {0x66: {l: {0x3B: {c: [8887]}}}}}, + 0x70: {l: {0x65: {l: {0x64: {l: {0x3B: {c: [437]}}}}}}} + }}, + 0x6E: {l: { + 0x63: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [8453]}}}}}}}}}, + 0x3B: {c: [8712]}, + 0x66: {l: {0x69: {l: {0x6E: {l: { + 0x3B: {c: [8734]}, + 0x74: {l: {0x69: {l: {0x65: {l: {0x3B: {c: [10717]}}}}}}} + }}}}}}, + 0x6F: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [305]}}}}}}}}}, + 0x74: {l: { + 0x63: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8890]}}}}}}}, + 0x3B: {c: [8747]}, + 0x65: {l: { + 0x67: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x3B: {c: [8484]}}}}}}}}}, + 0x72: {l: {0x63: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8890]}}}}}}}}} + }}, + 0x6C: {l: {0x61: {l: {0x72: {l: {0x68: {l: {0x6B: {l: {0x3B: {c: [10775]}}}}}}}}}}}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x64: {l: {0x3B: {c: [10812]}}}}}}}}} + }} + }}, + 0x6F: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1105]}}}}}, + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [303]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120154]}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [953]}}}}} + }}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x64: {l: {0x3B: {c: [10812]}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x65: {l: {0x73: {l: {0x74: { + l: {0x3B: {c: [191]}}, + c: [191] + }}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119998]}}}}}, + 0x69: {l: {0x6E: {l: { + 0x3B: {c: [8712]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8949]}}}}}}}, + 0x45: {l: {0x3B: {c: [8953]}}}, + 0x73: {l: { + 0x3B: {c: [8948]}, + 0x76: {l: {0x3B: {c: [8947]}}} + }}, + 0x76: {l: {0x3B: {c: [8712]}}} + }}}} + }}, + 0x74: {l: { + 0x3B: {c: [8290]}, + 0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [297]}}}}}}}}} + }}, + 0x75: {l: { + 0x6B: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1110]}}}}}}}, + 0x6D: {l: {0x6C: { + l: {0x3B: {c: [239]}}, + c: [239] + }}} + }} + }}, + 0x4A: {l: { + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [308]}}}}}}}, + 0x79: {l: {0x3B: {c: [1049]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120077]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120129]}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119973]}}}}}, + 0x65: {l: {0x72: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1032]}}}}}}}}} + }}, + 0x75: {l: {0x6B: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1028]}}}}}}}}} + }}, + 0x6A: {l: { + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [309]}}}}}}}, + 0x79: {l: {0x3B: {c: [1081]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120103]}}}}}, + 0x6D: {l: {0x61: {l: {0x74: {l: {0x68: {l: {0x3B: {c: [567]}}}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120155]}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119999]}}}}}, + 0x65: {l: {0x72: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1112]}}}}}}}}} + }}, + 0x75: {l: {0x6B: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1108]}}}}}}}}} + }}, + 0x4B: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x61: {l: {0x3B: {c: [922]}}}}}}}}}, + 0x63: {l: { + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [310]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1050]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120078]}}}}}, + 0x48: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1061]}}}}}}}, + 0x4A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1036]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120130]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119974]}}}}}}} + }}, + 0x6B: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x61: {l: { + 0x3B: {c: [954]}, + 0x76: {l: {0x3B: {c: [1008]}}} + }}}}}}}}, + 0x63: {l: { + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [311]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1082]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120104]}}}}}, + 0x67: {l: {0x72: {l: {0x65: {l: {0x65: {l: {0x6E: {l: {0x3B: {c: [312]}}}}}}}}}}}, + 0x68: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1093]}}}}}}}, + 0x6A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1116]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120156]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120000]}}}}}}} + }}, + 0x6C: {l: { + 0x41: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8666]}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8656]}}}}}, + 0x74: {l: {0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [10523]}}}}}}}}} + }}, + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [314]}}}}}}}}}, + 0x65: {l: {0x6D: {l: {0x70: {l: {0x74: {l: {0x79: {l: {0x76: {l: {0x3B: {c: [10676]}}}}}}}}}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x6E: {l: {0x3B: {c: [8466]}}}}}}}}}, + 0x6D: {l: {0x62: {l: {0x64: {l: {0x61: {l: {0x3B: {c: [955]}}}}}}}}}, + 0x6E: {l: {0x67: {l: { + 0x3B: {c: [10216]}, + 0x64: {l: {0x3B: {c: [10641]}}}, + 0x6C: {l: {0x65: {l: {0x3B: {c: [10216]}}}}} + }}}}, + 0x70: {l: {0x3B: {c: [10885]}}}, + 0x71: {l: {0x75: {l: {0x6F: { + l: {0x3B: {c: [171]}}, + c: [171] + }}}}}, + 0x72: {l: {0x72: {l: { + 0x62: {l: { + 0x3B: {c: [8676]}, + 0x66: {l: {0x73: {l: {0x3B: {c: [10527]}}}}} + }}, + 0x3B: {c: [8592]}, + 0x66: {l: {0x73: {l: {0x3B: {c: [10525]}}}}}, + 0x68: {l: {0x6B: {l: {0x3B: {c: [8617]}}}}}, + 0x6C: {l: {0x70: {l: {0x3B: {c: [8619]}}}}}, + 0x70: {l: {0x6C: {l: {0x3B: {c: [10553]}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [10611]}}}}}}}, + 0x74: {l: {0x6C: {l: {0x3B: {c: [8610]}}}}} + }}}}, + 0x74: {l: { + 0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [10521]}}}}}}}, + 0x3B: {c: [10923]}, + 0x65: {l: { + 0x3B: {c: [10925]}, + 0x73: {l: {0x3B: {c: [10925, 65024]}}} + }} + }} + }}, + 0x62: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10508]}}}}}}}, + 0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10098]}}}}}}}, + 0x72: {l: { + 0x61: {l: {0x63: {l: { + 0x65: {l: {0x3B: {c: [123]}}}, + 0x6B: {l: {0x3B: {c: [91]}}} + }}}}, + 0x6B: {l: { + 0x65: {l: {0x3B: {c: [10635]}}}, + 0x73: {l: {0x6C: {l: { + 0x64: {l: {0x3B: {c: [10639]}}}, + 0x75: {l: {0x3B: {c: [10637]}}} + }}}} + }} + }} + }}, + 0x42: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10510]}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [318]}}}}}}}}}, + 0x65: {l: { + 0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [316]}}}}}}}, + 0x69: {l: {0x6C: {l: {0x3B: {c: [8968]}}}}} + }}, + 0x75: {l: {0x62: {l: {0x3B: {c: [123]}}}}}, + 0x79: {l: {0x3B: {c: [1083]}}} + }}, + 0x64: {l: { + 0x63: {l: {0x61: {l: {0x3B: {c: [10550]}}}}}, + 0x71: {l: {0x75: {l: {0x6F: {l: { + 0x3B: {c: [8220]}, + 0x72: {l: {0x3B: {c: [8222]}}} + }}}}}}, + 0x72: {l: { + 0x64: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10599]}}}}}}}}}, + 0x75: {l: {0x73: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10571]}}}}}}}}}}} + }}, + 0x73: {l: {0x68: {l: {0x3B: {c: [8626]}}}}} + }}, + 0x65: {l: { + 0x3B: {c: [8804]}, + 0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x3B: {c: [8592]}, + 0x74: {l: {0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [8610]}}}}}}}}} + }}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: { + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [8637]}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [8636]}}}}} + }}}}}}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x73: {l: {0x3B: {c: [8647]}}}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x3B: {c: [8596]}, + 0x73: {l: {0x3B: {c: [8646]}}} + }}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: {0x73: {l: {0x3B: {c: [8651]}}}}}}}}}}}}}}}}}, + 0x73: {l: {0x71: {l: {0x75: {l: {0x69: {l: {0x67: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8621]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}}, + 0x74: {l: {0x68: {l: {0x72: {l: {0x65: {l: {0x65: {l: {0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8907]}}}}}}}}}}}}}}}}}}}}} + }}}}, + 0x67: {l: {0x3B: {c: [8922]}}}, + 0x71: {l: { + 0x3B: {c: [8804]}, + 0x71: {l: {0x3B: {c: [8806]}}}, + 0x73: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10877]}}}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x63: {l: {0x3B: {c: [10920]}}}}}, + 0x3B: {c: [10877]}, + 0x64: {l: {0x6F: {l: {0x74: {l: { + 0x3B: {c: [10879]}, + 0x6F: {l: { + 0x3B: {c: [10881]}, + 0x72: {l: {0x3B: {c: [10883]}}} + }} + }}}}}}, + 0x67: {l: { + 0x3B: {c: [8922, 65024]}, + 0x65: {l: {0x73: {l: {0x3B: {c: [10899]}}}}} + }}, + 0x73: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10885]}}}}}}}}}}}}}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8918]}}}}}}}, + 0x65: {l: {0x71: {l: { + 0x67: {l: {0x74: {l: {0x72: {l: {0x3B: {c: [8922]}}}}}}}, + 0x71: {l: {0x67: {l: {0x74: {l: {0x72: {l: {0x3B: {c: [10891]}}}}}}}}} + }}}}, + 0x67: {l: {0x74: {l: {0x72: {l: {0x3B: {c: [8822]}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8818]}}}}}}} + }} + }} + }}, + 0x45: {l: { + 0x3B: {c: [8806]}, + 0x67: {l: {0x3B: {c: [10891]}}} + }}, + 0x66: {l: { + 0x69: {l: {0x73: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [10620]}}}}}}}}}, + 0x6C: {l: {0x6F: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [8970]}}}}}}}}}, + 0x72: {l: {0x3B: {c: [120105]}}} + }}, + 0x67: {l: { + 0x3B: {c: [8822]}, + 0x45: {l: {0x3B: {c: [10897]}}} + }}, + 0x48: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10594]}}}}}}}, + 0x68: {l: { + 0x61: {l: {0x72: {l: { + 0x64: {l: {0x3B: {c: [8637]}}}, + 0x75: {l: { + 0x3B: {c: [8636]}, + 0x6C: {l: {0x3B: {c: [10602]}}} + }} + }}}}, + 0x62: {l: {0x6C: {l: {0x6B: {l: {0x3B: {c: [9604]}}}}}}} + }}, + 0x6A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1113]}}}}}}}, + 0x6C: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8647]}}}}}}}, + 0x3B: {c: [8810]}, + 0x63: {l: {0x6F: {l: {0x72: {l: {0x6E: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8990]}}}}}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x64: {l: {0x3B: {c: [10603]}}}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [9722]}}}}}}} + }}, + 0x6D: {l: { + 0x69: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [320]}}}}}}}}}, + 0x6F: {l: {0x75: {l: {0x73: {l: {0x74: {l: { + 0x61: {l: {0x63: {l: {0x68: {l: {0x65: {l: {0x3B: {c: [9136]}}}}}}}}}, + 0x3B: {c: [9136]} + }}}}}}}} + }}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: { + 0x3B: {c: [10889]}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10889]}}}}}}}}} + }}}}, + 0x65: {l: { + 0x3B: {c: [10887]}, + 0x71: {l: { + 0x3B: {c: [10887]}, + 0x71: {l: {0x3B: {c: [8808]}}} + }} + }}, + 0x45: {l: {0x3B: {c: [8808]}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8934]}}}}}}} + }}, + 0x6F: {l: { + 0x61: {l: { + 0x6E: {l: {0x67: {l: {0x3B: {c: [10220]}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8701]}}}}} + }}, + 0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10214]}}}}}}}, + 0x6E: {l: {0x67: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10229]}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10231]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x6D: {l: {0x61: {l: {0x70: {l: {0x73: {l: {0x74: {l: {0x6F: {l: {0x3B: {c: [10236]}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10230]}}}}}}}}}}}}}}}}}}}}} + }}}}, + 0x6F: {l: {0x70: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8619]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8620]}}}}}}}}}}} + }}}}}}}}}}}}}}, + 0x70: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [10629]}}}}}, + 0x66: {l: {0x3B: {c: [120157]}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10797]}}}}}}} + }}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [10804]}}}}}}}}}}}, + 0x77: {l: { + 0x61: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [8727]}}}}}}}, + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [95]}}}}}}} + }}, + 0x7A: {l: { + 0x3B: {c: [9674]}, + 0x65: {l: {0x6E: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [9674]}}}}}}}}}, + 0x66: {l: {0x3B: {c: [10731]}}} + }} + }}, + 0x70: {l: {0x61: {l: {0x72: {l: { + 0x3B: {c: [40]}, + 0x6C: {l: {0x74: {l: {0x3B: {c: [10643]}}}}} + }}}}}}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8646]}}}}}}}, + 0x63: {l: {0x6F: {l: {0x72: {l: {0x6E: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8991]}}}}}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: { + 0x3B: {c: [8651]}, + 0x64: {l: {0x3B: {c: [10605]}}} + }}}}}}, + 0x6D: {l: {0x3B: {c: [8206]}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [8895]}}}}}}} + }}, + 0x73: {l: { + 0x61: {l: {0x71: {l: {0x75: {l: {0x6F: {l: {0x3B: {c: [8249]}}}}}}}}}, + 0x63: {l: {0x72: {l: {0x3B: {c: [120001]}}}}}, + 0x68: {l: {0x3B: {c: [8624]}}}, + 0x69: {l: {0x6D: {l: { + 0x3B: {c: [8818]}, + 0x65: {l: {0x3B: {c: [10893]}}}, + 0x67: {l: {0x3B: {c: [10895]}}} + }}}}, + 0x71: {l: { + 0x62: {l: {0x3B: {c: [91]}}}, + 0x75: {l: {0x6F: {l: { + 0x3B: {c: [8216]}, + 0x72: {l: {0x3B: {c: [8218]}}} + }}}} + }}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [322]}}}}}}}}} + }}, + 0x74: { + l: { + 0x63: {l: { + 0x63: {l: {0x3B: {c: [10918]}}}, + 0x69: {l: {0x72: {l: {0x3B: {c: [10873]}}}}} + }}, + 0x3B: {c: [60]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8918]}}}}}}}, + 0x68: {l: {0x72: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8907]}}}}}}}}}, + 0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8905]}}}}}}}}}, + 0x6C: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10614]}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x65: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [10875]}}}}}}}}}}}, + 0x72: {l: { + 0x69: {l: { + 0x3B: {c: [9667]}, + 0x65: {l: {0x3B: {c: [8884]}}}, + 0x66: {l: {0x3B: {c: [9666]}}} + }}, + 0x50: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10646]}}}}}}} + }} + }, + c: [60] + }, + 0x75: {l: {0x72: {l: { + 0x64: {l: {0x73: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10570]}}}}}}}}}}}, + 0x75: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10598]}}}}}}}}} + }}}}, + 0x76: {l: { + 0x65: {l: {0x72: {l: {0x74: {l: {0x6E: {l: {0x65: {l: {0x71: {l: {0x71: {l: {0x3B: {c: [8808, 65024]}}}}}}}}}}}}}}}, + 0x6E: {l: {0x45: {l: {0x3B: {c: [8808, 65024]}}}}} + }} + }}, + 0x4C: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [313]}}}}}}}}}, + 0x6D: {l: {0x62: {l: {0x64: {l: {0x61: {l: {0x3B: {c: [923]}}}}}}}}}, + 0x6E: {l: {0x67: {l: {0x3B: {c: [10218]}}}}}, + 0x70: {l: {0x6C: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x74: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8466]}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8606]}}}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [317]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [315]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1051]}}} + }}, + 0x65: {l: { + 0x66: {l: {0x74: {l: { + 0x41: {l: { + 0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: {0x42: {l: {0x72: {l: {0x61: {l: {0x63: {l: {0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [10216]}}}}}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8676]}}}}}}}, + 0x3B: {c: [8592]}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8646]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}} + }}, + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8656]}}}}}}}}}}}, + 0x43: {l: {0x65: {l: {0x69: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [8968]}}}}}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: { + 0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x42: {l: {0x72: {l: {0x61: {l: {0x63: {l: {0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [10214]}}}}}}}}}}}}}}}}}}}}}}}, + 0x77: {l: {0x6E: {l: { + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10593]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10585]}}}}}}}, + 0x3B: {c: [8643]} + }}}}}}}}}}}} + }}}} + }}}}, + 0x46: {l: {0x6C: {l: {0x6F: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [8970]}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8596]}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10574]}}}}}}}}}}}}} + }}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8660]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: { + 0x65: {l: {0x65: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8612]}}}}}}}}}}}, + 0x3B: {c: [8867]}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10586]}}}}}}}}}}}}} + }}}}, + 0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10703]}}}}}}}, + 0x3B: {c: [8882]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8884]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}, + 0x55: {l: {0x70: {l: { + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10577]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10592]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10584]}}}}}}}, + 0x3B: {c: [8639]} + }}}}}}}}}}}} + }}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10578]}}}}}}}, + 0x3B: {c: [8636]} + }}}}}}}}}}}} + }}}}, + 0x73: {l: {0x73: {l: { + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8922]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x46: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8806]}}}}}}}}}}}}}}}}}}}, + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8822]}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10913]}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10877]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8818]}}}}}}}}}}} + }}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120079]}}}}}, + 0x4A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1033]}}}}}}}, + 0x6C: {l: { + 0x3B: {c: [8920]}, + 0x65: {l: {0x66: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8666]}}}}}}}}}}}}}}}}} + }}, + 0x6D: {l: {0x69: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [319]}}}}}}}}}}}, + 0x6F: {l: { + 0x6E: {l: {0x67: {l: { + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10229]}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10231]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10232]}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10234]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10230]}}}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [10233]}}}}}}}}}}}}}}}}}}}}} + }}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120131]}}}}}, + 0x77: {l: {0x65: {l: {0x72: {l: { + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8601]}}}}}}}}}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8600]}}}}}}}}}}}}}}}}}}}}} + }}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8466]}}}}}, + 0x68: {l: {0x3B: {c: [8624]}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [321]}}}}}}}}} + }}, + 0x54: { + l: {0x3B: {c: [60]}}, + c: [60] + }, + 0x74: {l: {0x3B: {c: [8810]}}} + }}, + 0x6D: {l: { + 0x61: {l: { + 0x63: {l: {0x72: { + l: {0x3B: {c: [175]}}, + c: [175] + }}}, + 0x6C: {l: { + 0x65: {l: {0x3B: {c: [9794]}}}, + 0x74: {l: { + 0x3B: {c: [10016]}, + 0x65: {l: {0x73: {l: {0x65: {l: {0x3B: {c: [10016]}}}}}}} + }} + }}, + 0x70: {l: { + 0x3B: {c: [8614]}, + 0x73: {l: {0x74: {l: {0x6F: {l: { + 0x3B: {c: [8614]}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [8615]}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8612]}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [8613]}}}}} + }}}}}} + }}, + 0x72: {l: {0x6B: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [9646]}}}}}}}}} + }}, + 0x63: {l: { + 0x6F: {l: {0x6D: {l: {0x6D: {l: {0x61: {l: {0x3B: {c: [10793]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1084]}}} + }}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8212]}}}}}}}}}, + 0x44: {l: {0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8762]}}}}}}}}}, + 0x65: {l: {0x61: {l: {0x73: {l: {0x75: {l: {0x72: {l: {0x65: {l: {0x64: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [8737]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120106]}}}}}, + 0x68: {l: {0x6F: {l: {0x3B: {c: [8487]}}}}}, + 0x69: {l: { + 0x63: {l: {0x72: {l: {0x6F: { + l: {0x3B: {c: [181]}}, + c: [181] + }}}}}, + 0x64: {l: { + 0x61: {l: {0x73: {l: {0x74: {l: {0x3B: {c: [42]}}}}}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10992]}}}}}}}, + 0x3B: {c: [8739]}, + 0x64: {l: {0x6F: {l: {0x74: { + l: {0x3B: {c: [183]}}, + c: [183] + }}}}} + }}, + 0x6E: {l: {0x75: {l: {0x73: {l: { + 0x62: {l: {0x3B: {c: [8863]}}}, + 0x3B: {c: [8722]}, + 0x64: {l: { + 0x3B: {c: [8760]}, + 0x75: {l: {0x3B: {c: [10794]}}} + }} + }}}}}} + }}, + 0x6C: {l: { + 0x63: {l: {0x70: {l: {0x3B: {c: [10971]}}}}}, + 0x64: {l: {0x72: {l: {0x3B: {c: [8230]}}}}} + }}, + 0x6E: {l: {0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8723]}}}}}}}}}}}, + 0x6F: {l: { + 0x64: {l: {0x65: {l: {0x6C: {l: {0x73: {l: {0x3B: {c: [8871]}}}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120158]}}}}} + }}, + 0x70: {l: {0x3B: {c: [8723]}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [120002]}}}}}, + 0x74: {l: {0x70: {l: {0x6F: {l: {0x73: {l: {0x3B: {c: [8766]}}}}}}}}} + }}, + 0x75: {l: { + 0x3B: {c: [956]}, + 0x6C: {l: {0x74: {l: {0x69: {l: {0x6D: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [8888]}}}}}}}}}}}}}, + 0x6D: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [8888]}}}}}}} + }} + }}, + 0x4D: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10501]}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1052]}}}}}, + 0x65: {l: { + 0x64: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8287]}}}}}}}}}}}}}}}}}}}, + 0x6C: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8499]}}}}}}}}}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120080]}}}}}, + 0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x50: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8723]}}}}}}}}}}}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120132]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [8499]}}}}}}}, + 0x75: {l: {0x3B: {c: [924]}}} + }}, + 0x6E: {l: { + 0x61: {l: { + 0x62: {l: {0x6C: {l: {0x61: {l: {0x3B: {c: [8711]}}}}}}}, + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [324]}}}}}}}}}, + 0x6E: {l: {0x67: {l: {0x3B: {c: [8736, 8402]}}}}}, + 0x70: {l: { + 0x3B: {c: [8777]}, + 0x45: {l: {0x3B: {c: [10864, 824]}}}, + 0x69: {l: {0x64: {l: {0x3B: {c: [8779, 824]}}}}}, + 0x6F: {l: {0x73: {l: {0x3B: {c: [329]}}}}}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [8777]}}}}}}}}} + }}, + 0x74: {l: {0x75: {l: {0x72: {l: { + 0x61: {l: {0x6C: {l: { + 0x3B: {c: [9838]}, + 0x73: {l: {0x3B: {c: [8469]}}} + }}}}, + 0x3B: {c: [9838]} + }}}}}} + }}, + 0x62: {l: { + 0x73: {l: {0x70: { + l: {0x3B: {c: [160]}}, + c: [160] + }}}, + 0x75: {l: {0x6D: {l: {0x70: {l: { + 0x3B: {c: [8782, 824]}, + 0x65: {l: {0x3B: {c: [8783, 824]}}} + }}}}}} + }}, + 0x63: {l: { + 0x61: {l: { + 0x70: {l: {0x3B: {c: [10819]}}}, + 0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [328]}}}}}}} + }}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [326]}}}}}}}}}, + 0x6F: {l: {0x6E: {l: {0x67: {l: { + 0x3B: {c: [8775]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10861, 824]}}}}}}} + }}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [10818]}}}}}, + 0x79: {l: {0x3B: {c: [1085]}}} + }}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8211]}}}}}}}}}, + 0x65: {l: { + 0x61: {l: {0x72: {l: { + 0x68: {l: {0x6B: {l: {0x3B: {c: [10532]}}}}}, + 0x72: {l: { + 0x3B: {c: [8599]}, + 0x6F: {l: {0x77: {l: {0x3B: {c: [8599]}}}}} + }} + }}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8663]}}}}}}}, + 0x3B: {c: [8800]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8784, 824]}}}}}}}, + 0x71: {l: {0x75: {l: {0x69: {l: {0x76: {l: {0x3B: {c: [8802]}}}}}}}}}, + 0x73: {l: { + 0x65: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10536]}}}}}}}, + 0x69: {l: {0x6D: {l: {0x3B: {c: [8770, 824]}}}}} + }}, + 0x78: {l: {0x69: {l: {0x73: {l: {0x74: {l: { + 0x3B: {c: [8708]}, + 0x73: {l: {0x3B: {c: [8708]}}} + }}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120107]}}}}}, + 0x67: {l: { + 0x45: {l: {0x3B: {c: [8807, 824]}}}, + 0x65: {l: { + 0x3B: {c: [8817]}, + 0x71: {l: { + 0x3B: {c: [8817]}, + 0x71: {l: {0x3B: {c: [8807, 824]}}}, + 0x73: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10878, 824]}}}}}}}}}}} + }}, + 0x73: {l: {0x3B: {c: [10878, 824]}}} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8821]}}}}}}}, + 0x74: {l: { + 0x3B: {c: [8815]}, + 0x72: {l: {0x3B: {c: [8815]}}} + }} + }}, + 0x47: {l: { + 0x67: {l: {0x3B: {c: [8921, 824]}}}, + 0x74: {l: { + 0x3B: {c: [8811, 8402]}, + 0x76: {l: {0x3B: {c: [8811, 824]}}} + }} + }}, + 0x68: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8622]}}}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8654]}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10994]}}}}}}} + }}, + 0x69: {l: { + 0x3B: {c: [8715]}, + 0x73: {l: { + 0x3B: {c: [8956]}, + 0x64: {l: {0x3B: {c: [8954]}}} + }}, + 0x76: {l: {0x3B: {c: [8715]}}} + }}, + 0x6A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1114]}}}}}}}, + 0x6C: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8602]}}}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8653]}}}}}}}, + 0x64: {l: {0x72: {l: {0x3B: {c: [8229]}}}}}, + 0x45: {l: {0x3B: {c: [8806, 824]}}}, + 0x65: {l: { + 0x3B: {c: [8816]}, + 0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8602]}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8622]}}}}}}}}}}}}}}}}}}}}} + }}}}, + 0x71: {l: { + 0x3B: {c: [8816]}, + 0x71: {l: {0x3B: {c: [8806, 824]}}}, + 0x73: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10877, 824]}}}}}}}}}}} + }}, + 0x73: {l: { + 0x3B: {c: [10877, 824]}, + 0x73: {l: {0x3B: {c: [8814]}}} + }} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8820]}}}}}}}, + 0x74: {l: { + 0x3B: {c: [8814]}, + 0x72: {l: {0x69: {l: { + 0x3B: {c: [8938]}, + 0x65: {l: {0x3B: {c: [8940]}}} + }}}} + }} + }}, + 0x4C: {l: { + 0x65: {l: {0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8653]}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8654]}}}}}}}}}}}}}}}}}}}}} + }}}}}}, + 0x6C: {l: {0x3B: {c: [8920, 824]}}}, + 0x74: {l: { + 0x3B: {c: [8810, 8402]}, + 0x76: {l: {0x3B: {c: [8810, 824]}}} + }} + }}, + 0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [8740]}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [120159]}}}}}, + 0x74: { + l: { + 0x3B: {c: [172]}, + 0x69: {l: {0x6E: {l: { + 0x3B: {c: [8713]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8949, 824]}}}}}}}, + 0x45: {l: {0x3B: {c: [8953, 824]}}}, + 0x76: {l: { + 0x61: {l: {0x3B: {c: [8713]}}}, + 0x62: {l: {0x3B: {c: [8951]}}}, + 0x63: {l: {0x3B: {c: [8950]}}} + }} + }}}}, + 0x6E: {l: {0x69: {l: { + 0x3B: {c: [8716]}, + 0x76: {l: { + 0x61: {l: {0x3B: {c: [8716]}}}, + 0x62: {l: {0x3B: {c: [8958]}}}, + 0x63: {l: {0x3B: {c: [8957]}}} + }} + }}}} + }, + c: [172] + } + }}, + 0x70: {l: { + 0x61: {l: {0x72: {l: { + 0x61: {l: {0x6C: {l: {0x6C: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8742]}}}}}}}}}}}, + 0x3B: {c: [8742]}, + 0x73: {l: {0x6C: {l: {0x3B: {c: [11005, 8421]}}}}}, + 0x74: {l: {0x3B: {c: [8706, 824]}}} + }}}}, + 0x6F: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10772]}}}}}}}}}}}, + 0x72: {l: { + 0x3B: {c: [8832]}, + 0x63: {l: {0x75: {l: {0x65: {l: {0x3B: {c: [8928]}}}}}}}, + 0x65: {l: { + 0x63: {l: { + 0x3B: {c: [8832]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [10927, 824]}}}}} + }}, + 0x3B: {c: [10927, 824]} + }} + }} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: { + 0x63: {l: {0x3B: {c: [10547, 824]}}}, + 0x3B: {c: [8603]}, + 0x77: {l: {0x3B: {c: [8605, 824]}}} + }}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8655]}}}}}}}, + 0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8603]}}}}}}}}}}}}}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: { + 0x3B: {c: [8939]}, + 0x65: {l: {0x3B: {c: [8941]}}} + }}}}}} + }}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8655]}}}}}}}}}}}}}}}}}}}}}, + 0x73: {l: { + 0x63: {l: { + 0x3B: {c: [8833]}, + 0x63: {l: {0x75: {l: {0x65: {l: {0x3B: {c: [8929]}}}}}}}, + 0x65: {l: {0x3B: {c: [10928, 824]}}}, + 0x72: {l: {0x3B: {c: [120003]}}} + }}, + 0x68: {l: {0x6F: {l: {0x72: {l: {0x74: {l: { + 0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [8740]}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8742]}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x69: {l: {0x6D: {l: { + 0x3B: {c: [8769]}, + 0x65: {l: { + 0x3B: {c: [8772]}, + 0x71: {l: {0x3B: {c: [8772]}}} + }} + }}}}, + 0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [8740]}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8742]}}}}}}}, + 0x71: {l: {0x73: {l: {0x75: {l: { + 0x62: {l: {0x65: {l: {0x3B: {c: [8930]}}}}}, + 0x70: {l: {0x65: {l: {0x3B: {c: [8931]}}}}} + }}}}}}, + 0x75: {l: { + 0x62: {l: { + 0x3B: {c: [8836]}, + 0x45: {l: {0x3B: {c: [10949, 824]}}}, + 0x65: {l: {0x3B: {c: [8840]}}}, + 0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8834, 8402]}, + 0x65: {l: {0x71: {l: { + 0x3B: {c: [8840]}, + 0x71: {l: {0x3B: {c: [10949, 824]}}} + }}}} + }}}}}} + }}, + 0x63: {l: {0x63: {l: { + 0x3B: {c: [8833]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [10928, 824]}}}}} + }}}}, + 0x70: {l: { + 0x3B: {c: [8837]}, + 0x45: {l: {0x3B: {c: [10950, 824]}}}, + 0x65: {l: {0x3B: {c: [8841]}}}, + 0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8835, 8402]}, + 0x65: {l: {0x71: {l: { + 0x3B: {c: [8841]}, + 0x71: {l: {0x3B: {c: [10950, 824]}}} + }}}} + }}}}}} + }} + }} + }}, + 0x74: {l: { + 0x67: {l: {0x6C: {l: {0x3B: {c: [8825]}}}}}, + 0x69: {l: {0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [241]}}, + c: [241] + }}}}}}}, + 0x6C: {l: {0x67: {l: {0x3B: {c: [8824]}}}}}, + 0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x3B: {c: [8938]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8940]}}}}} + }}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x3B: {c: [8939]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8941]}}}}} + }}}}}}}}}} + }}}}}}}}}}}}}} + }}, + 0x75: {l: { + 0x3B: {c: [957]}, + 0x6D: {l: { + 0x3B: {c: [35]}, + 0x65: {l: {0x72: {l: {0x6F: {l: {0x3B: {c: [8470]}}}}}}}, + 0x73: {l: {0x70: {l: {0x3B: {c: [8199]}}}}} + }} + }}, + 0x76: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [8781, 8402]}}}}}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8876]}}}}}}}}}, + 0x44: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8877]}}}}}}}}}, + 0x67: {l: { + 0x65: {l: {0x3B: {c: [8805, 8402]}}}, + 0x74: {l: {0x3B: {c: [62, 8402]}}} + }}, + 0x48: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10500]}}}}}}}}}, + 0x69: {l: {0x6E: {l: {0x66: {l: {0x69: {l: {0x6E: {l: {0x3B: {c: [10718]}}}}}}}}}}}, + 0x6C: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10498]}}}}}}}, + 0x65: {l: {0x3B: {c: [8804, 8402]}}}, + 0x74: {l: { + 0x3B: {c: [60, 8402]}, + 0x72: {l: {0x69: {l: {0x65: {l: {0x3B: {c: [8884, 8402]}}}}}}} + }} + }}, + 0x72: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10499]}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x65: {l: {0x3B: {c: [8885, 8402]}}}}}}}}} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8764, 8402]}}}}}}} + }}, + 0x56: {l: { + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8878]}}}}}}}}}, + 0x44: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8879]}}}}}}}}} + }}, + 0x77: {l: { + 0x61: {l: {0x72: {l: { + 0x68: {l: {0x6B: {l: {0x3B: {c: [10531]}}}}}, + 0x72: {l: { + 0x3B: {c: [8598]}, + 0x6F: {l: {0x77: {l: {0x3B: {c: [8598]}}}}} + }} + }}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8662]}}}}}}}, + 0x6E: {l: {0x65: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10535]}}}}}}}}} + }} + }}, + 0x4E: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [323]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [327]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [325]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1053]}}} + }}, + 0x65: {l: { + 0x67: {l: {0x61: {l: {0x74: {l: {0x69: {l: {0x76: {l: {0x65: {l: { + 0x4D: {l: {0x65: {l: {0x64: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8203]}}}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x68: {l: {0x69: {l: { + 0x63: {l: {0x6B: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8203]}}}}}}}}}}}}}}}, + 0x6E: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8203]}}}}}}}}}}}}} + }}}}}}, + 0x56: {l: {0x65: {l: {0x72: {l: {0x79: {l: {0x54: {l: {0x68: {l: {0x69: {l: {0x6E: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8203]}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}}}}, + 0x73: {l: {0x74: {l: {0x65: {l: {0x64: {l: { + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8811]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8810]}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x77: {l: {0x4C: {l: {0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [10]}}}}}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120081]}}}}}, + 0x4A: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1034]}}}}}}}, + 0x6F: {l: { + 0x42: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x6B: {l: {0x3B: {c: [8288]}}}}}}}}}}}, + 0x6E: {l: {0x42: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x6B: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [160]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [8469]}}}}}, + 0x74: {l: { + 0x3B: {c: [10988]}, + 0x43: {l: { + 0x6F: {l: {0x6E: {l: {0x67: {l: {0x72: {l: {0x75: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8802]}}}}}}}}}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x43: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [8813]}}}}}}}}}}} + }}, + 0x44: {l: {0x6F: {l: {0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x63: {l: {0x61: {l: {0x6C: {l: {0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8742]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x45: {l: { + 0x6C: {l: {0x65: {l: {0x6D: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8713]}}}}}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: { + 0x3B: {c: [8800]}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8770, 824]}}}}}}}}}}} + }}}}}}}}, + 0x78: {l: {0x69: {l: {0x73: {l: {0x74: {l: {0x73: {l: {0x3B: {c: [8708]}}}}}}}}}}} + }}, + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: { + 0x3B: {c: [8815]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8817]}}}}}}}}}}}, + 0x46: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8807, 824]}}}}}}}}}}}}}}}}}}}, + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8811, 824]}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8825]}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10878, 824]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8821]}}}}}}}}}}} + }}}}}}}}}}}}}}, + 0x48: {l: {0x75: {l: {0x6D: {l: {0x70: {l: { + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x48: {l: {0x75: {l: {0x6D: {l: {0x70: {l: {0x3B: {c: [8782, 824]}}}}}}}}}}}}}}}}}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8783, 824]}}}}}}}}}}} + }}}}}}}}, + 0x4C: {l: {0x65: {l: { + 0x66: {l: {0x74: {l: {0x54: {l: {0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10703, 824]}}}}}}}, + 0x3B: {c: [8938]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8940]}}}}}}}}}}} + }}}}}}}}}}}}}}}}}}}}, + 0x73: {l: {0x73: {l: { + 0x3B: {c: [8814]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8816]}}}}}}}}}}}, + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [8824]}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [8810, 824]}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10877, 824]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8820]}}}}}}}}}}} + }}}} + }}}}, + 0x4E: {l: {0x65: {l: {0x73: {l: {0x74: {l: {0x65: {l: {0x64: {l: { + 0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x47: {l: {0x72: {l: {0x65: {l: {0x61: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x3B: {c: [10914, 824]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x4C: {l: {0x65: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10913, 824]}}}}}}}}}}}}}}}}} + }}}}}}}}}}}}, + 0x50: {l: {0x72: {l: {0x65: {l: {0x63: {l: {0x65: {l: {0x64: {l: {0x65: {l: {0x73: {l: { + 0x3B: {c: [8832]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10927, 824]}}}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8928]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}}}}}}}}, + 0x52: {l: { + 0x65: {l: {0x76: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x45: {l: {0x6C: {l: {0x65: {l: {0x6D: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8716]}}}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x54: {l: {0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10704, 824]}}}}}}}, + 0x3B: {c: [8939]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8941]}}}}}}}}}}} + }}}}}}}}}}}}}}}}}}}}}}}} + }}, + 0x53: {l: { + 0x71: {l: {0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x53: {l: {0x75: {l: { + 0x62: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8847, 824]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8930]}}}}}}}}}}} + }}}}}}}}, + 0x70: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8848, 824]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8931]}}}}}}}}}}} + }}}}}}}}}}}} + }}}}}}}}}}}}}}, + 0x75: {l: { + 0x62: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8834, 8402]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8840]}}}}}}}}}}} + }}}}}}}}, + 0x63: {l: {0x63: {l: {0x65: {l: {0x65: {l: {0x64: {l: {0x73: {l: { + 0x3B: {c: [8833]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10928, 824]}}}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8929]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8831, 824]}}}}}}}}}}} + }}}}}}}}}}}}, + 0x70: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8835, 8402]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8841]}}}}}}}}}}} + }}}}}}}}}}}} + }} + }}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: { + 0x3B: {c: [8769]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8772]}}}}}}}}}}}, + 0x46: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8775]}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8777]}}}}}}}}}}} + }}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x63: {l: {0x61: {l: {0x6C: {l: {0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8740]}}}}}}}}}}}}}}}}}}}}}}} + }} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119977]}}}}}}}, + 0x74: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [209]}}, + c: [209] + }}}}}}}}}, + 0x75: {l: {0x3B: {c: [925]}}} + }}, + 0x4F: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [211]}}, + c: [211] + }}}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [212]}}, + c: [212] + }}}}}, + 0x79: {l: {0x3B: {c: [1054]}}} + }}, + 0x64: {l: {0x62: {l: {0x6C: {l: {0x61: {l: {0x63: {l: {0x3B: {c: [336]}}}}}}}}}}}, + 0x45: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [338]}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120082]}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [210]}}, + c: [210] + }}}}}}}}}, + 0x6D: {l: { + 0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [332]}}}}}}}, + 0x65: {l: {0x67: {l: {0x61: {l: {0x3B: {c: [937]}}}}}}}, + 0x69: {l: {0x63: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [927]}}}}}}}}}}} + }}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120134]}}}}}}}, + 0x70: {l: {0x65: {l: {0x6E: {l: {0x43: {l: {0x75: {l: {0x72: {l: {0x6C: {l: {0x79: {l: { + 0x44: {l: {0x6F: {l: {0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x51: {l: {0x75: {l: {0x6F: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [8220]}}}}}}}}}}}}}}}}}}}}}}}, + 0x51: {l: {0x75: {l: {0x6F: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [8216]}}}}}}}}}}} + }}}}}}}}}}}}}}}}, + 0x72: {l: {0x3B: {c: [10836]}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119978]}}}}}, + 0x6C: {l: {0x61: {l: {0x73: {l: {0x68: { + l: {0x3B: {c: [216]}}, + c: [216] + }}}}}}} + }}, + 0x74: {l: {0x69: {l: { + 0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [213]}}, + c: [213] + }}}}}, + 0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [10807]}}}}}}} + }}}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [214]}}, + c: [214] + }}}}}, + 0x76: {l: {0x65: {l: {0x72: {l: { + 0x42: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [8254]}}}}}, + 0x72: {l: {0x61: {l: {0x63: {l: { + 0x65: {l: {0x3B: {c: [9182]}}}, + 0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [9140]}}}}}}} + }}}}}} + }}, + 0x50: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x68: {l: {0x65: {l: {0x73: {l: {0x69: {l: {0x73: {l: {0x3B: {c: [9180]}}}}}}}}}}}}}}}}}}}}}}} + }}}}}} + }}, + 0x6F: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [243]}}, + c: [243] + }}}}}}}, + 0x73: {l: {0x74: {l: {0x3B: {c: [8859]}}}}} + }}, + 0x63: {l: { + 0x69: {l: {0x72: {l: { + 0x63: { + l: {0x3B: {c: [244]}}, + c: [244] + }, + 0x3B: {c: [8858]} + }}}}, + 0x79: {l: {0x3B: {c: [1086]}}} + }}, + 0x64: {l: { + 0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8861]}}}}}}}, + 0x62: {l: {0x6C: {l: {0x61: {l: {0x63: {l: {0x3B: {c: [337]}}}}}}}}}, + 0x69: {l: {0x76: {l: {0x3B: {c: [10808]}}}}}, + 0x6F: {l: {0x74: {l: {0x3B: {c: [8857]}}}}}, + 0x73: {l: {0x6F: {l: {0x6C: {l: {0x64: {l: {0x3B: {c: [10684]}}}}}}}}} + }}, + 0x65: {l: {0x6C: {l: {0x69: {l: {0x67: {l: {0x3B: {c: [339]}}}}}}}}}, + 0x66: {l: { + 0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10687]}}}}}}}, + 0x72: {l: {0x3B: {c: [120108]}}} + }}, + 0x67: {l: { + 0x6F: {l: {0x6E: {l: {0x3B: {c: [731]}}}}}, + 0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [242]}}, + c: [242] + }}}}}}}, + 0x74: {l: {0x3B: {c: [10689]}}} + }}, + 0x68: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10677]}}}}}}}, + 0x6D: {l: {0x3B: {c: [937]}}} + }}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8750]}}}}}}}, + 0x6C: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8634]}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x3B: {c: [10686]}}}}}, + 0x72: {l: {0x6F: {l: {0x73: {l: {0x73: {l: {0x3B: {c: [10683]}}}}}}}}} + }}, + 0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [8254]}}}}}}}, + 0x74: {l: {0x3B: {c: [10688]}}} + }}, + 0x6D: {l: { + 0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [333]}}}}}}}, + 0x65: {l: {0x67: {l: {0x61: {l: {0x3B: {c: [969]}}}}}}}, + 0x69: {l: { + 0x63: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [959]}}}}}}}}}, + 0x64: {l: {0x3B: {c: [10678]}}}, + 0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8854]}}}}}}} + }} + }}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120160]}}}}}}}, + 0x70: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [10679]}}}}}, + 0x65: {l: {0x72: {l: {0x70: {l: {0x3B: {c: [10681]}}}}}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8853]}}}}}}} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8635]}}}}}}}, + 0x3B: {c: [8744]}, + 0x64: {l: { + 0x3B: {c: [10845]}, + 0x65: {l: {0x72: {l: { + 0x3B: {c: [8500]}, + 0x6F: {l: {0x66: {l: {0x3B: {c: [8500]}}}}} + }}}}, + 0x66: { + l: {0x3B: {c: [170]}}, + c: [170] + }, + 0x6D: { + l: {0x3B: {c: [186]}}, + c: [186] + } + }}, + 0x69: {l: {0x67: {l: {0x6F: {l: {0x66: {l: {0x3B: {c: [8886]}}}}}}}}}, + 0x6F: {l: {0x72: {l: {0x3B: {c: [10838]}}}}}, + 0x73: {l: {0x6C: {l: {0x6F: {l: {0x70: {l: {0x65: {l: {0x3B: {c: [10839]}}}}}}}}}}}, + 0x76: {l: {0x3B: {c: [10843]}}} + }}, + 0x53: {l: {0x3B: {c: [9416]}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8500]}}}}}, + 0x6C: {l: {0x61: {l: {0x73: {l: {0x68: { + l: {0x3B: {c: [248]}}, + c: [248] + }}}}}}}, + 0x6F: {l: {0x6C: {l: {0x3B: {c: [8856]}}}}} + }}, + 0x74: {l: {0x69: {l: { + 0x6C: {l: {0x64: {l: {0x65: { + l: {0x3B: {c: [245]}}, + c: [245] + }}}}}, + 0x6D: {l: {0x65: {l: {0x73: {l: { + 0x61: {l: {0x73: {l: {0x3B: {c: [10806]}}}}}, + 0x3B: {c: [8855]} + }}}}}} + }}}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [246]}}, + c: [246] + }}}}}, + 0x76: {l: {0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [9021]}}}}}}}}} + }}, + 0x70: {l: { + 0x61: {l: {0x72: {l: { + 0x61: { + l: { + 0x3B: {c: [182]}, + 0x6C: {l: {0x6C: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8741]}}}}}}}}} + }, + c: [182] + }, + 0x3B: {c: [8741]}, + 0x73: {l: { + 0x69: {l: {0x6D: {l: {0x3B: {c: [10995]}}}}}, + 0x6C: {l: {0x3B: {c: [11005]}}} + }}, + 0x74: {l: {0x3B: {c: [8706]}}} + }}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1087]}}}}}, + 0x65: {l: {0x72: {l: { + 0x63: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [37]}}}}}}}, + 0x69: {l: {0x6F: {l: {0x64: {l: {0x3B: {c: [46]}}}}}}}, + 0x6D: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [8240]}}}}}}}, + 0x70: {l: {0x3B: {c: [8869]}}}, + 0x74: {l: {0x65: {l: {0x6E: {l: {0x6B: {l: {0x3B: {c: [8241]}}}}}}}}} + }}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120109]}}}}}, + 0x68: {l: { + 0x69: {l: { + 0x3B: {c: [966]}, + 0x76: {l: {0x3B: {c: [981]}}} + }}, + 0x6D: {l: {0x6D: {l: {0x61: {l: {0x74: {l: {0x3B: {c: [8499]}}}}}}}}}, + 0x6F: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [9742]}}}}}}} + }}, + 0x69: {l: { + 0x3B: {c: [960]}, + 0x74: {l: {0x63: {l: {0x68: {l: {0x66: {l: {0x6F: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [8916]}}}}}}}}}}}}}}}, + 0x76: {l: {0x3B: {c: [982]}}} + }}, + 0x6C: {l: { + 0x61: {l: {0x6E: {l: { + 0x63: {l: {0x6B: {l: { + 0x3B: {c: [8463]}, + 0x68: {l: {0x3B: {c: [8462]}}} + }}}}, + 0x6B: {l: {0x76: {l: {0x3B: {c: [8463]}}}}} + }}}}, + 0x75: {l: {0x73: {l: { + 0x61: {l: {0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10787]}}}}}}}}}, + 0x62: {l: {0x3B: {c: [8862]}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10786]}}}}}}}, + 0x3B: {c: [43]}, + 0x64: {l: { + 0x6F: {l: {0x3B: {c: [8724]}}}, + 0x75: {l: {0x3B: {c: [10789]}}} + }}, + 0x65: {l: {0x3B: {c: [10866]}}}, + 0x6D: {l: {0x6E: { + l: {0x3B: {c: [177]}}, + c: [177] + }}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [10790]}}}}}}}, + 0x74: {l: {0x77: {l: {0x6F: {l: {0x3B: {c: [10791]}}}}}}} + }}}} + }}, + 0x6D: {l: {0x3B: {c: [177]}}}, + 0x6F: {l: { + 0x69: {l: {0x6E: {l: {0x74: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10773]}}}}}}}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120161]}}}}}, + 0x75: {l: {0x6E: {l: {0x64: { + l: {0x3B: {c: [163]}}, + c: [163] + }}}}} + }}, + 0x72: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10935]}}}}}, + 0x3B: {c: [8826]}, + 0x63: {l: {0x75: {l: {0x65: {l: {0x3B: {c: [8828]}}}}}}}, + 0x65: {l: { + 0x63: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10935]}}}}}}}}}}}}}, + 0x3B: {c: [8826]}, + 0x63: {l: {0x75: {l: {0x72: {l: {0x6C: {l: {0x79: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [8828]}}}}}}}}}}}}}}}, + 0x65: {l: {0x71: {l: {0x3B: {c: [10927]}}}}}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10937]}}}}}}}}}}}}}, + 0x65: {l: {0x71: {l: {0x71: {l: {0x3B: {c: [10933]}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8936]}}}}}}} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8830]}}}}}}} + }}, + 0x3B: {c: [10927]} + }}, + 0x45: {l: {0x3B: {c: [10931]}}}, + 0x69: {l: {0x6D: {l: {0x65: {l: { + 0x3B: {c: [8242]}, + 0x73: {l: {0x3B: {c: [8473]}}} + }}}}}}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10937]}}}}}, + 0x45: {l: {0x3B: {c: [10933]}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8936]}}}}}}} + }}, + 0x6F: {l: { + 0x64: {l: {0x3B: {c: [8719]}}}, + 0x66: {l: { + 0x61: {l: {0x6C: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [9006]}}}}}}}}}, + 0x6C: {l: {0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [8978]}}}}}}}}}, + 0x73: {l: {0x75: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8979]}}}}}}}}} + }}, + 0x70: {l: { + 0x3B: {c: [8733]}, + 0x74: {l: {0x6F: {l: {0x3B: {c: [8733]}}}}} + }} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8830]}}}}}}}, + 0x75: {l: {0x72: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8880]}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [120005]}}}}}, + 0x69: {l: {0x3B: {c: [968]}}} + }}, + 0x75: {l: {0x6E: {l: {0x63: {l: {0x73: {l: {0x70: {l: {0x3B: {c: [8200]}}}}}}}}}}} + }}, + 0x50: {l: { + 0x61: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x61: {l: {0x6C: {l: {0x44: {l: {0x3B: {c: [8706]}}}}}}}}}}}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1055]}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120083]}}}}}, + 0x68: {l: {0x69: {l: {0x3B: {c: [934]}}}}}, + 0x69: {l: {0x3B: {c: [928]}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x4D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [177]}}}}}}}}}}}}}}}}}, + 0x6F: {l: { + 0x69: {l: {0x6E: {l: {0x63: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x70: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [8460]}}}}}}}}}}}}}}}}}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [8473]}}}}} + }}, + 0x72: {l: { + 0x3B: {c: [10939]}, + 0x65: {l: {0x63: {l: {0x65: {l: {0x64: {l: {0x65: {l: {0x73: {l: { + 0x3B: {c: [8826]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10927]}}}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8828]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8830]}}}}}}}}}}} + }}}}}}}}}}}}, + 0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [8243]}}}}}}}, + 0x6F: {l: { + 0x64: {l: {0x75: {l: {0x63: {l: {0x74: {l: {0x3B: {c: [8719]}}}}}}}}}, + 0x70: {l: {0x6F: {l: {0x72: {l: {0x74: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: { + 0x61: {l: {0x6C: {l: {0x3B: {c: [8733]}}}}}, + 0x3B: {c: [8759]} + }}}}}}}}}}}}}} + }} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119979]}}}}}, + 0x69: {l: {0x3B: {c: [936]}}} + }} + }}, + 0x51: {l: { + 0x66: {l: {0x72: {l: {0x3B: {c: [120084]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [8474]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119980]}}}}}}}, + 0x55: {l: {0x4F: {l: {0x54: { + l: {0x3B: {c: [34]}}, + c: [34] + }}}}} + }}, + 0x71: {l: { + 0x66: {l: {0x72: {l: {0x3B: {c: [120110]}}}}}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10764]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120162]}}}}}}}, + 0x70: {l: {0x72: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [8279]}}}}}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120006]}}}}}}}, + 0x75: {l: { + 0x61: {l: {0x74: {l: { + 0x65: {l: {0x72: {l: {0x6E: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x73: {l: {0x3B: {c: [8461]}}}}}}}}}}}}}}}, + 0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10774]}}}}}}} + }}}}, + 0x65: {l: {0x73: {l: {0x74: {l: { + 0x3B: {c: [63]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8799]}}}}} + }}}}}}, + 0x6F: {l: {0x74: { + l: {0x3B: {c: [34]}}, + c: [34] + }}} + }} + }}, + 0x72: {l: { + 0x41: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8667]}}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8658]}}}}}, + 0x74: {l: {0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [10524]}}}}}}}}} + }}, + 0x61: {l: { + 0x63: {l: { + 0x65: {l: {0x3B: {c: [8765, 817]}}}, + 0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [341]}}}}}}} + }}, + 0x64: {l: {0x69: {l: {0x63: {l: {0x3B: {c: [8730]}}}}}}}, + 0x65: {l: {0x6D: {l: {0x70: {l: {0x74: {l: {0x79: {l: {0x76: {l: {0x3B: {c: [10675]}}}}}}}}}}}}}, + 0x6E: {l: {0x67: {l: { + 0x3B: {c: [10217]}, + 0x64: {l: {0x3B: {c: [10642]}}}, + 0x65: {l: {0x3B: {c: [10661]}}}, + 0x6C: {l: {0x65: {l: {0x3B: {c: [10217]}}}}} + }}}}, + 0x71: {l: {0x75: {l: {0x6F: { + l: {0x3B: {c: [187]}}, + c: [187] + }}}}}, + 0x72: {l: {0x72: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10613]}}}}}, + 0x62: {l: { + 0x3B: {c: [8677]}, + 0x66: {l: {0x73: {l: {0x3B: {c: [10528]}}}}} + }}, + 0x63: {l: {0x3B: {c: [10547]}}}, + 0x3B: {c: [8594]}, + 0x66: {l: {0x73: {l: {0x3B: {c: [10526]}}}}}, + 0x68: {l: {0x6B: {l: {0x3B: {c: [8618]}}}}}, + 0x6C: {l: {0x70: {l: {0x3B: {c: [8620]}}}}}, + 0x70: {l: {0x6C: {l: {0x3B: {c: [10565]}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [10612]}}}}}}}, + 0x74: {l: {0x6C: {l: {0x3B: {c: [8611]}}}}}, + 0x77: {l: {0x3B: {c: [8605]}}} + }}}}, + 0x74: {l: { + 0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [10522]}}}}}}}, + 0x69: {l: {0x6F: {l: { + 0x3B: {c: [8758]}, + 0x6E: {l: {0x61: {l: {0x6C: {l: {0x73: {l: {0x3B: {c: [8474]}}}}}}}}} + }}}} + }} + }}, + 0x62: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10509]}}}}}}}, + 0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10099]}}}}}}}, + 0x72: {l: { + 0x61: {l: {0x63: {l: { + 0x65: {l: {0x3B: {c: [125]}}}, + 0x6B: {l: {0x3B: {c: [93]}}} + }}}}, + 0x6B: {l: { + 0x65: {l: {0x3B: {c: [10636]}}}, + 0x73: {l: {0x6C: {l: { + 0x64: {l: {0x3B: {c: [10638]}}}, + 0x75: {l: {0x3B: {c: [10640]}}} + }}}} + }} + }} + }}, + 0x42: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10511]}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [345]}}}}}}}}}, + 0x65: {l: { + 0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [343]}}}}}}}, + 0x69: {l: {0x6C: {l: {0x3B: {c: [8969]}}}}} + }}, + 0x75: {l: {0x62: {l: {0x3B: {c: [125]}}}}}, + 0x79: {l: {0x3B: {c: [1088]}}} + }}, + 0x64: {l: { + 0x63: {l: {0x61: {l: {0x3B: {c: [10551]}}}}}, + 0x6C: {l: {0x64: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10601]}}}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x6F: {l: { + 0x3B: {c: [8221]}, + 0x72: {l: {0x3B: {c: [8221]}}} + }}}}}}, + 0x73: {l: {0x68: {l: {0x3B: {c: [8627]}}}}} + }}, + 0x65: {l: { + 0x61: {l: {0x6C: {l: { + 0x3B: {c: [8476]}, + 0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [8475]}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x74: {l: {0x3B: {c: [8476]}}}}}}}}}, + 0x73: {l: {0x3B: {c: [8477]}}} + }}}}, + 0x63: {l: {0x74: {l: {0x3B: {c: [9645]}}}}}, + 0x67: { + l: {0x3B: {c: [174]}}, + c: [174] + } + }}, + 0x66: {l: { + 0x69: {l: {0x73: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [10621]}}}}}}}}}, + 0x6C: {l: {0x6F: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [8971]}}}}}}}}}, + 0x72: {l: {0x3B: {c: [120111]}}} + }}, + 0x48: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10596]}}}}}}}, + 0x68: {l: { + 0x61: {l: {0x72: {l: { + 0x64: {l: {0x3B: {c: [8641]}}}, + 0x75: {l: { + 0x3B: {c: [8640]}, + 0x6C: {l: {0x3B: {c: [10604]}}} + }} + }}}}, + 0x6F: {l: { + 0x3B: {c: [961]}, + 0x76: {l: {0x3B: {c: [1009]}}} + }} + }}, + 0x69: {l: { + 0x67: {l: {0x68: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x3B: {c: [8594]}, + 0x74: {l: {0x61: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [8611]}}}}}}}}} + }}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: { + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [8641]}}}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [8640]}}}}} + }}}}}}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x73: {l: {0x3B: {c: [8644]}}}}}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: {0x73: {l: {0x3B: {c: [8652]}}}}}}}}}}}}}}}}} + }}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x73: {l: {0x3B: {c: [8649]}}}}}}}}}}}}}}}}}}}}}}}, + 0x73: {l: {0x71: {l: {0x75: {l: {0x69: {l: {0x67: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8605]}}}}}}}}}}}}}}}}}}}}}, + 0x74: {l: {0x68: {l: {0x72: {l: {0x65: {l: {0x65: {l: {0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8908]}}}}}}}}}}}}}}}}}}}}} + }}}}}}, + 0x6E: {l: {0x67: {l: {0x3B: {c: [730]}}}}}, + 0x73: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x64: {l: {0x6F: {l: {0x74: {l: {0x73: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [8787]}}}}}}}}}}}}}}}}}}}}} + }}, + 0x6C: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8644]}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8652]}}}}}}}, + 0x6D: {l: {0x3B: {c: [8207]}}} + }}, + 0x6D: {l: {0x6F: {l: {0x75: {l: {0x73: {l: {0x74: {l: { + 0x61: {l: {0x63: {l: {0x68: {l: {0x65: {l: {0x3B: {c: [9137]}}}}}}}}}, + 0x3B: {c: [9137]} + }}}}}}}}}}, + 0x6E: {l: {0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [10990]}}}}}}}}}, + 0x6F: {l: { + 0x61: {l: { + 0x6E: {l: {0x67: {l: {0x3B: {c: [10221]}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8702]}}}}} + }}, + 0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10215]}}}}}}}, + 0x70: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [10630]}}}}}, + 0x66: {l: {0x3B: {c: [120163]}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10798]}}}}}}} + }}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [10805]}}}}}}}}}}} + }}, + 0x70: {l: { + 0x61: {l: {0x72: {l: { + 0x3B: {c: [41]}, + 0x67: {l: {0x74: {l: {0x3B: {c: [10644]}}}}} + }}}}, + 0x70: {l: {0x6F: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10770]}}}}}}}}}}}}} + }}, + 0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8649]}}}}}}}}}, + 0x73: {l: { + 0x61: {l: {0x71: {l: {0x75: {l: {0x6F: {l: {0x3B: {c: [8250]}}}}}}}}}, + 0x63: {l: {0x72: {l: {0x3B: {c: [120007]}}}}}, + 0x68: {l: {0x3B: {c: [8625]}}}, + 0x71: {l: { + 0x62: {l: {0x3B: {c: [93]}}}, + 0x75: {l: {0x6F: {l: { + 0x3B: {c: [8217]}, + 0x72: {l: {0x3B: {c: [8217]}}} + }}}} + }} + }}, + 0x74: {l: { + 0x68: {l: {0x72: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8908]}}}}}}}}}, + 0x69: {l: {0x6D: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [8906]}}}}}}}}}, + 0x72: {l: {0x69: {l: { + 0x3B: {c: [9657]}, + 0x65: {l: {0x3B: {c: [8885]}}}, + 0x66: {l: {0x3B: {c: [9656]}}}, + 0x6C: {l: {0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [10702]}}}}}}}}} + }}}} + }}, + 0x75: {l: {0x6C: {l: {0x75: {l: {0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10600]}}}}}}}}}}}}}, + 0x78: {l: {0x3B: {c: [8478]}}} + }}, + 0x52: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [340]}}}}}}}}}, + 0x6E: {l: {0x67: {l: {0x3B: {c: [10219]}}}}}, + 0x72: {l: {0x72: {l: { + 0x3B: {c: [8608]}, + 0x74: {l: {0x6C: {l: {0x3B: {c: [10518]}}}}} + }}}} + }}, + 0x42: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10512]}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [344]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [342]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1056]}}} + }}, + 0x65: {l: { + 0x3B: {c: [8476]}, + 0x76: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: { + 0x45: {l: { + 0x6C: {l: {0x65: {l: {0x6D: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [8715]}}}}}}}}}}}}}, + 0x71: {l: {0x75: {l: {0x69: {l: {0x6C: {l: {0x69: {l: {0x62: {l: {0x72: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x3B: {c: [8651]}}}}}}}}}}}}}}}}}}}}} + }}, + 0x55: {l: {0x70: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x69: {l: {0x6C: {l: {0x69: {l: {0x62: {l: {0x72: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x3B: {c: [10607]}}}}}}}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}} + }}, + 0x45: {l: {0x47: { + l: {0x3B: {c: [174]}}, + c: [174] + }}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [8476]}}}}}, + 0x68: {l: {0x6F: {l: {0x3B: {c: [929]}}}}}, + 0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x41: {l: { + 0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: {0x42: {l: {0x72: {l: {0x61: {l: {0x63: {l: {0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [10217]}}}}}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8677]}}}}}}}, + 0x3B: {c: [8594]}, + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8644]}}}}}}}}}}}}}}}}}}} + }}}}}}}} + }}, + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8658]}}}}}}}}}}}, + 0x43: {l: {0x65: {l: {0x69: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [8969]}}}}}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: { + 0x75: {l: {0x62: {l: {0x6C: {l: {0x65: {l: {0x42: {l: {0x72: {l: {0x61: {l: {0x63: {l: {0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [10215]}}}}}}}}}}}}}}}}}}}}}}}, + 0x77: {l: {0x6E: {l: { + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10589]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10581]}}}}}}}, + 0x3B: {c: [8642]} + }}}}}}}}}}}} + }}}} + }}}}, + 0x46: {l: {0x6C: {l: {0x6F: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [8971]}}}}}}}}}}}, + 0x54: {l: { + 0x65: {l: {0x65: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8614]}}}}}}}}}}}, + 0x3B: {c: [8866]}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10587]}}}}}}}}}}}}} + }}}}, + 0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10704]}}}}}}}, + 0x3B: {c: [8883]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8885]}}}}}}}}}}} + }}}}}}}}}}}}}} + }}, + 0x55: {l: {0x70: {l: { + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10575]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x65: {l: {0x65: {l: {0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10588]}}}}}}}}}}}}}}}}}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10580]}}}}}}}, + 0x3B: {c: [8638]} + }}}}}}}}}}}} + }}}}, + 0x56: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x6F: {l: {0x72: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10579]}}}}}}}, + 0x3B: {c: [8640]} + }}}}}}}}}}}} + }}}}}}}}, + 0x6F: {l: { + 0x70: {l: {0x66: {l: {0x3B: {c: [8477]}}}}}, + 0x75: {l: {0x6E: {l: {0x64: {l: {0x49: {l: {0x6D: {l: {0x70: {l: {0x6C: {l: {0x69: {l: {0x65: {l: {0x73: {l: {0x3B: {c: [10608]}}}}}}}}}}}}}}}}}}}}} + }}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8667]}}}}}}}}}}}}}}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [8475]}}}}}, + 0x68: {l: {0x3B: {c: [8625]}}} + }}, + 0x75: {l: {0x6C: {l: {0x65: {l: {0x44: {l: {0x65: {l: {0x6C: {l: {0x61: {l: {0x79: {l: {0x65: {l: {0x64: {l: {0x3B: {c: [10740]}}}}}}}}}}}}}}}}}}}}} + }}, + 0x53: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [346]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [352]}}}}}}}}}, + 0x3B: {c: [10940]}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [350]}}}}}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [348]}}}}}}}, + 0x79: {l: {0x3B: {c: [1057]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120086]}}}}}, + 0x48: {l: { + 0x43: {l: {0x48: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1065]}}}}}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1064]}}}}} + }}, + 0x68: {l: {0x6F: {l: {0x72: {l: {0x74: {l: { + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8595]}}}}}}}}}}}}}}}}}}}, + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8592]}}}}}}}}}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8594]}}}}}}}}}}}}}}}}}}}}}, + 0x55: {l: {0x70: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8593]}}}}}}}}}}}}}}} + }}}}}}}}, + 0x69: {l: {0x67: {l: {0x6D: {l: {0x61: {l: {0x3B: {c: [931]}}}}}}}}}, + 0x6D: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x43: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [8728]}}}}}}}}}}}}}}}}}}}}}, + 0x4F: {l: {0x46: {l: {0x54: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1068]}}}}}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120138]}}}}}}}, + 0x71: {l: { + 0x72: {l: {0x74: {l: {0x3B: {c: [8730]}}}}}, + 0x75: {l: {0x61: {l: {0x72: {l: {0x65: {l: { + 0x3B: {c: [9633]}, + 0x49: {l: {0x6E: {l: {0x74: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x63: {l: {0x74: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8851]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x53: {l: {0x75: {l: { + 0x62: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8847]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8849]}}}}}}}}}}} + }}}}}}}}, + 0x70: {l: {0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8848]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8850]}}}}}}}}}}} + }}}}}}}}}}}} + }}}}, + 0x55: {l: {0x6E: {l: {0x69: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [8852]}}}}}}}}}}} + }}}}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119982]}}}}}}}, + 0x74: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8902]}}}}}}}, + 0x75: {l: { + 0x62: {l: { + 0x3B: {c: [8912]}, + 0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8912]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8838]}}}}}}}}}}} + }}}}}} + }}, + 0x63: {l: { + 0x63: {l: {0x65: {l: {0x65: {l: {0x64: {l: {0x73: {l: { + 0x3B: {c: [8827]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [10928]}}}}}}}}}}}, + 0x53: {l: {0x6C: {l: {0x61: {l: {0x6E: {l: {0x74: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8829]}}}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8831]}}}}}}}}}}} + }}}}}}}}}}, + 0x68: {l: {0x54: {l: {0x68: {l: {0x61: {l: {0x74: {l: {0x3B: {c: [8715]}}}}}}}}}}} + }}, + 0x6D: {l: {0x3B: {c: [8721]}}}, + 0x70: {l: { + 0x3B: {c: [8913]}, + 0x65: {l: {0x72: {l: {0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8835]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8839]}}}}}}}}}}} + }}}}}}}}}}, + 0x73: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [8913]}}}}}}} + }} + }} + }}, + 0x73: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [347]}}}}}}}}}}}, + 0x62: {l: {0x71: {l: {0x75: {l: {0x6F: {l: {0x3B: {c: [8218]}}}}}}}}}, + 0x63: {l: { + 0x61: {l: { + 0x70: {l: {0x3B: {c: [10936]}}}, + 0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [353]}}}}}}} + }}, + 0x3B: {c: [8827]}, + 0x63: {l: {0x75: {l: {0x65: {l: {0x3B: {c: [8829]}}}}}}}, + 0x65: {l: { + 0x3B: {c: [10928]}, + 0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [351]}}}}}}} + }}, + 0x45: {l: {0x3B: {c: [10932]}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [349]}}}}}}}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [10938]}}}}}, + 0x45: {l: {0x3B: {c: [10934]}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8937]}}}}}}} + }}, + 0x70: {l: {0x6F: {l: {0x6C: {l: {0x69: {l: {0x6E: {l: {0x74: {l: {0x3B: {c: [10771]}}}}}}}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8831]}}}}}}}, + 0x79: {l: {0x3B: {c: [1089]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: { + 0x62: {l: {0x3B: {c: [8865]}}}, + 0x3B: {c: [8901]}, + 0x65: {l: {0x3B: {c: [10854]}}} + }}}}}}, + 0x65: {l: { + 0x61: {l: {0x72: {l: { + 0x68: {l: {0x6B: {l: {0x3B: {c: [10533]}}}}}, + 0x72: {l: { + 0x3B: {c: [8600]}, + 0x6F: {l: {0x77: {l: {0x3B: {c: [8600]}}}}} + }} + }}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8664]}}}}}}}, + 0x63: {l: {0x74: { + l: {0x3B: {c: [167]}}, + c: [167] + }}}, + 0x6D: {l: {0x69: {l: {0x3B: {c: [59]}}}}}, + 0x73: {l: {0x77: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10537]}}}}}}}}}, + 0x74: {l: {0x6D: {l: { + 0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8726]}}}}}}}}}, + 0x6E: {l: {0x3B: {c: [8726]}}} + }}}}, + 0x78: {l: {0x74: {l: {0x3B: {c: [10038]}}}}} + }}, + 0x66: {l: {0x72: {l: { + 0x3B: {c: [120112]}, + 0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [8994]}}}}}}} + }}}}, + 0x68: {l: { + 0x61: {l: {0x72: {l: {0x70: {l: {0x3B: {c: [9839]}}}}}}}, + 0x63: {l: { + 0x68: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1097]}}}}}}}, + 0x79: {l: {0x3B: {c: [1096]}}} + }}, + 0x6F: {l: {0x72: {l: {0x74: {l: { + 0x6D: {l: {0x69: {l: {0x64: {l: {0x3B: {c: [8739]}}}}}}}, + 0x70: {l: {0x61: {l: {0x72: {l: {0x61: {l: {0x6C: {l: {0x6C: {l: {0x65: {l: {0x6C: {l: {0x3B: {c: [8741]}}}}}}}}}}}}}}}}} + }}}}}}, + 0x79: { + l: {0x3B: {c: [173]}}, + c: [173] + } + }}, + 0x69: {l: { + 0x67: {l: {0x6D: {l: {0x61: {l: { + 0x3B: {c: [963]}, + 0x66: {l: {0x3B: {c: [962]}}}, + 0x76: {l: {0x3B: {c: [962]}}} + }}}}}}, + 0x6D: {l: { + 0x3B: {c: [8764]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10858]}}}}}}}, + 0x65: {l: { + 0x3B: {c: [8771]}, + 0x71: {l: {0x3B: {c: [8771]}}} + }}, + 0x67: {l: { + 0x3B: {c: [10910]}, + 0x45: {l: {0x3B: {c: [10912]}}} + }}, + 0x6C: {l: { + 0x3B: {c: [10909]}, + 0x45: {l: {0x3B: {c: [10911]}}} + }}, + 0x6E: {l: {0x65: {l: {0x3B: {c: [8774]}}}}}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10788]}}}}}}}}}, + 0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10610]}}}}}}}}} + }} + }}, + 0x6C: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8592]}}}}}}}}}, + 0x6D: {l: { + 0x61: {l: { + 0x6C: {l: {0x6C: {l: {0x73: {l: {0x65: {l: {0x74: {l: {0x6D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8726]}}}}}}}}}}}}}}}}}}}}}, + 0x73: {l: {0x68: {l: {0x70: {l: {0x3B: {c: [10803]}}}}}}} + }}, + 0x65: {l: {0x70: {l: {0x61: {l: {0x72: {l: {0x73: {l: {0x6C: {l: {0x3B: {c: [10724]}}}}}}}}}}}}}, + 0x69: {l: { + 0x64: {l: {0x3B: {c: [8739]}}}, + 0x6C: {l: {0x65: {l: {0x3B: {c: [8995]}}}}} + }}, + 0x74: {l: { + 0x3B: {c: [10922]}, + 0x65: {l: { + 0x3B: {c: [10924]}, + 0x73: {l: {0x3B: {c: [10924, 65024]}}} + }} + }} + }}, + 0x6F: {l: { + 0x66: {l: {0x74: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1100]}}}}}}}}}, + 0x6C: {l: { + 0x62: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [9023]}}}}}, + 0x3B: {c: [10692]} + }}, + 0x3B: {c: [47]} + }}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120164]}}}}} + }}, + 0x70: {l: {0x61: {l: { + 0x64: {l: {0x65: {l: {0x73: {l: { + 0x3B: {c: [9824]}, + 0x75: {l: {0x69: {l: {0x74: {l: {0x3B: {c: [9824]}}}}}}} + }}}}}}, + 0x72: {l: {0x3B: {c: [8741]}}} + }}}}, + 0x71: {l: { + 0x63: {l: { + 0x61: {l: {0x70: {l: { + 0x3B: {c: [8851]}, + 0x73: {l: {0x3B: {c: [8851, 65024]}}} + }}}}, + 0x75: {l: {0x70: {l: { + 0x3B: {c: [8852]}, + 0x73: {l: {0x3B: {c: [8852, 65024]}}} + }}}} + }}, + 0x73: {l: {0x75: {l: { + 0x62: {l: { + 0x3B: {c: [8847]}, + 0x65: {l: {0x3B: {c: [8849]}}}, + 0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8847]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8849]}}}}} + }}}}}} + }}, + 0x70: {l: { + 0x3B: {c: [8848]}, + 0x65: {l: {0x3B: {c: [8850]}}}, + 0x73: {l: {0x65: {l: {0x74: {l: { + 0x3B: {c: [8848]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8850]}}}}} + }}}}}} + }} + }}}}, + 0x75: {l: { + 0x61: {l: {0x72: {l: { + 0x65: {l: {0x3B: {c: [9633]}}}, + 0x66: {l: {0x3B: {c: [9642]}}} + }}}}, + 0x3B: {c: [9633]}, + 0x66: {l: {0x3B: {c: [9642]}}} + }} + }}, + 0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8594]}}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [120008]}}}}}, + 0x65: {l: {0x74: {l: {0x6D: {l: {0x6E: {l: {0x3B: {c: [8726]}}}}}}}}}, + 0x6D: {l: {0x69: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [8995]}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8902]}}}}}}}}} + }}, + 0x74: {l: { + 0x61: {l: {0x72: {l: { + 0x3B: {c: [9734]}, + 0x66: {l: {0x3B: {c: [9733]}}} + }}}}, + 0x72: {l: { + 0x61: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x65: {l: {0x70: {l: {0x73: {l: {0x69: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [1013]}}}}}}}}}}}}}}}, + 0x70: {l: {0x68: {l: {0x69: {l: {0x3B: {c: [981]}}}}}}} + }}}}}}}}}}, + 0x6E: {l: {0x73: {l: {0x3B: {c: [175]}}}}} + }} + }}, + 0x75: {l: { + 0x62: {l: { + 0x3B: {c: [8834]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10941]}}}}}}}, + 0x45: {l: {0x3B: {c: [10949]}}}, + 0x65: {l: { + 0x3B: {c: [8838]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10947]}}}}}}} + }}, + 0x6D: {l: {0x75: {l: {0x6C: {l: {0x74: {l: {0x3B: {c: [10945]}}}}}}}}}, + 0x6E: {l: { + 0x45: {l: {0x3B: {c: [10955]}}}, + 0x65: {l: {0x3B: {c: [8842]}}} + }}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10943]}}}}}}}}}, + 0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10617]}}}}}}}}}, + 0x73: {l: { + 0x65: {l: {0x74: {l: { + 0x3B: {c: [8834]}, + 0x65: {l: {0x71: {l: { + 0x3B: {c: [8838]}, + 0x71: {l: {0x3B: {c: [10949]}}} + }}}}, + 0x6E: {l: {0x65: {l: {0x71: {l: { + 0x3B: {c: [8842]}, + 0x71: {l: {0x3B: {c: [10955]}}} + }}}}}} + }}}}, + 0x69: {l: {0x6D: {l: {0x3B: {c: [10951]}}}}}, + 0x75: {l: { + 0x62: {l: {0x3B: {c: [10965]}}}, + 0x70: {l: {0x3B: {c: [10963]}}} + }} + }} + }}, + 0x63: {l: {0x63: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10936]}}}}}}}}}}}}}, + 0x3B: {c: [8827]}, + 0x63: {l: {0x75: {l: {0x72: {l: {0x6C: {l: {0x79: {l: {0x65: {l: {0x71: {l: {0x3B: {c: [8829]}}}}}}}}}}}}}}}, + 0x65: {l: {0x71: {l: {0x3B: {c: [10928]}}}}}, + 0x6E: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [10938]}}}}}}}}}}}}}, + 0x65: {l: {0x71: {l: {0x71: {l: {0x3B: {c: [10934]}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8937]}}}}}}} + }}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8831]}}}}}}} + }}}}, + 0x6D: {l: {0x3B: {c: [8721]}}}, + 0x6E: {l: {0x67: {l: {0x3B: {c: [9834]}}}}}, + 0x70: {l: { + 0x31: { + l: {0x3B: {c: [185]}}, + c: [185] + }, + 0x32: { + l: {0x3B: {c: [178]}}, + c: [178] + }, + 0x33: { + l: {0x3B: {c: [179]}}, + c: [179] + }, + 0x3B: {c: [8835]}, + 0x64: {l: { + 0x6F: {l: {0x74: {l: {0x3B: {c: [10942]}}}}}, + 0x73: {l: {0x75: {l: {0x62: {l: {0x3B: {c: [10968]}}}}}}} + }}, + 0x45: {l: {0x3B: {c: [10950]}}}, + 0x65: {l: { + 0x3B: {c: [8839]}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10948]}}}}}}} + }}, + 0x68: {l: {0x73: {l: { + 0x6F: {l: {0x6C: {l: {0x3B: {c: [10185]}}}}}, + 0x75: {l: {0x62: {l: {0x3B: {c: [10967]}}}}} + }}}}, + 0x6C: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10619]}}}}}}}}}, + 0x6D: {l: {0x75: {l: {0x6C: {l: {0x74: {l: {0x3B: {c: [10946]}}}}}}}}}, + 0x6E: {l: { + 0x45: {l: {0x3B: {c: [10956]}}}, + 0x65: {l: {0x3B: {c: [8843]}}} + }}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10944]}}}}}}}}}, + 0x73: {l: { + 0x65: {l: {0x74: {l: { + 0x3B: {c: [8835]}, + 0x65: {l: {0x71: {l: { + 0x3B: {c: [8839]}, + 0x71: {l: {0x3B: {c: [10950]}}} + }}}}, + 0x6E: {l: {0x65: {l: {0x71: {l: { + 0x3B: {c: [8843]}, + 0x71: {l: {0x3B: {c: [10956]}}} + }}}}}} + }}}}, + 0x69: {l: {0x6D: {l: {0x3B: {c: [10952]}}}}}, + 0x75: {l: { + 0x62: {l: {0x3B: {c: [10964]}}}, + 0x70: {l: {0x3B: {c: [10966]}}} + }} + }} + }} + }}, + 0x77: {l: { + 0x61: {l: {0x72: {l: { + 0x68: {l: {0x6B: {l: {0x3B: {c: [10534]}}}}}, + 0x72: {l: { + 0x3B: {c: [8601]}, + 0x6F: {l: {0x77: {l: {0x3B: {c: [8601]}}}}} + }} + }}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8665]}}}}}}}, + 0x6E: {l: {0x77: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10538]}}}}}}}}} + }}, + 0x7A: {l: {0x6C: {l: {0x69: {l: {0x67: { + l: {0x3B: {c: [223]}}, + c: [223] + }}}}}}} + }}, + 0x54: {l: { + 0x61: {l: { + 0x62: {l: {0x3B: {c: [9]}}}, + 0x75: {l: {0x3B: {c: [932]}}} + }}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [356]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [354]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1058]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120087]}}}}}, + 0x68: {l: { + 0x65: {l: { + 0x72: {l: {0x65: {l: {0x66: {l: {0x6F: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [8756]}}}}}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [920]}}}}} + }}, + 0x69: {l: { + 0x63: {l: {0x6B: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8287, 8202]}}}}}}}}}}}}}}}, + 0x6E: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8201]}}}}}}}}}}}}} + }} + }}, + 0x48: {l: {0x4F: {l: {0x52: {l: {0x4E: { + l: {0x3B: {c: [222]}}, + c: [222] + }}}}}}}, + 0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: { + 0x3B: {c: [8764]}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8771]}}}}}}}}}}}, + 0x46: {l: {0x75: {l: {0x6C: {l: {0x6C: {l: {0x45: {l: {0x71: {l: {0x75: {l: {0x61: {l: {0x6C: {l: {0x3B: {c: [8773]}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8776]}}}}}}}}}}} + }}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120139]}}}}}}}, + 0x52: {l: {0x41: {l: {0x44: {l: {0x45: {l: {0x3B: {c: [8482]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x70: {l: {0x6C: {l: {0x65: {l: {0x44: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8411]}}}}}}}}}}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [119983]}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [358]}}}}}}}}} + }}, + 0x53: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1062]}}}}}, + 0x48: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1035]}}}}}}} + }} + }}, + 0x74: {l: { + 0x61: {l: { + 0x72: {l: {0x67: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [8982]}}}}}}}}}, + 0x75: {l: {0x3B: {c: [964]}}} + }}, + 0x62: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [9140]}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [357]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x69: {l: {0x6C: {l: {0x3B: {c: [355]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1090]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8411]}}}}}}}, + 0x65: {l: {0x6C: {l: {0x72: {l: {0x65: {l: {0x63: {l: {0x3B: {c: [8981]}}}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120113]}}}}}, + 0x68: {l: { + 0x65: {l: { + 0x72: {l: {0x65: {l: { + 0x34: {l: {0x3B: {c: [8756]}}}, + 0x66: {l: {0x6F: {l: {0x72: {l: {0x65: {l: {0x3B: {c: [8756]}}}}}}}}} + }}}}, + 0x74: {l: {0x61: {l: { + 0x3B: {c: [952]}, + 0x73: {l: {0x79: {l: {0x6D: {l: {0x3B: {c: [977]}}}}}}}, + 0x76: {l: {0x3B: {c: [977]}}} + }}}} + }}, + 0x69: {l: { + 0x63: {l: {0x6B: {l: { + 0x61: {l: {0x70: {l: {0x70: {l: {0x72: {l: {0x6F: {l: {0x78: {l: {0x3B: {c: [8776]}}}}}}}}}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8764]}}}}}}} + }}}}, + 0x6E: {l: {0x73: {l: {0x70: {l: {0x3B: {c: [8201]}}}}}}} + }}, + 0x6B: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [8776]}}}}}, + 0x73: {l: {0x69: {l: {0x6D: {l: {0x3B: {c: [8764]}}}}}}} + }}, + 0x6F: {l: {0x72: {l: {0x6E: { + l: {0x3B: {c: [254]}}, + c: [254] + }}}}} + }}, + 0x69: {l: { + 0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [732]}}}}}}}, + 0x6D: {l: {0x65: {l: {0x73: { + l: { + 0x62: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [10801]}}}}}, + 0x3B: {c: [8864]} + }}, + 0x3B: {c: [215]}, + 0x64: {l: {0x3B: {c: [10800]}}} + }, + c: [215] + }}}}}, + 0x6E: {l: {0x74: {l: {0x3B: {c: [8749]}}}}} + }}, + 0x6F: {l: { + 0x65: {l: {0x61: {l: {0x3B: {c: [10536]}}}}}, + 0x70: {l: { + 0x62: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [9014]}}}}}}}, + 0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10993]}}}}}}}, + 0x3B: {c: [8868]}, + 0x66: {l: { + 0x3B: {c: [120165]}, + 0x6F: {l: {0x72: {l: {0x6B: {l: {0x3B: {c: [10970]}}}}}}} + }} + }}, + 0x73: {l: {0x61: {l: {0x3B: {c: [10537]}}}}} + }}, + 0x70: {l: {0x72: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [8244]}}}}}}}}}}}, + 0x72: {l: { + 0x61: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8482]}}}}}}}, + 0x69: {l: { + 0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x3B: {c: [9653]}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x3B: {c: [9663]}}}}}}}}}, + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: { + 0x3B: {c: [9667]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8884]}}}}} + }}}}}}}}, + 0x71: {l: {0x3B: {c: [8796]}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: { + 0x3B: {c: [9657]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8885]}}}}} + }}}}}}}}}} + }}}}}}}}}}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [9708]}}}}}}}, + 0x65: {l: {0x3B: {c: [8796]}}}, + 0x6D: {l: {0x69: {l: {0x6E: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10810]}}}}}}}}}}}, + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10809]}}}}}}}}}, + 0x73: {l: {0x62: {l: {0x3B: {c: [10701]}}}}}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [10811]}}}}}}}}} + }}, + 0x70: {l: {0x65: {l: {0x7A: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x3B: {c: [9186]}}}}}}}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: { + 0x72: {l: {0x3B: {c: [120009]}}}, + 0x79: {l: {0x3B: {c: [1094]}}} + }}, + 0x68: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1115]}}}}}}}, + 0x74: {l: {0x72: {l: {0x6F: {l: {0x6B: {l: {0x3B: {c: [359]}}}}}}}}} + }}, + 0x77: {l: { + 0x69: {l: {0x78: {l: {0x74: {l: {0x3B: {c: [8812]}}}}}}}, + 0x6F: {l: {0x68: {l: {0x65: {l: {0x61: {l: {0x64: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8606]}}}}}}}}}}}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8608]}}}}}}}}}}}}}}}}}}}}} + }}}}}}}}}} + }} + }}, + 0x55: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [218]}}, + c: [218] + }}}}}}}, + 0x72: {l: {0x72: {l: { + 0x3B: {c: [8607]}, + 0x6F: {l: {0x63: {l: {0x69: {l: {0x72: {l: {0x3B: {c: [10569]}}}}}}}}} + }}}} + }}, + 0x62: {l: {0x72: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1038]}}}}}, + 0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [364]}}}}}}} + }}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [219]}}, + c: [219] + }}}}}, + 0x79: {l: {0x3B: {c: [1059]}}} + }}, + 0x64: {l: {0x62: {l: {0x6C: {l: {0x61: {l: {0x63: {l: {0x3B: {c: [368]}}}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120088]}}}}}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [217]}}, + c: [217] + }}}}}}}}}, + 0x6D: {l: {0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [362]}}}}}}}}}, + 0x6E: {l: { + 0x64: {l: {0x65: {l: {0x72: {l: { + 0x42: {l: { + 0x61: {l: {0x72: {l: {0x3B: {c: [95]}}}}}, + 0x72: {l: {0x61: {l: {0x63: {l: { + 0x65: {l: {0x3B: {c: [9183]}}}, + 0x6B: {l: {0x65: {l: {0x74: {l: {0x3B: {c: [9141]}}}}}}} + }}}}}} + }}, + 0x50: {l: {0x61: {l: {0x72: {l: {0x65: {l: {0x6E: {l: {0x74: {l: {0x68: {l: {0x65: {l: {0x73: {l: {0x69: {l: {0x73: {l: {0x3B: {c: [9181]}}}}}}}}}}}}}}}}}}}}}}} + }}}}}}, + 0x69: {l: {0x6F: {l: {0x6E: {l: { + 0x3B: {c: [8899]}, + 0x50: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8846]}}}}}}}}} + }}}}}} + }}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [370]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120140]}}}}} + }}, + 0x70: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10514]}}}}}}}, + 0x3B: {c: [8593]}, + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8645]}}}}}}}}}}}}}}}}}}} + }}}}}}}}}}, + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8657]}}}}}}}}}}}, + 0x44: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8597]}}}}}}}}}}}}}}}}}}}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8661]}}}}}}}}}}}}}}}}}}}, + 0x45: {l: {0x71: {l: {0x75: {l: {0x69: {l: {0x6C: {l: {0x69: {l: {0x62: {l: {0x72: {l: {0x69: {l: {0x75: {l: {0x6D: {l: {0x3B: {c: [10606]}}}}}}}}}}}}}}}}}}}}}}}, + 0x70: {l: {0x65: {l: {0x72: {l: { + 0x4C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8598]}}}}}}}}}}}}}}}}}}}, + 0x52: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8599]}}}}}}}}}}}}}}}}}}}}} + }}}}}}, + 0x73: {l: {0x69: {l: { + 0x3B: {c: [978]}, + 0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [933]}}}}}}} + }}}}, + 0x54: {l: {0x65: {l: {0x65: {l: { + 0x41: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8613]}}}}}}}}}}}, + 0x3B: {c: [8869]} + }}}}}} + }}, + 0x72: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [366]}}}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119984]}}}}}}}, + 0x74: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [360]}}}}}}}}}}}, + 0x75: {l: {0x6D: {l: {0x6C: { + l: {0x3B: {c: [220]}}, + c: [220] + }}}}} + }}, + 0x75: {l: { + 0x61: {l: { + 0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [250]}}, + c: [250] + }}}}}}}, + 0x72: {l: {0x72: {l: {0x3B: {c: [8593]}}}}} + }}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8657]}}}}}}}, + 0x62: {l: {0x72: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1118]}}}}}, + 0x65: {l: {0x76: {l: {0x65: {l: {0x3B: {c: [365]}}}}}}} + }}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: { + l: {0x3B: {c: [251]}}, + c: [251] + }}}}}, + 0x79: {l: {0x3B: {c: [1091]}}} + }}, + 0x64: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8645]}}}}}}}, + 0x62: {l: {0x6C: {l: {0x61: {l: {0x63: {l: {0x3B: {c: [369]}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10606]}}}}}}} + }}, + 0x66: {l: { + 0x69: {l: {0x73: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [10622]}}}}}}}}}, + 0x72: {l: {0x3B: {c: [120114]}}} + }}, + 0x67: {l: {0x72: {l: {0x61: {l: {0x76: {l: {0x65: { + l: {0x3B: {c: [249]}}, + c: [249] + }}}}}}}}}, + 0x48: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10595]}}}}}}}, + 0x68: {l: { + 0x61: {l: {0x72: {l: { + 0x6C: {l: {0x3B: {c: [8639]}}}, + 0x72: {l: {0x3B: {c: [8638]}}} + }}}}, + 0x62: {l: {0x6C: {l: {0x6B: {l: {0x3B: {c: [9600]}}}}}}} + }}, + 0x6C: {l: { + 0x63: {l: { + 0x6F: {l: {0x72: {l: {0x6E: {l: { + 0x3B: {c: [8988]}, + 0x65: {l: {0x72: {l: {0x3B: {c: [8988]}}}}} + }}}}}}, + 0x72: {l: {0x6F: {l: {0x70: {l: {0x3B: {c: [8975]}}}}}}} + }}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [9720]}}}}}}} + }}, + 0x6D: {l: { + 0x61: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [363]}}}}}}}, + 0x6C: { + l: {0x3B: {c: [168]}}, + c: [168] + } + }}, + 0x6F: {l: { + 0x67: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [371]}}}}}}}, + 0x70: {l: {0x66: {l: {0x3B: {c: [120166]}}}}} + }}, + 0x70: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8593]}}}}}}}}}}}, + 0x64: {l: {0x6F: {l: {0x77: {l: {0x6E: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x3B: {c: [8597]}}}}}}}}}}}}}}}}}}}, + 0x68: {l: {0x61: {l: {0x72: {l: {0x70: {l: {0x6F: {l: {0x6F: {l: {0x6E: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8639]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8638]}}}}}}}}}}} + }}}}}}}}}}}}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [8846]}}}}}}}, + 0x73: {l: {0x69: {l: { + 0x3B: {c: [965]}, + 0x68: {l: {0x3B: {c: [978]}}}, + 0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [965]}}}}}}} + }}}}, + 0x75: {l: {0x70: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x6F: {l: {0x77: {l: {0x73: {l: {0x3B: {c: [8648]}}}}}}}}}}}}}}}}} + }}, + 0x72: {l: { + 0x63: {l: { + 0x6F: {l: {0x72: {l: {0x6E: {l: { + 0x3B: {c: [8989]}, + 0x65: {l: {0x72: {l: {0x3B: {c: [8989]}}}}} + }}}}}}, + 0x72: {l: {0x6F: {l: {0x70: {l: {0x3B: {c: [8974]}}}}}}} + }}, + 0x69: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [367]}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [9721]}}}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120010]}}}}}}}, + 0x74: {l: { + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [8944]}}}}}}}, + 0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [361]}}}}}}}}}, + 0x72: {l: {0x69: {l: { + 0x3B: {c: [9653]}, + 0x66: {l: {0x3B: {c: [9652]}}} + }}}} + }}, + 0x75: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8648]}}}}}}}, + 0x6D: {l: {0x6C: { + l: {0x3B: {c: [252]}}, + c: [252] + }}} + }}, + 0x77: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: {0x3B: {c: [10663]}}}}}}}}}}}}} + }}, + 0x76: {l: { + 0x61: {l: { + 0x6E: {l: {0x67: {l: {0x72: {l: {0x74: {l: {0x3B: {c: [10652]}}}}}}}}}, + 0x72: {l: { + 0x65: {l: {0x70: {l: {0x73: {l: {0x69: {l: {0x6C: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [1013]}}}}}}}}}}}}}}}, + 0x6B: {l: {0x61: {l: {0x70: {l: {0x70: {l: {0x61: {l: {0x3B: {c: [1008]}}}}}}}}}}}, + 0x6E: {l: {0x6F: {l: {0x74: {l: {0x68: {l: {0x69: {l: {0x6E: {l: {0x67: {l: {0x3B: {c: [8709]}}}}}}}}}}}}}}}, + 0x70: {l: { + 0x68: {l: {0x69: {l: {0x3B: {c: [981]}}}}}, + 0x69: {l: {0x3B: {c: [982]}}}, + 0x72: {l: {0x6F: {l: {0x70: {l: {0x74: {l: {0x6F: {l: {0x3B: {c: [8733]}}}}}}}}}}} + }}, + 0x72: {l: { + 0x3B: {c: [8597]}, + 0x68: {l: {0x6F: {l: {0x3B: {c: [1009]}}}}} + }}, + 0x73: {l: { + 0x69: {l: {0x67: {l: {0x6D: {l: {0x61: {l: {0x3B: {c: [962]}}}}}}}}}, + 0x75: {l: { + 0x62: {l: {0x73: {l: {0x65: {l: {0x74: {l: {0x6E: {l: {0x65: {l: {0x71: {l: { + 0x3B: {c: [8842, 65024]}, + 0x71: {l: {0x3B: {c: [10955, 65024]}}} + }}}}}}}}}}}}}}, + 0x70: {l: {0x73: {l: {0x65: {l: {0x74: {l: {0x6E: {l: {0x65: {l: {0x71: {l: { + 0x3B: {c: [8843, 65024]}, + 0x71: {l: {0x3B: {c: [10956, 65024]}}} + }}}}}}}}}}}}}} + }} + }}, + 0x74: {l: { + 0x68: {l: {0x65: {l: {0x74: {l: {0x61: {l: {0x3B: {c: [977]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x61: {l: {0x6E: {l: {0x67: {l: {0x6C: {l: {0x65: {l: { + 0x6C: {l: {0x65: {l: {0x66: {l: {0x74: {l: {0x3B: {c: [8882]}}}}}}}}}, + 0x72: {l: {0x69: {l: {0x67: {l: {0x68: {l: {0x74: {l: {0x3B: {c: [8883]}}}}}}}}}}} + }}}}}}}}}}}}}} + }} + }} + }}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8661]}}}}}}}, + 0x42: {l: {0x61: {l: {0x72: {l: { + 0x3B: {c: [10984]}, + 0x76: {l: {0x3B: {c: [10985]}}} + }}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1074]}}}}}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8866]}}}}}}}}}, + 0x44: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8872]}}}}}}}}}, + 0x65: {l: { + 0x65: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8891]}}}}}}}, + 0x3B: {c: [8744]}, + 0x65: {l: {0x71: {l: {0x3B: {c: [8794]}}}}} + }}, + 0x6C: {l: {0x6C: {l: {0x69: {l: {0x70: {l: {0x3B: {c: [8942]}}}}}}}}}, + 0x72: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [124]}}}}}}}, + 0x74: {l: {0x3B: {c: [124]}}} + }} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120115]}}}}}, + 0x6C: {l: {0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [8882]}}}}}}}}}, + 0x6E: {l: {0x73: {l: {0x75: {l: { + 0x62: {l: {0x3B: {c: [8834, 8402]}}}, + 0x70: {l: {0x3B: {c: [8835, 8402]}}} + }}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120167]}}}}}}}, + 0x70: {l: {0x72: {l: {0x6F: {l: {0x70: {l: {0x3B: {c: [8733]}}}}}}}}}, + 0x72: {l: {0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [8883]}}}}}}}}}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [120011]}}}}}, + 0x75: {l: { + 0x62: {l: {0x6E: {l: { + 0x45: {l: {0x3B: {c: [10955, 65024]}}}, + 0x65: {l: {0x3B: {c: [8842, 65024]}}} + }}}}, + 0x70: {l: {0x6E: {l: { + 0x45: {l: {0x3B: {c: [10956, 65024]}}}, + 0x65: {l: {0x3B: {c: [8843, 65024]}}} + }}}} + }} + }}, + 0x7A: {l: {0x69: {l: {0x67: {l: {0x7A: {l: {0x61: {l: {0x67: {l: {0x3B: {c: [10650]}}}}}}}}}}}}} + }}, + 0x56: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10987]}}}}}}}, + 0x63: {l: {0x79: {l: {0x3B: {c: [1042]}}}}}, + 0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: { + 0x3B: {c: [8873]}, + 0x6C: {l: {0x3B: {c: [10982]}}} + }}}}}}}}, + 0x44: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8875]}}}}}}}}}, + 0x65: {l: { + 0x65: {l: {0x3B: {c: [8897]}}}, + 0x72: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8214]}}}}}}}, + 0x74: {l: { + 0x3B: {c: [8214]}, + 0x69: {l: {0x63: {l: {0x61: {l: {0x6C: {l: { + 0x42: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [8739]}}}}}}}, + 0x4C: {l: {0x69: {l: {0x6E: {l: {0x65: {l: {0x3B: {c: [124]}}}}}}}}}, + 0x53: {l: {0x65: {l: {0x70: {l: {0x61: {l: {0x72: {l: {0x61: {l: {0x74: {l: {0x6F: {l: {0x72: {l: {0x3B: {c: [10072]}}}}}}}}}}}}}}}}}}}, + 0x54: {l: {0x69: {l: {0x6C: {l: {0x64: {l: {0x65: {l: {0x3B: {c: [8768]}}}}}}}}}}} + }}}}}}}} + }}, + 0x79: {l: {0x54: {l: {0x68: {l: {0x69: {l: {0x6E: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8202]}}}}}}}}}}}}}}}}}}}}} + }} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120089]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120141]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119985]}}}}}}}, + 0x76: {l: {0x64: {l: {0x61: {l: {0x73: {l: {0x68: {l: {0x3B: {c: [8874]}}}}}}}}}}} + }}, + 0x57: {l: { + 0x63: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [372]}}}}}}}}}, + 0x65: {l: {0x64: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [8896]}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120090]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120142]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119986]}}}}}}} + }}, + 0x77: {l: { + 0x63: {l: {0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [373]}}}}}}}}}, + 0x65: {l: { + 0x64: {l: { + 0x62: {l: {0x61: {l: {0x72: {l: {0x3B: {c: [10847]}}}}}}}, + 0x67: {l: {0x65: {l: { + 0x3B: {c: [8743]}, + 0x71: {l: {0x3B: {c: [8793]}}} + }}}} + }}, + 0x69: {l: {0x65: {l: {0x72: {l: {0x70: {l: {0x3B: {c: [8472]}}}}}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120116]}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120168]}}}}}}}, + 0x70: {l: {0x3B: {c: [8472]}}}, + 0x72: {l: { + 0x3B: {c: [8768]}, + 0x65: {l: {0x61: {l: {0x74: {l: {0x68: {l: {0x3B: {c: [8768]}}}}}}}}} + }}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120012]}}}}}}} + }}, + 0x78: {l: { + 0x63: {l: { + 0x61: {l: {0x70: {l: {0x3B: {c: [8898]}}}}}, + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [9711]}}}}}}}, + 0x75: {l: {0x70: {l: {0x3B: {c: [8899]}}}}} + }}, + 0x64: {l: {0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [9661]}}}}}}}}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120117]}}}}}, + 0x68: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10231]}}}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10234]}}}}}}} + }}, + 0x69: {l: {0x3B: {c: [958]}}}, + 0x6C: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10229]}}}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10232]}}}}}}} + }}, + 0x6D: {l: {0x61: {l: {0x70: {l: {0x3B: {c: [10236]}}}}}}}, + 0x6E: {l: {0x69: {l: {0x73: {l: {0x3B: {c: [8955]}}}}}}}, + 0x6F: {l: { + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [10752]}}}}}}}, + 0x70: {l: { + 0x66: {l: {0x3B: {c: [120169]}}}, + 0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10753]}}}}}}} + }}, + 0x74: {l: {0x69: {l: {0x6D: {l: {0x65: {l: {0x3B: {c: [10754]}}}}}}}}} + }}, + 0x72: {l: { + 0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10230]}}}}}}}, + 0x41: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [10233]}}}}}}} + }}, + 0x73: {l: { + 0x63: {l: {0x72: {l: {0x3B: {c: [120013]}}}}}, + 0x71: {l: {0x63: {l: {0x75: {l: {0x70: {l: {0x3B: {c: [10758]}}}}}}}}} + }}, + 0x75: {l: { + 0x70: {l: {0x6C: {l: {0x75: {l: {0x73: {l: {0x3B: {c: [10756]}}}}}}}}}, + 0x74: {l: {0x72: {l: {0x69: {l: {0x3B: {c: [9651]}}}}}}} + }}, + 0x76: {l: {0x65: {l: {0x65: {l: {0x3B: {c: [8897]}}}}}}}, + 0x77: {l: {0x65: {l: {0x64: {l: {0x67: {l: {0x65: {l: {0x3B: {c: [8896]}}}}}}}}}}} + }}, + 0x58: {l: { + 0x66: {l: {0x72: {l: {0x3B: {c: [120091]}}}}}, + 0x69: {l: {0x3B: {c: [926]}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120143]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119987]}}}}}}} + }}, + 0x59: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [221]}}, + c: [221] + }}}}}}}}}, + 0x41: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1071]}}}}}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [374]}}}}}}}, + 0x79: {l: {0x3B: {c: [1067]}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120092]}}}}}, + 0x49: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1031]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120144]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119988]}}}}}}}, + 0x55: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1070]}}}}}}}, + 0x75: {l: {0x6D: {l: {0x6C: {l: {0x3B: {c: [376]}}}}}}} + }}, + 0x79: {l: { + 0x61: {l: {0x63: {l: { + 0x75: {l: {0x74: {l: {0x65: { + l: {0x3B: {c: [253]}}, + c: [253] + }}}}}, + 0x79: {l: {0x3B: {c: [1103]}}} + }}}}, + 0x63: {l: { + 0x69: {l: {0x72: {l: {0x63: {l: {0x3B: {c: [375]}}}}}}}, + 0x79: {l: {0x3B: {c: [1099]}}} + }}, + 0x65: {l: {0x6E: { + l: {0x3B: {c: [165]}}, + c: [165] + }}}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120118]}}}}}, + 0x69: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1111]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120170]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120014]}}}}}}}, + 0x75: {l: { + 0x63: {l: {0x79: {l: {0x3B: {c: [1102]}}}}}, + 0x6D: {l: {0x6C: { + l: {0x3B: {c: [255]}}, + c: [255] + }}} + }} + }}, + 0x5A: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [377]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [381]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1047]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [379]}}}}}}}, + 0x65: {l: { + 0x72: {l: {0x6F: {l: {0x57: {l: {0x69: {l: {0x64: {l: {0x74: {l: {0x68: {l: {0x53: {l: {0x70: {l: {0x61: {l: {0x63: {l: {0x65: {l: {0x3B: {c: [8203]}}}}}}}}}}}}}}}}}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [918]}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [8488]}}}}}, + 0x48: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1046]}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [8484]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [119989]}}}}}}} + }}, + 0x7A: {l: { + 0x61: {l: {0x63: {l: {0x75: {l: {0x74: {l: {0x65: {l: {0x3B: {c: [378]}}}}}}}}}}}, + 0x63: {l: { + 0x61: {l: {0x72: {l: {0x6F: {l: {0x6E: {l: {0x3B: {c: [382]}}}}}}}}}, + 0x79: {l: {0x3B: {c: [1079]}}} + }}, + 0x64: {l: {0x6F: {l: {0x74: {l: {0x3B: {c: [380]}}}}}}}, + 0x65: {l: { + 0x65: {l: {0x74: {l: {0x72: {l: {0x66: {l: {0x3B: {c: [8488]}}}}}}}}}, + 0x74: {l: {0x61: {l: {0x3B: {c: [950]}}}}} + }}, + 0x66: {l: {0x72: {l: {0x3B: {c: [120119]}}}}}, + 0x68: {l: {0x63: {l: {0x79: {l: {0x3B: {c: [1078]}}}}}}}, + 0x69: {l: {0x67: {l: {0x72: {l: {0x61: {l: {0x72: {l: {0x72: {l: {0x3B: {c: [8669]}}}}}}}}}}}}}, + 0x6F: {l: {0x70: {l: {0x66: {l: {0x3B: {c: [120171]}}}}}}}, + 0x73: {l: {0x63: {l: {0x72: {l: {0x3B: {c: [120015]}}}}}}}, + 0x77: {l: { + 0x6A: {l: {0x3B: {c: [8205]}}}, + 0x6E: {l: {0x6A: {l: {0x3B: {c: [8204]}}}}} + }} + }} + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/common/html", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var NS = exports.NAMESPACES = { + 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', + XML: 'http://www.w3.org/XML/1998/namespace', + XMLNS: 'http://www.w3.org/2000/xmlns/' + }; + exports.ATTRS = { + TYPE: 'type', + ACTION: 'action', + ENCODING: 'encoding', + PROMPT: 'prompt', + NAME: 'name', + COLOR: 'color', + FACE: 'face', + SIZE: 'size' + }; + var $ = exports.TAG_NAMES = { + A: 'a', + ADDRESS: 'address', + ANNOTATION_XML: 'annotation-xml', + APPLET: 'applet', + AREA: 'area', + ARTICLE: 'article', + ASIDE: 'aside', + B: 'b', + BASE: 'base', + BASEFONT: 'basefont', + BGSOUND: 'bgsound', + BIG: 'big', + BLOCKQUOTE: 'blockquote', + BODY: 'body', + BR: 'br', + BUTTON: 'button', + CAPTION: 'caption', + CENTER: 'center', + CODE: 'code', + COL: 'col', + COLGROUP: 'colgroup', + COMMAND: 'command', + DD: 'dd', + DESC: 'desc', + DETAILS: 'details', + DIALOG: 'dialog', + DIR: 'dir', + DIV: 'div', + DL: 'dl', + DT: 'dt', + EM: 'em', + EMBED: 'embed', + FIELDSET: 'fieldset', + FIGCAPTION: 'figcaption', + FIGURE: 'figure', + FONT: 'font', + FOOTER: 'footer', + FOREIGN_OBJECT: 'foreignObject', + FORM: 'form', + FRAME: 'frame', + FRAMESET: 'frameset', + H1: 'h1', + H2: 'h2', + H3: 'h3', + H4: 'h4', + H5: 'h5', + H6: 'h6', + HEAD: 'head', + HEADER: 'header', + HGROUP: 'hgroup', + HR: 'hr', + HTML: 'html', + I: 'i', + IMG: 'img', + IMAGE: 'image', + INPUT: 'input', + IFRAME: 'iframe', + ISINDEX: 'isindex', + KEYGEN: 'keygen', + LABEL: 'label', + LI: 'li', + LINK: 'link', + LISTING: 'listing', + MAIN: 'main', + MALIGNMARK: 'malignmark', + MARQUEE: 'marquee', + MATH: 'math', + MENU: 'menu', + MENUITEM: 'menuitem', + META: 'meta', + MGLYPH: 'mglyph', + MI: 'mi', + MO: 'mo', + MN: 'mn', + MS: 'ms', + MTEXT: 'mtext', + NAV: 'nav', + NOBR: 'nobr', + NOFRAMES: 'noframes', + NOEMBED: 'noembed', + NOSCRIPT: 'noscript', + OBJECT: 'object', + OL: 'ol', + OPTGROUP: 'optgroup', + OPTION: 'option', + P: 'p', + PARAM: 'param', + PLAINTEXT: 'plaintext', + PRE: 'pre', + RP: 'rp', + RT: 'rt', + RUBY: 'ruby', + S: 's', + SCRIPT: 'script', + SECTION: 'section', + SELECT: 'select', + SOURCE: 'source', + SMALL: 'small', + SPAN: 'span', + STRIKE: 'strike', + STRONG: 'strong', + STYLE: 'style', + SUB: 'sub', + SUMMARY: 'summary', + SUP: 'sup', + TABLE: 'table', + TBODY: 'tbody', + TEMPLATE: 'template', + TEXTAREA: 'textarea', + TFOOT: 'tfoot', + TD: 'td', + TH: 'th', + THEAD: 'thead', + TITLE: 'title', + TR: 'tr', + TRACK: 'track', + TT: 'tt', + U: 'u', + UL: 'ul', + SVG: 'svg', + VAR: 'var', + WBR: 'wbr', + XMP: 'xmp' + }; + var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = {}; + SPECIAL_ELEMENTS[NS.HTML] = {}; + SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true; + SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true; + SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true; + SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BR] = true; + SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true; + SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true; + SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true; + SPECIAL_ELEMENTS[NS.HTML][$.COL] = true; + SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DD] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DL] = true; + SPECIAL_ELEMENTS[NS.HTML][$.DT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true; + SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H1] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H2] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H3] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H4] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H5] = true; + SPECIAL_ELEMENTS[NS.HTML][$.H6] = true; + SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true; + SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true; + SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true; + SPECIAL_ELEMENTS[NS.HTML][$.HR] = true; + SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true; + SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true; + SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true; + SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.ISINDEX] = true; + SPECIAL_ELEMENTS[NS.HTML][$.LI] = true; + SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true; + SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true; + SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true; + SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true; + SPECIAL_ELEMENTS[NS.HTML][$.MENUITEM] = true; + SPECIAL_ELEMENTS[NS.HTML][$.META] = true; + SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true; + SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true; + SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true; + SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.OL] = true; + SPECIAL_ELEMENTS[NS.HTML][$.P] = true; + SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true; + SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true; + SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TD] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TH] = true; + SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TR] = true; + SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true; + SPECIAL_ELEMENTS[NS.HTML][$.UL] = true; + SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true; + SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true; + SPECIAL_ELEMENTS[NS.MATHML] = {}; + SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true; + SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true; + SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true; + SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true; + SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true; + SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true; + SPECIAL_ELEMENTS[NS.SVG] = {}; + SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true; + SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true; + SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_construction/formatting_element_list", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var NOAH_ARK_CAPACITY = 3; + var FormattingElementList = module.exports = function(treeAdapter) { + this.length = 0; + this.entries = []; + this.treeAdapter = treeAdapter; + this.bookmark = null; + }; + FormattingElementList.MARKER_ENTRY = 'MARKER_ENTRY'; + FormattingElementList.ELEMENT_ENTRY = 'ELEMENT_ENTRY'; + FormattingElementList.prototype._getNoahArkConditionCandidates = function(newElement) { + var candidates = []; + if (this.length >= NOAH_ARK_CAPACITY) { + var neAttrsLength = this.treeAdapter.getAttrList(newElement).length, + neTagName = this.treeAdapter.getTagName(newElement), + neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); + for (var i = this.length - 1; i >= 0; i--) { + var entry = this.entries[i]; + if (entry.type === FormattingElementList.MARKER_ENTRY) + break; + var element = entry.element, + elementAttrs = this.treeAdapter.getAttrList(element); + if (this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && elementAttrs.length === neAttrsLength) { + candidates.push({ + idx: i, + attrs: elementAttrs + }); + } + } + } + return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates; + }; + FormattingElementList.prototype._ensureNoahArkCondition = function(newElement) { + var candidates = this._getNoahArkConditionCandidates(newElement), + cLength = candidates.length; + if (cLength) { + var neAttrs = this.treeAdapter.getAttrList(newElement), + neAttrsLength = neAttrs.length, + neAttrsMap = {}; + for (var i = 0; i < neAttrsLength; i++) { + var neAttr = neAttrs[i]; + neAttrsMap[neAttr.name] = neAttr.value; + } + for (var i = 0; i < neAttrsLength; i++) { + for (var j = 0; j < cLength; j++) { + var cAttr = candidates[j].attrs[i]; + if (neAttrsMap[cAttr.name] !== cAttr.value) { + candidates.splice(j, 1); + cLength--; + } + if (candidates.length < NOAH_ARK_CAPACITY) + return ; + } + } + for (var i = cLength - 1; i >= NOAH_ARK_CAPACITY - 1; i--) { + this.entries.splice(candidates[i].idx, 1); + this.length--; + } + } + }; + FormattingElementList.prototype.insertMarker = function() { + this.entries.push({type: FormattingElementList.MARKER_ENTRY}); + this.length++; + }; + FormattingElementList.prototype.pushElement = function(element, token) { + this._ensureNoahArkCondition(element); + this.entries.push({ + type: FormattingElementList.ELEMENT_ENTRY, + element: element, + token: token + }); + this.length++; + }; + FormattingElementList.prototype.insertElementAfterBookmark = function(element, token) { + var bookmarkIdx = this.length - 1; + for (; bookmarkIdx >= 0; bookmarkIdx--) { + if (this.entries[bookmarkIdx] === this.bookmark) + break; + } + this.entries.splice(bookmarkIdx + 1, 0, { + type: FormattingElementList.ELEMENT_ENTRY, + element: element, + token: token + }); + this.length++; + }; + FormattingElementList.prototype.removeEntry = function(entry) { + for (var i = this.length - 1; i >= 0; i--) { + if (this.entries[i] === entry) { + this.entries.splice(i, 1); + this.length--; + break; + } + } + }; + FormattingElementList.prototype.clearToLastMarker = function() { + while (this.length) { + var entry = this.entries.pop(); + this.length--; + if (entry.type === FormattingElementList.MARKER_ENTRY) + break; + } + }; + FormattingElementList.prototype.getElementEntryInScopeWithTagName = function(tagName) { + for (var i = this.length - 1; i >= 0; i--) { + var entry = this.entries[i]; + if (entry.type === FormattingElementList.MARKER_ENTRY) + return null; + if (this.treeAdapter.getTagName(entry.element) === tagName) + return entry; + } + return null; + }; + FormattingElementList.prototype.getElementEntry = function(element) { + for (var i = this.length - 1; i >= 0; i--) { + var entry = this.entries[i]; + if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element == element) + return entry; + } + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_construction/doctype", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var VALID_DOCTYPE_NAME = 'html', + QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', + QUIRKS_MODE_PUBLIC_ID_PREFIXES = ["+//silmaril//dtd html pro v0r11 19970101//en", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//en", "-//as//dtd html 3.0 aswedit + extensions//en", "-//ietf//dtd html 2.0 level 1//en", "-//ietf//dtd html 2.0 level 2//en", "-//ietf//dtd html 2.0 strict level 1//en", "-//ietf//dtd html 2.0 strict level 2//en", "-//ietf//dtd html 2.0 strict//en", "-//ietf//dtd html 2.0//en", "-//ietf//dtd html 2.1e//en", "-//ietf//dtd html 3.0//en", "-//ietf//dtd html 3.0//en//", "-//ietf//dtd html 3.2 final//en", "-//ietf//dtd html 3.2//en", "-//ietf//dtd html 3//en", "-//ietf//dtd html level 0//en", "-//ietf//dtd html level 0//en//2.0", "-//ietf//dtd html level 1//en", "-//ietf//dtd html level 1//en//2.0", "-//ietf//dtd html level 2//en", "-//ietf//dtd html level 2//en//2.0", "-//ietf//dtd html level 3//en", "-//ietf//dtd html level 3//en//3.0", "-//ietf//dtd html strict level 0//en", "-//ietf//dtd html strict level 0//en//2.0", "-//ietf//dtd html strict level 1//en", "-//ietf//dtd html strict level 1//en//2.0", "-//ietf//dtd html strict level 2//en", "-//ietf//dtd html strict level 2//en//2.0", "-//ietf//dtd html strict level 3//en", "-//ietf//dtd html strict level 3//en//3.0", "-//ietf//dtd html strict//en", "-//ietf//dtd html strict//en//2.0", "-//ietf//dtd html strict//en//3.0", "-//ietf//dtd html//en", "-//ietf//dtd html//en//2.0", "-//ietf//dtd html//en//3.0", "-//metrius//dtd metrius presentational//en", "-//microsoft//dtd internet explorer 2.0 html strict//en", "-//microsoft//dtd internet explorer 2.0 html//en", "-//microsoft//dtd internet explorer 2.0 tables//en", "-//microsoft//dtd internet explorer 3.0 html strict//en", "-//microsoft//dtd internet explorer 3.0 html//en", "-//microsoft//dtd internet explorer 3.0 tables//en", "-//netscape comm. corp.//dtd html//en", "-//netscape comm. corp.//dtd strict html//en", "-//o'reilly and associates//dtd html 2.0//en", "-//o'reilly and associates//dtd html extended 1.0//en", "-//spyglass//dtd html 2.0 extended//en", "-//sq//dtd html 2.0 hotmetal + extensions//en", "-//sun microsystems corp.//dtd hotjava html//en", "-//sun microsystems corp.//dtd hotjava strict html//en", "-//w3c//dtd html 3 1995-03-24//en", "-//w3c//dtd html 3.2 draft//en", "-//w3c//dtd html 3.2 final//en", "-//w3c//dtd html 3.2//en", "-//w3c//dtd html 3.2s draft//en", "-//w3c//dtd html 4.0 frameset//en", "-//w3c//dtd html 4.0 transitional//en", "-//w3c//dtd html experimental 19960712//en", "-//w3c//dtd html experimental 970421//en", "-//w3c//dtd w3 html//en", "-//w3o//dtd w3 html 3.0//en", "-//w3o//dtd w3 html 3.0//en//", "-//webtechs//dtd mozilla html 2.0//en", "-//webtechs//dtd mozilla html//en"], + QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = ['-//w3c//dtd html 4.01 frameset//', '-//w3c//dtd html 4.01 transitional//'], + QUIRKS_MODE_PUBLIC_IDS = ['-//w3o//dtd w3 html strict 3.0//en//', '-/w3c/dtd html 4.0 transitional/en', 'html']; + exports.isQuirks = function(name, publicId, systemId) { + if (name !== VALID_DOCTYPE_NAME) + return true; + if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) + return true; + if (publicId !== null) { + publicId = publicId.toLowerCase(); + if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) + return true; + var prefixes = QUIRKS_MODE_PUBLIC_ID_PREFIXES; + if (systemId === null) + prefixes = prefixes.concat(QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES); + for (var i = 0; i < prefixes.length; i++) { + if (publicId.indexOf(prefixes[i]) === 0) + return true; + } + } + return false; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_adapters/default", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.createDocument = function() { + return { + nodeName: '#document', + quirksMode: false, + childNodes: [] + }; + }; + exports.createDocumentFragment = function() { + return { + nodeName: '#document-fragment', + quirksMode: false, + childNodes: [] + }; + }; + exports.createElement = function(tagName, namespaceURI, attrs) { + return { + nodeName: tagName, + tagName: tagName, + attrs: attrs, + namespaceURI: namespaceURI, + childNodes: [], + parentNode: null + }; + }; + exports.createCommentNode = function(data) { + return { + nodeName: '#comment', + data: data, + parentNode: null + }; + }; + var createTextNode = function(value) { + return { + nodeName: '#text', + value: value, + parentNode: null + }; + }; + exports.setDocumentType = function(document, name, publicId, systemId) { + var doctypeNode = null; + for (var i = 0; i < document.childNodes.length; i++) { + if (document.childNodes[i].nodeName === '#documentType') { + doctypeNode = document.childNodes[i]; + break; + } + } + if (doctypeNode) { + doctypeNode.name = name; + doctypeNode.publicId = publicId; + doctypeNode.systemId = systemId; + } else { + appendChild(document, { + nodeName: '#documentType', + name: name, + publicId: publicId, + systemId: systemId + }); + } + }; + exports.setQuirksMode = function(document) { + document.quirksMode = true; + }; + exports.isQuirksMode = function(document) { + return document.quirksMode; + }; + var appendChild = exports.appendChild = function(parentNode, newNode) { + parentNode.childNodes.push(newNode); + newNode.parentNode = parentNode; + }; + var insertBefore = exports.insertBefore = function(parentNode, newNode, referenceNode) { + var insertionIdx = parentNode.childNodes.indexOf(referenceNode); + parentNode.childNodes.splice(insertionIdx, 0, newNode); + newNode.parentNode = parentNode; + }; + exports.detachNode = function(node) { + if (node.parentNode) { + var idx = node.parentNode.childNodes.indexOf(node); + node.parentNode.childNodes.splice(idx, 1); + node.parentNode = null; + } + }; + exports.insertText = function(parentNode, text) { + if (parentNode.childNodes.length) { + var prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; + if (prevNode.nodeName === '#text') { + prevNode.value += text; + return ; + } + } + appendChild(parentNode, createTextNode(text)); + }; + exports.insertTextBefore = function(parentNode, text, referenceNode) { + var prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; + if (prevNode && prevNode.nodeName === '#text') + prevNode.value += text; + else + insertBefore(parentNode, createTextNode(text), referenceNode); + }; + exports.adoptAttributes = function(recipientNode, attrs) { + var recipientAttrsMap = []; + for (var i = 0; i < recipientNode.attrs.length; i++) + recipientAttrsMap.push(recipientNode.attrs[i].name); + for (var j = 0; j < attrs.length; j++) { + if (recipientAttrsMap.indexOf(attrs[j].name) === -1) + recipientNode.attrs.push(attrs[j]); + } + }; + exports.getFirstChild = function(node) { + return node.childNodes[0]; + }; + exports.getChildNodes = function(node) { + return node.childNodes; + }; + exports.getParentNode = function(node) { + return node.parentNode; + }; + exports.getAttrList = function(node) { + return node.attrs; + }; + exports.getTagName = function(element) { + return element.tagName; + }; + exports.getNamespaceURI = function(element) { + return element.namespaceURI; + }; + exports.getTextNodeContent = function(textNode) { + return textNode.value; + }; + exports.getCommentNodeContent = function(commentNode) { + return commentNode.data; + }; + exports.getDocumentTypeNodeName = function(doctypeNode) { + return doctypeNode.name; + }; + exports.getDocumentTypeNodePublicId = function(doctypeNode) { + return doctypeNode.publicId; + }; + exports.getDocumentTypeNodeSystemId = function(doctypeNode) { + return doctypeNode.systemId; + }; + exports.isTextNode = function(node) { + return node.nodeName === '#text'; + }; + exports.isCommentNode = function(node) { + return node.nodeName === '#comment'; + }; + exports.isDocumentTypeNode = function(node) { + return node.nodeName === '#documentType'; + }; + exports.isElementNode = function(node) { + return !!node.tagName; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/common/foreign_content", ["parse5/lib/tokenization/tokenizer", "parse5/lib/common/html"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Tokenizer = require("parse5/lib/tokenization/tokenizer"), + HTML = require("parse5/lib/common/html"); + var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES, + ATTRS = HTML.ATTRS; + var MIME_TYPES = { + TEXT_HTML: 'text/html', + APPLICATION_XML: 'application/xhtml+xml' + }; + var DEFINITION_URL_ATTR = 'definitionurl', + ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', + SVG_ATTRS_ADJUSTMENT_MAP = { + 'attributename': 'attributeName', + 'attributetype': 'attributeType', + 'basefrequency': 'baseFrequency', + 'baseprofile': 'baseProfile', + 'calcmode': 'calcMode', + 'clippathunits': 'clipPathUnits', + 'contentscripttype': 'contentScriptType', + 'contentstyletype': 'contentStyleType', + 'diffuseconstant': 'diffuseConstant', + 'edgemode': 'edgeMode', + 'externalresourcesrequired': 'externalResourcesRequired', + 'filterres': 'filterRes', + 'filterunits': 'filterUnits', + 'glyphref': 'glyphRef', + 'gradienttransform': 'gradientTransform', + 'gradientunits': 'gradientUnits', + 'kernelmatrix': 'kernelMatrix', + 'kernelunitlength': 'kernelUnitLength', + 'keypoints': 'keyPoints', + 'keysplines': 'keySplines', + 'keytimes': 'keyTimes', + 'lengthadjust': 'lengthAdjust', + 'limitingconeangle': 'limitingConeAngle', + 'markerheight': 'markerHeight', + 'markerunits': 'markerUnits', + 'markerwidth': 'markerWidth', + 'maskcontentunits': 'maskContentUnits', + 'maskunits': 'maskUnits', + 'numoctaves': 'numOctaves', + 'pathlength': 'pathLength', + 'patterncontentunits': 'patternContentUnits', + 'patterntransform': 'patternTransform', + 'patternunits': 'patternUnits', + 'pointsatx': 'pointsAtX', + 'pointsaty': 'pointsAtY', + 'pointsatz': 'pointsAtZ', + 'preservealpha': 'preserveAlpha', + 'preserveaspectratio': 'preserveAspectRatio', + 'primitiveunits': 'primitiveUnits', + 'refx': 'refX', + 'refy': 'refY', + 'repeatcount': 'repeatCount', + 'repeatdur': 'repeatDur', + 'requiredextensions': 'requiredExtensions', + 'requiredfeatures': 'requiredFeatures', + 'specularconstant': 'specularConstant', + 'specularexponent': 'specularExponent', + 'spreadmethod': 'spreadMethod', + 'startoffset': 'startOffset', + 'stddeviation': 'stdDeviation', + 'stitchtiles': 'stitchTiles', + 'surfacescale': 'surfaceScale', + 'systemlanguage': 'systemLanguage', + 'tablevalues': 'tableValues', + 'targetx': 'targetX', + 'targety': 'targetY', + 'textlength': 'textLength', + 'viewbox': 'viewBox', + 'viewtarget': 'viewTarget', + 'xchannelselector': 'xChannelSelector', + 'ychannelselector': 'yChannelSelector', + 'zoomandpan': 'zoomAndPan' + }, + XML_ATTRS_ADJUSTMENT_MAP = { + 'xlink:actuate': { + prefix: 'xlink', + name: 'actuate', + namespace: NS.XLINK + }, + 'xlink:arcrole': { + prefix: 'xlink', + name: 'arcrole', + namespace: NS.XLINK + }, + 'xlink:href': { + prefix: 'xlink', + name: 'href', + namespace: NS.XLINK + }, + 'xlink:role': { + prefix: 'xlink', + name: 'role', + namespace: NS.XLINK + }, + 'xlink:show': { + prefix: 'xlink', + name: 'show', + namespace: NS.XLINK + }, + 'xlink:title': { + prefix: 'xlink', + name: 'title', + namespace: NS.XLINK + }, + 'xlink:type': { + prefix: 'xlink', + name: 'type', + namespace: NS.XLINK + }, + 'xml:base': { + prefix: 'xml', + name: 'base', + namespace: NS.XML + }, + 'xml:lang': { + prefix: 'xml', + name: 'lang', + namespace: NS.XML + }, + 'xml:space': { + prefix: 'xml', + name: 'space', + namespace: NS.XML + }, + 'xmlns': { + prefix: '', + name: 'xmlns', + namespace: NS.XMLNS + }, + 'xmlns:xlink': { + prefix: 'xmlns', + name: 'xlink', + namespace: NS.XMLNS + } + }; + var SVG_TAG_NAMES_ADJUSTMENT_MAP = { + 'altglyph': 'altGlyph', + 'altglyphdef': 'altGlyphDef', + 'altglyphitem': 'altGlyphItem', + 'animatecolor': 'animateColor', + 'animatemotion': 'animateMotion', + 'animatetransform': 'animateTransform', + 'clippath': 'clipPath', + 'feblend': 'feBlend', + 'fecolormatrix': 'feColorMatrix', + 'fecomponenttransfer': 'feComponentTransfer', + 'fecomposite': 'feComposite', + 'feconvolvematrix': 'feConvolveMatrix', + 'fediffuselighting': 'feDiffuseLighting', + 'fedisplacementmap': 'feDisplacementMap', + 'fedistantlight': 'feDistantLight', + 'feflood': 'feFlood', + 'fefunca': 'feFuncA', + 'fefuncb': 'feFuncB', + 'fefuncg': 'feFuncG', + 'fefuncr': 'feFuncR', + 'fegaussianblur': 'feGaussianBlur', + 'feimage': 'feImage', + 'femerge': 'feMerge', + 'femergenode': 'feMergeNode', + 'femorphology': 'feMorphology', + 'feoffset': 'feOffset', + 'fepointlight': 'fePointLight', + 'fespecularlighting': 'feSpecularLighting', + 'fespotlight': 'feSpotLight', + 'fetile': 'feTile', + 'feturbulence': 'feTurbulence', + 'foreignobject': 'foreignObject', + 'glyphref': 'glyphRef', + 'lineargradient': 'linearGradient', + 'radialgradient': 'radialGradient', + 'textpath': 'textPath' + }; + var EXITS_FOREIGN_CONTENT = {}; + EXITS_FOREIGN_CONTENT[$.B] = true; + EXITS_FOREIGN_CONTENT[$.BIG] = true; + EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; + EXITS_FOREIGN_CONTENT[$.BODY] = true; + EXITS_FOREIGN_CONTENT[$.BR] = true; + EXITS_FOREIGN_CONTENT[$.CENTER] = true; + EXITS_FOREIGN_CONTENT[$.CODE] = true; + EXITS_FOREIGN_CONTENT[$.DD] = true; + EXITS_FOREIGN_CONTENT[$.DIV] = true; + EXITS_FOREIGN_CONTENT[$.DL] = true; + EXITS_FOREIGN_CONTENT[$.DT] = true; + EXITS_FOREIGN_CONTENT[$.EM] = true; + EXITS_FOREIGN_CONTENT[$.EMBED] = true; + EXITS_FOREIGN_CONTENT[$.H1] = true; + EXITS_FOREIGN_CONTENT[$.H2] = true; + EXITS_FOREIGN_CONTENT[$.H3] = true; + EXITS_FOREIGN_CONTENT[$.H4] = true; + EXITS_FOREIGN_CONTENT[$.H5] = true; + EXITS_FOREIGN_CONTENT[$.H6] = true; + EXITS_FOREIGN_CONTENT[$.HEAD] = true; + EXITS_FOREIGN_CONTENT[$.HR] = true; + EXITS_FOREIGN_CONTENT[$.I] = true; + EXITS_FOREIGN_CONTENT[$.IMG] = true; + EXITS_FOREIGN_CONTENT[$.LI] = true; + EXITS_FOREIGN_CONTENT[$.LISTING] = true; + EXITS_FOREIGN_CONTENT[$.MENU] = true; + EXITS_FOREIGN_CONTENT[$.META] = true; + EXITS_FOREIGN_CONTENT[$.NOBR] = true; + EXITS_FOREIGN_CONTENT[$.OL] = true; + EXITS_FOREIGN_CONTENT[$.P] = true; + EXITS_FOREIGN_CONTENT[$.PRE] = true; + EXITS_FOREIGN_CONTENT[$.RUBY] = true; + EXITS_FOREIGN_CONTENT[$.S] = true; + EXITS_FOREIGN_CONTENT[$.SMALL] = true; + EXITS_FOREIGN_CONTENT[$.SPAN] = true; + EXITS_FOREIGN_CONTENT[$.STRONG] = true; + EXITS_FOREIGN_CONTENT[$.STRIKE] = true; + EXITS_FOREIGN_CONTENT[$.SUB] = true; + EXITS_FOREIGN_CONTENT[$.SUP] = true; + EXITS_FOREIGN_CONTENT[$.TABLE] = true; + EXITS_FOREIGN_CONTENT[$.TT] = true; + EXITS_FOREIGN_CONTENT[$.U] = true; + EXITS_FOREIGN_CONTENT[$.UL] = true; + EXITS_FOREIGN_CONTENT[$.VAR] = true; + exports.causesExit = function(startTagToken) { + var tn = startTagToken.tagName; + if (tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null)) { + return true; + } + return EXITS_FOREIGN_CONTENT[tn]; + }; + exports.adjustTokenMathMLAttrs = function(token) { + for (var i = 0; i < token.attrs.length; i++) { + if (token.attrs[i].name === DEFINITION_URL_ATTR) { + token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; + break; + } + } + }; + exports.adjustTokenSVGAttrs = function(token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + if (adjustedAttrName) + token.attrs[i].name = adjustedAttrName; + } + }; + exports.adjustTokenXMLAttrs = function(token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + if (adjustedAttrEntry) { + token.attrs[i].prefix = adjustedAttrEntry.prefix; + token.attrs[i].name = adjustedAttrEntry.name; + token.attrs[i].namespace = adjustedAttrEntry.namespace; + } + } + }; + exports.adjustTokenSVGTagName = function(token) { + var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; + if (adjustedTagName) + token.tagName = adjustedTagName; + }; + exports.isMathMLTextIntegrationPoint = function(tn, ns) { + return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); + }; + exports.isHtmlIntegrationPoint = function(tn, ns, attrs) { + if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name === ATTRS.ENCODING) { + var value = attrs[i].value.toLowerCase(); + return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; + } + } + } + return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/simple_api/tokenizer_proxy", ["parse5/lib/tokenization/tokenizer", "parse5/lib/common/foreign_content", "parse5/lib/common/unicode", "parse5/lib/common/html"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Tokenizer = require("parse5/lib/tokenization/tokenizer"), + ForeignContent = require("parse5/lib/common/foreign_content"), + UNICODE = require("parse5/lib/common/unicode"), + HTML = require("parse5/lib/common/html"); + var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES; + var TokenizerProxy = module.exports = function(html) { + this.tokenizer = new Tokenizer(html); + this.namespaceStack = []; + this.namespaceStackTop = -1; + this.currentNamespace = null; + this.inForeignContent = false; + }; + TokenizerProxy.prototype.getNextToken = function() { + var token = this.tokenizer.getNextToken(); + if (token.type === Tokenizer.START_TAG_TOKEN) + this._handleStartTagToken(token); + else if (token.type === Tokenizer.END_TAG_TOKEN) + this._handleEndTagToken(token); + else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN && this.inForeignContent) { + token.type = Tokenizer.CHARACTER_TOKEN; + token.chars = UNICODE.REPLACEMENT_CHARACTER; + } + return token; + }; + TokenizerProxy.prototype._enterNamespace = function(namespace) { + this.namespaceStackTop++; + this.namespaceStack.push(namespace); + this.inForeignContent = namespace !== NS.HTML; + this.currentNamespace = namespace; + this.tokenizer.allowCDATA = this.inForeignContent; + }; + TokenizerProxy.prototype._leaveCurrentNamespace = function() { + this.namespaceStackTop--; + this.namespaceStack.pop(); + this.currentNamespace = this.namespaceStack[this.namespaceStackTop]; + this.inForeignContent = this.currentNamespace !== NS.HTML; + this.tokenizer.allowCDATA = this.inForeignContent; + }; + TokenizerProxy.prototype._ensureTokenizerState = function(tn) { + if (tn === $.TEXTAREA || tn === $.TITLE) + this.tokenizer.state = Tokenizer.RCDATA_STATE; + else if (tn === $.PLAINTEXT) + this.tokenizer.state = Tokenizer.PLAINTEXT_STATE; + else if (tn === $.SCRIPT) + this.tokenizer.state = Tokenizer.SCRIPT_DATA_STATE; + else if (tn === $.STYLE || tn === $.IFRAME || tn === $.XMP || tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) { + this.tokenizer.state = Tokenizer.RAWTEXT_STATE; + } + }; + TokenizerProxy.prototype._handleStartTagToken = function(token) { + var tn = token.tagName; + if (tn === $.SVG) + this._enterNamespace(NS.SVG); + else if (tn === $.MATH) + this._enterNamespace(NS.MATHML); + else { + if (this.inForeignContent) { + if (ForeignContent.causesExit(token)) + this._leaveCurrentNamespace(); + else if (ForeignContent.isMathMLTextIntegrationPoint(tn, this.currentNamespace) || ForeignContent.isHtmlIntegrationPoint(tn, this.currentNamespace, token.attrs)) { + this._enterNamespace(NS.HTML); + } + } else + this._ensureTokenizerState(tn); + } + }; + TokenizerProxy.prototype._handleEndTagToken = function(token) { + var tn = token.tagName; + if (!this.inForeignContent) { + var previousNs = this.namespaceStack[this.namespaceStackTop - 1]; + if (ForeignContent.isMathMLTextIntegrationPoint(tn, previousNs) || ForeignContent.isHtmlIntegrationPoint(tn, previousNs, token.attrs)) { + this._leaveCurrentNamespace(); + } else if (tn === $.SCRIPT) + this.tokenizer.state = Tokenizer.DATA_STATE; + } else if ((tn === $.SVG && this.currentNamespace === NS.SVG) || (tn === $.MATH && this.currentNamespace === NS.MATHML)) + this._leaveCurrentNamespace(); + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/common/utils", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.mergeOptions = function(defaults, options) { + options = options || {}; + return [defaults, options].reduce(function(merged, optObj) { + Object.keys(optObj).forEach(function(key) { + merged[key] = optObj[key]; + }); + return merged; + }, {}); + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/jsdom/parsing_unit", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var ParsingUnit = module.exports = function(parser) { + this.parser = parser; + this.suspended = false; + this.parsingLoopLock = false; + this.callback = null; + }; + ParsingUnit.prototype._stateGuard = function(suspend) { + if (this.suspended && suspend) + throw new Error('parse5: Parser was already suspended. Please, check your control flow logic.'); + else if (!this.suspended && !suspend) + throw new Error('parse5: Parser was already resumed. Please, check your control flow logic.'); + return suspend; + }; + ParsingUnit.prototype.suspend = function() { + this.suspended = this._stateGuard(true); + return this; + }; + ParsingUnit.prototype.resume = function() { + this.suspended = this._stateGuard(false); + if (!this.parsingLoopLock) + this.parser._runParsingLoop(); + return this; + }; + ParsingUnit.prototype.documentWrite = function(html) { + this.parser.tokenizer.preprocessor.write(html); + return this; + }; + ParsingUnit.prototype.handleScripts = function(scriptHandler) { + this.parser.scriptHandler = scriptHandler; + return this; + }; + ParsingUnit.prototype.done = function(callback) { + this.callback = callback; + return this; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_adapters/htmlparser2", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var nodeTypes = { + element: 1, + text: 3, + cdata: 4, + comment: 8 + }; + var nodePropertyShorthands = { + tagName: 'name', + childNodes: 'children', + parentNode: 'parent', + previousSibling: 'prev', + nextSibling: 'next', + nodeValue: 'data' + }; + var Node = function(props) { + for (var key in props) { + if (props.hasOwnProperty(key)) + this[key] = props[key]; + } + }; + Node.prototype = { + get firstChild() { + var children = this.children; + return children && children[0] || null; + }, + get lastChild() { + var children = this.children; + return children && children[children.length - 1] || null; + }, + get nodeType() { + return nodeTypes[this.type] || nodeTypes.element; + } + }; + Object.keys(nodePropertyShorthands).forEach(function(key) { + var shorthand = nodePropertyShorthands[key]; + Object.defineProperty(Node.prototype, key, { + get: function() { + return this[shorthand] || null; + }, + set: function(val) { + this[shorthand] = val; + return val; + } + }); + }); + exports.createDocument = exports.createDocumentFragment = function() { + return new Node({ + type: 'root', + name: 'root', + parent: null, + prev: null, + next: null, + children: [] + }); + }; + exports.createElement = function(tagName, namespaceURI, attrs) { + var attribs = {}, + attribsNamespace = {}, + attribsPrefix = {}; + for (var i = 0; i < attrs.length; i++) { + var attrName = attrs[i].name; + attribs[attrName] = attrs[i].value; + attribsNamespace[attrName] = attrs[i].namespace; + attribsPrefix[attrName] = attrs[i].prefix; + } + return new Node({ + type: tagName === 'script' || tagName === 'style' ? tagName : 'tag', + name: tagName, + namespace: namespaceURI, + attribs: attribs, + 'x-attribsNamespace': attribsNamespace, + 'x-attribsPrefix': attribsPrefix, + children: [], + parent: null, + prev: null, + next: null + }); + }; + exports.createCommentNode = function(data) { + return new Node({ + type: 'comment', + data: data, + parent: null, + prev: null, + next: null + }); + }; + var createTextNode = function(value) { + return new Node({ + type: 'text', + data: value, + parent: null, + prev: null, + next: null + }); + }; + exports.setDocumentType = function(document, name, publicId, systemId) { + var data = '!DOCTYPE'; + if (name) + data += ' ' + name; + if (publicId) + data += ' PUBLIC "' + publicId + '"'; + if (systemId) + data += ' "' + systemId + '"'; + var doctypeNode = null; + for (var i = 0; i < document.children.length; i++) { + if (document.children[i].type === 'directive' && document.children[i].name === '!doctype') { + doctypeNode = document.children[i]; + break; + } + } + if (doctypeNode) { + doctypeNode.data = data; + doctypeNode['x-name'] = name; + doctypeNode['x-publicId'] = publicId; + doctypeNode['x-systemId'] = systemId; + } else { + appendChild(document, new Node({ + type: 'directive', + name: '!doctype', + data: data, + 'x-name': name, + 'x-publicId': publicId, + 'x-systemId': systemId + })); + } + }; + exports.setQuirksMode = function(document) { + document.quirksMode = true; + }; + exports.isQuirksMode = function(document) { + return document.quirksMode; + }; + var appendChild = exports.appendChild = function(parentNode, newNode) { + var prev = parentNode.children[parentNode.children.length - 1]; + if (prev) { + prev.next = newNode; + newNode.prev = prev; + } + parentNode.children.push(newNode); + newNode.parent = parentNode; + }; + var insertBefore = exports.insertBefore = function(parentNode, newNode, referenceNode) { + var insertionIdx = parentNode.children.indexOf(referenceNode), + prev = referenceNode.prev; + if (prev) { + prev.next = newNode; + newNode.prev = prev; + } + referenceNode.prev = newNode; + newNode.next = referenceNode; + parentNode.children.splice(insertionIdx, 0, newNode); + newNode.parent = parentNode; + }; + exports.detachNode = function(node) { + if (node.parent) { + var idx = node.parent.children.indexOf(node), + prev = node.prev, + next = node.next; + node.prev = null; + node.next = null; + if (prev) + prev.next = next; + if (next) + next.prev = prev; + node.parent.children.splice(idx, 1); + node.parent = null; + } + }; + exports.insertText = function(parentNode, text) { + var lastChild = parentNode.children[parentNode.children.length - 1]; + if (lastChild && lastChild.type === 'text') + lastChild.data += text; + else + appendChild(parentNode, createTextNode(text)); + }; + exports.insertTextBefore = function(parentNode, text, referenceNode) { + var prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; + if (prevNode && prevNode.type === 'text') + prevNode.data += text; + else + insertBefore(parentNode, createTextNode(text), referenceNode); + }; + exports.adoptAttributes = function(recipientNode, attrs) { + for (var i = 0; i < attrs.length; i++) { + var attrName = attrs[i].name; + if (typeof recipientNode.attribs[attrName] === 'undefined') { + recipientNode.attribs[attrName] = attrs[i].value; + recipientNode['x-attribsNamespace'][attrName] = attrs[i].namespace; + recipientNode['x-attribsPrefix'][attrName] = attrs[i].prefix; + } + } + }; + exports.getFirstChild = function(node) { + return node.children[0]; + }; + exports.getChildNodes = function(node) { + return node.children; + }; + exports.getParentNode = function(node) { + return node.parent; + }; + exports.getAttrList = function(node) { + var attrList = []; + for (var name in node.attribs) { + if (node.attribs.hasOwnProperty(name)) { + attrList.push({ + name: name, + value: node.attribs[name], + namespace: node['x-attribsNamespace'][name], + prefix: node['x-attribsPrefix'][name] + }); + } + } + return attrList; + }; + exports.getTagName = function(element) { + return element.name; + }; + exports.getNamespaceURI = function(element) { + return element.namespace; + }; + exports.getTextNodeContent = function(textNode) { + return textNode.data; + }; + exports.getCommentNodeContent = function(commentNode) { + return commentNode.data; + }; + exports.getDocumentTypeNodeName = function(doctypeNode) { + return doctypeNode['x-name']; + }; + exports.getDocumentTypeNodePublicId = function(doctypeNode) { + return doctypeNode['x-publicId']; + }; + exports.getDocumentTypeNodeSystemId = function(doctypeNode) { + return doctypeNode['x-systemId']; + }; + exports.isTextNode = function(node) { + return node.type === 'text'; + }; + exports.isCommentNode = function(node) { + return node.type === 'comment'; + }; + exports.isDocumentTypeNode = function(node) { + return node.type === 'directive' && node.name === '!doctype'; + }; + exports.isElementNode = function(node) { + return !!node.attribs; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var metadata_1 = require("angular2/src/core/di/metadata"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); + exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); + exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); + exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); + exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); + exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/exceptions", ["angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var exception_handler_1 = require("angular2/src/facade/exception_handler"); + var exception_handler_2 = require("angular2/src/facade/exception_handler"); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + })(Error); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + })(Error); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reflector_1 = require("angular2/src/core/reflection/reflector"); + var reflector_2 = require("angular2/src/core/reflection/reflector"); + exports.Reflector = reflector_2.Reflector; + exports.ReflectionInfo = reflector_2.ReflectionInfo; + var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); + exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/type_literal", "angular2/src/core/di/forward_ref", "angular2/src/core/di/type_literal"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var type_literal_1 = require("angular2/src/core/di/type_literal"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var type_literal_2 = require("angular2/src/core/di/type_literal"); + exports.TypeLiteral = type_literal_2.TypeLiteral; + var Key = (function() { + function Key(token, id) { + this.token = token; + this.id = id; + if (lang_1.isBlank(token)) { + throw new exceptions_1.BaseException('Token must be defined!'); + } + } + Object.defineProperty(Key.prototype, "displayName", { + get: function() { + return lang_1.stringify(this.token); + }, + enumerable: true, + configurable: true + }); + Key.get = function(token) { + return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); + }; + Object.defineProperty(Key, "numberOfKeys", { + get: function() { + return _globalKeyRegistry.numberOfKeys; + }, + enumerable: true, + configurable: true + }); + return Key; + })(); + exports.Key = Key; + var KeyRegistry = (function() { + function KeyRegistry() { + this._allKeys = new Map(); + } + KeyRegistry.prototype.get = function(token) { + if (token instanceof Key) + return token; + var theToken = token; + if (token instanceof type_literal_1.TypeLiteral) { + theToken = token.type; + } + token = theToken; + if (this._allKeys.has(token)) { + return this._allKeys.get(token); + } + var newKey = new Key(token, Key.numberOfKeys); + this._allKeys.set(token, newKey); + return newKey; + }; + Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { + get: function() { + return this._allKeys.size; + }, + enumerable: true, + configurable: true + }); + return KeyRegistry; + })(); + exports.KeyRegistry = KeyRegistry; + var _globalKeyRegistry = new KeyRegistry(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var WrappedValue = (function() { + function WrappedValue(wrapped) { + this.wrapped = wrapped; + } + WrappedValue.wrap = function(value) { + var w = _wrappedValues[_wrappedIndex++ % 5]; + w.wrapped = value; + return w; + }; + return WrappedValue; + })(); + exports.WrappedValue = WrappedValue; + var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; + var _wrappedIndex = 0; + var SimpleChange = (function() { + function SimpleChange(previousValue, currentValue) { + this.previousValue = previousValue; + this.currentValue = currentValue; + } + SimpleChange.prototype.isFirstChange = function() { + return this.previousValue === ChangeDetectionUtil.uninitialized; + }; + return SimpleChange; + })(); + exports.SimpleChange = SimpleChange; + var _simpleChangesIndex = 0; + var _simpleChanges = [new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null), new SimpleChange(null, null)]; + function _simpleChange(previousValue, currentValue) { + var index = _simpleChangesIndex++ % 20; + var s = _simpleChanges[index]; + s.previousValue = previousValue; + s.currentValue = currentValue; + return s; + } + var ChangeDetectionUtil = (function() { + function ChangeDetectionUtil() {} + ChangeDetectionUtil.arrayFn0 = function() { + return []; + }; + ChangeDetectionUtil.arrayFn1 = function(a1) { + return [a1]; + }; + ChangeDetectionUtil.arrayFn2 = function(a1, a2) { + return [a1, a2]; + }; + ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { + return [a1, a2, a3]; + }; + ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { + return [a1, a2, a3, a4]; + }; + ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { + return [a1, a2, a3, a4, a5]; + }; + ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { + return [a1, a2, a3, a4, a5, a6]; + }; + ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { + return [a1, a2, a3, a4, a5, a6, a7]; + }; + ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { + return [a1, a2, a3, a4, a5, a6, a7, a8]; + }; + ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; + }; + ChangeDetectionUtil.operation_negate = function(value) { + return !value; + }; + ChangeDetectionUtil.operation_add = function(left, right) { + return left + right; + }; + ChangeDetectionUtil.operation_subtract = function(left, right) { + return left - right; + }; + ChangeDetectionUtil.operation_multiply = function(left, right) { + return left * right; + }; + ChangeDetectionUtil.operation_divide = function(left, right) { + return left / right; + }; + ChangeDetectionUtil.operation_remainder = function(left, right) { + return left % right; + }; + ChangeDetectionUtil.operation_equals = function(left, right) { + return left == right; + }; + ChangeDetectionUtil.operation_not_equals = function(left, right) { + return left != right; + }; + ChangeDetectionUtil.operation_identical = function(left, right) { + return left === right; + }; + ChangeDetectionUtil.operation_not_identical = function(left, right) { + return left !== right; + }; + ChangeDetectionUtil.operation_less_then = function(left, right) { + return left < right; + }; + ChangeDetectionUtil.operation_greater_then = function(left, right) { + return left > right; + }; + ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { + return left <= right; + }; + ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { + return left >= right; + }; + ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { + return cond ? trueVal : falseVal; + }; + ChangeDetectionUtil.mapFn = function(keys) { + function buildMap(values) { + var res = collection_1.StringMapWrapper.create(); + for (var i = 0; i < keys.length; ++i) { + collection_1.StringMapWrapper.set(res, keys[i], values[i]); + } + return res; + } + switch (keys.length) { + case 0: + return function() { + return []; + }; + case 1: + return function(a1) { + return buildMap([a1]); + }; + case 2: + return function(a1, a2) { + return buildMap([a1, a2]); + }; + case 3: + return function(a1, a2, a3) { + return buildMap([a1, a2, a3]); + }; + case 4: + return function(a1, a2, a3, a4) { + return buildMap([a1, a2, a3, a4]); + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return buildMap([a1, a2, a3, a4, a5]); + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return buildMap([a1, a2, a3, a4, a5, a6]); + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return buildMap([a1, a2, a3, a4, a5, a6, a7]); + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); + }; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + }; + ChangeDetectionUtil.keyedAccess = function(obj, args) { + return obj[args[0]]; + }; + ChangeDetectionUtil.unwrapValue = function(value) { + if (value instanceof WrappedValue) { + return value.wrapped; + } else { + return value; + } + }; + ChangeDetectionUtil.changeDetectionMode = function(strategy) { + return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; + }; + ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { + return _simpleChange(previousValue, currentValue); + }; + ChangeDetectionUtil.isValueBlank = function(value) { + return lang_1.isBlank(value); + }; + ChangeDetectionUtil.s = function(value) { + return lang_1.isPresent(value) ? "" + value : ''; + }; + ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { + return selfIndex < 1 ? null : protos[selfIndex - 1]; + }; + ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { + if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { + selectedPipe.pipe.onDestroy(); + } + }; + ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { + return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); + }; + ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { + return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); + }; + ChangeDetectionUtil.looseNotIdentical = function(a, b) { + return !lang_1.looseIdentical(a, b); + }; + ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); + return ChangeDetectionUtil; + })(); + exports.ChangeDetectionUtil = ChangeDetectionUtil; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var impl = require("angular2/src/core/profile/wtf_impl"); + exports.wtfEnabled = impl.detectWTF(); + function noopScope(arg0, arg1) { + return null; + } + exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { + return noopScope; + }; + exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { + return r; + }; + exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { + return null; + }; + exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { + return null; + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/constants", "angular2/src/facade/exceptions"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var CodegenLogicUtil = (function() { + function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName, _changeDetection) { + this._names = _names; + this._utilName = _utilName; + this._changeDetectorStateName = _changeDetectorStateName; + this._changeDetection = _changeDetection; + } + CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getLocalName(idx); + }, this._names.getLocalsAccessorName()); + }; + CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { + var _this = this; + return this._genEvalValue(protoRec, function(idx) { + return _this._names.getEventLocalName(eventRecord, idx); + }, "locals"); + }; + CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { + var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); + var argString = protoRec.args.map(function(arg) { + return getLocalName(arg); + }).join(", "); + var rhs; + switch (protoRec.mode) { + case proto_record_1.RecordType.Self: + rhs = context; + break; + case proto_record_1.RecordType.Const: + rhs = codegen_facade_1.codify(protoRec.funcOrValue); + break; + case proto_record_1.RecordType.PropertyRead: + rhs = this._observe(context + "." + protoRec.name, protoRec); + break; + case proto_record_1.RecordType.SafeProperty: + var read = this._observe(context + "." + protoRec.name, protoRec); + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(read, protoRec); + break; + case proto_record_1.RecordType.PropertyWrite: + rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); + break; + case proto_record_1.RecordType.Local: + rhs = this._observe(localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")", protoRec); + break; + case proto_record_1.RecordType.InvokeMethod: + rhs = this._observe(context + "." + protoRec.name + "(" + argString + ")", protoRec); + break; + case proto_record_1.RecordType.SafeMethodInvoke: + var invoke = context + "." + protoRec.name + "(" + argString + ")"; + rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + this._observe(invoke, protoRec); + break; + case proto_record_1.RecordType.InvokeClosure: + rhs = context + "(" + argString + ")"; + break; + case proto_record_1.RecordType.PrimitiveOp: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.CollectionLiteral: + rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; + break; + case proto_record_1.RecordType.Interpolate: + rhs = this._genInterpolation(protoRec); + break; + case proto_record_1.RecordType.KeyedRead: + rhs = this._observe(context + "[" + getLocalName(protoRec.args[0]) + "]", protoRec); + break; + case proto_record_1.RecordType.KeyedWrite: + rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); + break; + case proto_record_1.RecordType.Chain: + rhs = 'null'; + break; + default: + throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); + } + return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; + }; + CodegenLogicUtil.prototype._observe = function(exp, rec) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeValue(" + exp + ", " + rec.selfIndex + ")"; + } else { + return exp; + } + }; + CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { + var _this = this; + var bs = propertyBindingTargets.map(function(b) { + if (lang_1.isBlank(b)) + return "null"; + var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; + return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { + var _this = this; + var bs = directiveRecords.map(function(b) { + return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); + }); + return "[" + bs.join(", ") + "]"; + }; + CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { + var iVals = []; + for (var i = 0; i < protoRec.args.length; ++i) { + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); + iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); + } + iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); + return codegen_facade_1.combineGeneratedStrings(iVals); + }; + CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + res.push(this._names.getDirectiveName(r.directiveIndex) + " = " + this._genReadDirective(i) + ";"); + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype._genReadDirective = function(index) { + if (this._changeDetection === constants_1.ChangeDetectionStrategy.OnPushObserve) { + return "this.observeDirective(this.getDirectiveFor(directives, " + index + "), " + index + ")"; + } else { + return "this.getDirectiveFor(directives, " + index + ")"; + } + }; + CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { + var res = []; + for (var i = 0; i < directiveRecords.length; ++i) { + var r = directiveRecords[i]; + if (!r.isDefaultChangeDetection()) { + res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); + } + } + return res.join("\n"); + }; + CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterContentInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterContentInit();"); + } + if (dir.callAfterContentChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterContentChecked();"); + } + } + return res; + }; + CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { + var res = []; + var eq = lang_1.IS_DART ? '==' : '==='; + for (var i = directiveRecords.length - 1; i >= 0; --i) { + var dir = directiveRecords[i]; + if (dir.callAfterViewInit) { + res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".afterViewInit();"); + } + if (dir.callAfterViewChecked) { + res.push(this._names.getDirectiveName(dir.directiveIndex) + ".afterViewChecked();"); + } + } + return res; + }; + return CodegenLogicUtil; + })(); + exports.CodegenLogicUtil = CodegenLogicUtil; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Subscriber", ["@reactivex/rxjs/dist/cjs/util/noop", "@reactivex/rxjs/dist/cjs/util/throwError", "@reactivex/rxjs/dist/cjs/util/tryOrOnError", "@reactivex/rxjs/dist/cjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + var _createClass = (function() { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + })(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilNoop = require("@reactivex/rxjs/dist/cjs/util/noop"); + var _utilNoop2 = _interopRequireDefault(_utilNoop); + var _utilThrowError = require("@reactivex/rxjs/dist/cjs/util/throwError"); + var _utilThrowError2 = _interopRequireDefault(_utilThrowError); + var _utilTryOrOnError = require("@reactivex/rxjs/dist/cjs/util/tryOrOnError"); + var _utilTryOrOnError2 = _interopRequireDefault(_utilTryOrOnError); + var _Subscription2 = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription3 = _interopRequireDefault(_Subscription2); + var Subscriber = (function(_Subscription) { + _inherits(Subscriber, _Subscription); + function Subscriber(destination) { + _classCallCheck(this, Subscriber); + _Subscription.call(this); + this.destination = destination; + this._isUnsubscribed = false; + if (!this.destination) { + return ; + } + var subscription = destination._subscription; + if (subscription) { + this._subscription = subscription; + } else if (destination instanceof Subscriber) { + this._subscription = destination; + } + } + Subscriber.create = function create(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = typeof next === "function" && _utilTryOrOnError2['default'](next) || _utilNoop2['default']; + subscriber._error = typeof error === "function" && error || _utilThrowError2['default']; + subscriber._complete = typeof complete === "function" && complete || _utilNoop2['default']; + return subscriber; + }; + Subscriber.prototype.add = function add(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _Subscription.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function remove(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _Subscription.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function unsubscribe() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _Subscription.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function _next(value) { + this.destination.next(value); + }; + Subscriber.prototype._error = function _error(err) { + this.destination.error(err); + }; + Subscriber.prototype._complete = function _complete() { + this.destination.complete(); + }; + Subscriber.prototype.next = function next(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function error(_error2) { + if (!this.isUnsubscribed) { + this._error(_error2); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function complete() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + _createClass(Subscriber, [{ + key: 'isUnsubscribed', + get: function get() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function set(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + } + }]); + return Subscriber; + })(_Subscription3['default']); + exports['default'] = Subscriber; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/tryCatch", ["@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = tryCatch; + var _errorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var tryCatchTarget = undefined; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + _errorObject.errorObject.e = e; + return _errorObject.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/util/subscribeToResult", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeToResult; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _InnerSubscriber = require("@reactivex/rxjs/dist/cjs/InnerSubscriber"); + var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof _Observable2['default']) { + if (result._isScalar) { + destination.next(result.value); + destination.complete(); + return ; + } else { + return result.subscribe(destination); + } + } + if (isArray(result)) { + for (var i = 0, + len = result.length; i < len && !destination.isUnsubscribed; i++) { + destination.next(result[i]); + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result.then === 'function') { + result.then(function(x) { + if (!destination.isUnsubscribed) { + destination.next(x); + destination.complete(); + } + }, function(err) { + return destination.error(err); + }).then(null, function(err) { + setTimeout(function() { + throw err; + }); + }); + return destination; + } else if (typeof result[_utilSymbol_iterator2['default']] === 'function') { + for (var _iterator = result, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { + var _ref; + if (_isArray) { + if (_i >= _iterator.length) + break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) + break; + _ref = _i.value; + } + var item = _ref; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[_utilSymbol_observable2['default']] === 'function') { + var obs = result[_utilSymbol_observable2['default']](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction", "@reactivex/rxjs/dist/cjs/schedulers/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var _FutureAction = require("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"); + var _FutureAction2 = _interopRequireDefault(_FutureAction); + var ImmediateScheduler = (function() { + function ImmediateScheduler() { + _classCallCheck(this, ImmediateScheduler); + this.actions = []; + this.active = false; + this.scheduled = false; + } + ImmediateScheduler.prototype.now = function now() { + return Date.now(); + }; + ImmediateScheduler.prototype.flush = function flush() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = undefined; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + ImmediateScheduler.prototype.schedule = function schedule(work, delay, state) { + if (delay === undefined) + delay = 0; + return delay <= 0 ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + ImmediateScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return new _ImmediateAction2['default'](this, work).schedule(state); + }; + ImmediateScheduler.prototype.scheduleLater = function scheduleLater(work, delay, state) { + return new _FutureAction2['default'](this, work).schedule(state, delay); + }; + return ImmediateScheduler; + })(); + exports['default'] = ImmediateScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + _classCallCheck(this, ObserveOnOperator); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnOperator.prototype.call = function call(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_Subscriber) { + _inherits(ObserveOnSubscriber, _Subscriber); + function ObserveOnSubscriber(destination, scheduler) { + var delay = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + _classCallCheck(this, ObserveOnSubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ObserveOnSubscriber.dispatch = function dispatch(_ref) { + var notification = _ref.notification; + var destination = _ref.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype._next = function _next(x) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createNext(x), this.destination))); + }; + ObserveOnSubscriber.prototype._error = function _error(e) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createError(e), this.destination))); + }; + ObserveOnSubscriber.prototype._complete = function _complete() { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(_Notification2['default'].createComplete(), this.destination))); + }; + return ObserveOnSubscriber; + })(_Subscriber3['default']); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = function ObserveOnMessage(notification, destination) { + _classCallCheck(this, ObserveOnMessage); + this.notification = notification; + this.destination = destination; + }; + ; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", ["@reactivex/rxjs/dist/cjs/util/Immediate", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilImmediate = require("@reactivex/rxjs/dist/cjs/util/Immediate"); + var _ImmediateAction2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction3 = _interopRequireDefault(_ImmediateAction2); + var NextTickAction = (function(_ImmediateAction) { + _inherits(NextTickAction, _ImmediateAction); + function NextTickAction() { + _classCallCheck(this, NextTickAction); + _ImmediateAction.apply(this, arguments); + } + NextTickAction.prototype.schedule = function schedule(state) { + var _this = this; + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + if (!scheduler.scheduled) { + scheduler.scheduled = true; + this.id = _utilImmediate.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + NextTickAction.prototype.unsubscribe = function unsubscribe() { + var id = this.id; + var scheduler = this.scheduler; + _ImmediateAction.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + _utilImmediate.Immediate.clearImmediate(id); + } + }; + return NextTickAction; + })(_ImmediateAction3['default']); + exports['default'] = NextTickAction; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/merge-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/mergeAll-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = merge; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _mergeAllSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeAll-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function merge() { + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var last = observables[observables.length - 1]; + if (typeof last.schedule === 'function') { + scheduler = observables.pop(); + if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { + concurrent = observables.pop(); + } + } else if (typeof last === 'number') { + concurrent = observables.pop(); + } + if (observables.length === 1) { + return observables[0]; + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/zip-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = zip; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _zipSupport = require("@reactivex/rxjs/dist/cjs/operators/zip-support"); + function zip() { + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new _observablesArrayObservable2['default'](observables).lift(new _zipSupport.ZipOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMap", ["@reactivex/rxjs/dist/cjs/operators/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMap; + var _mergeMapSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new _mergeMapSupport.MergeMapOperator(project, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo", ["@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concatMapTo; + var _mergeMapToSupport = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new _mergeMapToSupport.MergeMapToOperator(observable, projectResult, 1)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/count", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = count; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilBindCallback = require("@reactivex/rxjs/dist/cjs/util/bindCallback"); + var _utilBindCallback2 = _interopRequireDefault(_utilBindCallback); + function count(predicate, thisArg) { + return this.lift(new CountOperator(predicate, thisArg, this)); + } + var CountOperator = (function() { + function CountOperator(predicate, thisArg, source) { + _classCallCheck(this, CountOperator); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + CountOperator.prototype.call = function call(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.thisArg, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_Subscriber) { + _inherits(CountSubscriber, _Subscriber); + function CountSubscriber(destination, predicate, thisArg, source) { + _classCallCheck(this, CountSubscriber); + _Subscriber.call(this, destination); + this.thisArg = thisArg; + this.source = source; + this.count = 0; + this.index = 0; + if (typeof predicate === 'function') { + this.predicate = _utilBindCallback2['default'](predicate, thisArg, 3); + } + } + CountSubscriber.prototype._next = function _next(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, this.index++, this.source); + if (passed === _utilErrorObject.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function _complete() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/delay", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/schedulers/immediate", "@reactivex/rxjs/dist/cjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = delay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var _utilIsDate = require("@reactivex/rxjs/dist/cjs/util/isDate"); + var _utilIsDate2 = _interopRequireDefault(_utilIsDate); + function delay(delay) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + var absoluteDelay = _utilIsDate2['default'](delay); + var delayFor = absoluteDelay ? +delay - scheduler.now() : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + _classCallCheck(this, DelayOperator); + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function call(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_Subscriber) { + _inherits(DelaySubscriber, _Subscriber); + function DelaySubscriber(destination, delay, scheduler) { + _classCallCheck(this, DelaySubscriber); + _Subscriber.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function dispatch(state) { + var source = state.source; + var queue = source.queue; + var scheduler = state.scheduler; + var destination = state.destination; + while (queue.length > 0 && queue[0].time - scheduler.now() <= 0) { + queue.shift().notification.observe(destination); + } + if (queue.length > 0) { + var _delay = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, _delay); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function _schedule(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function scheduleNotification(notification) { + if (this.errored === true) { + return ; + } + var scheduler = this.scheduler; + var message = new DelayMessage(scheduler.now() + this.delay, notification); + this.queue.push(message); + if (this.active === false) { + this._schedule(scheduler); + } + }; + DelaySubscriber.prototype._next = function _next(value) { + this.scheduleNotification(_Notification2['default'].createNext(value)); + }; + DelaySubscriber.prototype._error = function _error(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function _complete() { + this.scheduleNotification(_Notification2['default'].createComplete()); + }; + return DelaySubscriber; + })(_Subscriber3['default']); + var DelayMessage = function DelayMessage(time, notification) { + _classCallCheck(this, DelayMessage); + this.time = time; + this.notification = notification; + }; + ; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/expand", ["@reactivex/rxjs/dist/cjs/operators/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = expand; + var _expandSupport = require("@reactivex/rxjs/dist/cjs/operators/expand-support"); + function expand(project) { + var concurrent = arguments.length <= 1 || arguments[1] === undefined ? Number.POSITIVE_INFINITY : arguments[1]; + return this.lift(new _expandSupport.ExpandOperator(project, concurrent)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/first", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = first; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber2 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber3 = _interopRequireDefault(_Subscriber2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstOperator); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function call(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_Subscriber) { + _inherits(FirstSubscriber, _Subscriber); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _classCallCheck(this, FirstSubscriber); + _Subscriber.call(this, destination); + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + this.index = 0; + this.hasCompleted = false; + } + FirstSubscriber.prototype._next = function _next(value) { + var destination = this.destination; + var predicate = this.predicate; + var resultSelector = this.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = _utilTryCatch2['default'](predicate)(value, index, this.source); + if (passed === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = _utilTryCatch2['default'](resultSelector)(value, index); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function _complete() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new _utilEmptyError2['default']()); + } + }; + return FirstSubscriber; + })(_Subscriber3['default']); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +/** + @license + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Netflix, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +System.register("@reactivex/rxjs/dist/cjs/Subject", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _subjectsSubjectSubscription = require("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"); + var _subjectsSubjectSubscription2 = _interopRequireDefault(_subjectsSubjectSubscription); + var subscriptionAdd = _Subscription2['default'].prototype.add; + var subscriptionRemove = _Subscription2['default'].prototype.remove; + var subscriptionUnsubscribe = _Subscription2['default'].prototype.unsubscribe; + var subscriberNext = _Subscriber2['default'].prototype.next; + var subscriberError = _Subscriber2['default'].prototype.error; + var subscriberComplete = _Subscriber2['default'].prototype.complete; + var _subscriberNext = _Subscriber2['default'].prototype._next; + var _subscriberError = _Subscriber2['default'].prototype._error; + var _subscriberComplete = _Subscriber2['default'].prototype._complete; + var Subject = (function(_Observable) { + _inherits(Subject, _Observable); + function Subject() { + _classCallCheck(this, Subject); + for (var _len = arguments.length, + args = Array(_len), + _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _Observable.call.apply(_Observable, [this].concat(args)); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.create = function create(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function lift(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function _subscribe(subscriber) { + if (subscriber.isUnsubscribed) { + return ; + } else if (this.errorSignal) { + subscriber.error(this.errorInstance); + return ; + } else if (this.completeSignal) { + subscriber.complete(); + return ; + } else if (this.isUnsubscribed) { + throw new Error("Cannot subscribe to a disposed Subject."); + } + this.observers.push(subscriber); + return new _subjectsSubjectSubscription2['default'](this, subscriber); + }; + Subject.prototype.add = function add(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function remove(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function unsubscribe() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function next(value) { + if (this.isUnsubscribed) { + return ; + } + this.dispatching = true; + this._next(value); + this.dispatching = false; + if (this.errorSignal) { + this.error(this.errorInstance); + } else if (this.completeSignal) { + this.complete(); + } + }; + Subject.prototype.error = function error(_error) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = _error; + if (this.dispatching) { + return ; + } + this._error(_error); + this.unsubscribe(); + }; + Subject.prototype.complete = function complete() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function _next(value) { + var index = -1; + var observers = this.observers.slice(0); + var len = observers.length; + while (++index < len) { + observers[index].next(value); + } + }; + Subject.prototype._error = function _error(error) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(error); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function _complete() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; + })(_Observable3['default']); + exports['default'] = Subject; + var BidirectionalSubject = (function(_Subject) { + _inherits(BidirectionalSubject, _Subject); + function BidirectionalSubject(source, destination) { + _classCallCheck(this, BidirectionalSubject); + _Subject.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function _subscribe(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function next(x) { + subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype.error = function error(e) { + subscriberError.call(this, e); + }; + BidirectionalSubject.prototype.complete = function complete() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function _next(x) { + _subscriberNext.call(this, x); + }; + BidirectionalSubject.prototype._error = function _error(e) { + _subscriberError.call(this, e); + }; + BidirectionalSubject.prototype._complete = function _complete() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/multicast", ["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = multicast; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + function multicast(subjectFactory) { + return new _observablesConnectableObservable2['default'](this, subjectFactory); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/partition", ["@reactivex/rxjs/dist/cjs/util/not", "@reactivex/rxjs/dist/cjs/operators/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = partition; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _utilNot = require("@reactivex/rxjs/dist/cjs/util/not"); + var _utilNot2 = _interopRequireDefault(_utilNot); + var _filter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _filter2 = _interopRequireDefault(_filter); + function partition(predicate, thisArg) { + return [_filter2['default'].call(this, predicate), _filter2['default'].call(this, _utilNot2['default'](predicate, thisArg))]; + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior", ["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishBehavior; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishBehavior(value) { + return _multicast2['default'].call(this, function() { + return new _subjectsBehaviorSubject2['default'](value); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay", ["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/operators/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = publishReplay; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _multicast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _multicast2 = _interopRequireDefault(_multicast); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === undefined) + bufferSize = Number.POSITIVE_INFINITY; + if (windowTime === undefined) + windowTime = Number.POSITIVE_INFINITY; + return _multicast2['default'].call(this, function() { + return new _subjectsReplaySubject2['default'](bufferSize, windowTime, scheduler); + }); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/reduce", ["@reactivex/rxjs/dist/cjs/operators/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = reduce; + var _reduceSupport = require("@reactivex/rxjs/dist/cjs/operators/reduce-support"); + function reduce(project, acc) { + return this.lift(new _reduceSupport.ReduceOperator(project, acc)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn", ["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = subscribeOn; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesSubscribeOnObservable = require("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"); + var _observablesSubscribeOnObservable2 = _interopRequireDefault(_observablesSubscribeOnObservable); + function subscribeOn(scheduler) { + var delay = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + return new _observablesSubscribeOnObservable2['default'](this, delay, scheduler); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/src/core/di", "angular2/src/core/metadata", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var intl_1 = require("angular2/src/facade/intl"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var defaultLocale = 'en-US'; + var DatePipe = (function() { + function DatePipe() {} + DatePipe.prototype.transform = function(value, args) { + if (lang_1.isBlank(value)) + return null; + if (!this.supports(value)) { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); + } + var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; + if (lang_1.isNumber(value)) { + value = lang_1.DateWrapper.fromMillis(value); + } + if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { + pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); + } + return intl_1.DateFormatter.format(value, defaultLocale, pattern); + }; + DatePipe.prototype.supports = function(obj) { + return lang_1.isDate(obj) || lang_1.isNumber(obj); + }; + DatePipe._ALIASES = { + 'medium': 'yMMMdjms', + 'short': 'yMdjm', + 'fullDate': 'yMMMMEEEEd', + 'longDate': 'yMMMMd', + 'mediumDate': 'yMMMd', + 'shortDate': 'yMd', + 'mediumTime': 'jms', + 'shortTime': 'jm' + }; + DatePipe = __decorate([lang_1.CONST(), metadata_1.Pipe({ + name: 'date', + pure: true + }), di_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); + return DatePipe; + })(); + exports.DatePipe = DatePipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var async_1 = require("angular2/src/facade/async"); + var Testability = (function() { + function Testability(_ngZone) { + this._pendingCount = 0; + this._callbacks = []; + this._isAngularEventPending = false; + this._watchAngularEvents(_ngZone); + } + Testability.prototype._watchAngularEvents = function(_ngZone) { + var _this = this; + async_1.ObservableWrapper.subscribe(_ngZone.onTurnStart, function(_) { + _this._isAngularEventPending = true; + }); + _ngZone.runOutsideAngular(function() { + async_1.ObservableWrapper.subscribe(_ngZone.onEventDone, function(_) { + if (!_ngZone.hasPendingTimers) { + _this._isAngularEventPending = false; + _this._runCallbacksIfReady(); + } + }); + }); + }; + Testability.prototype.increasePendingRequestCount = function() { + this._pendingCount += 1; + return this._pendingCount; + }; + Testability.prototype.decreasePendingRequestCount = function() { + this._pendingCount -= 1; + if (this._pendingCount < 0) { + throw new exceptions_1.BaseException('pending async requests below zero'); + } + this._runCallbacksIfReady(); + return this._pendingCount; + }; + Testability.prototype.isStable = function() { + return this._pendingCount == 0 && !this._isAngularEventPending; + }; + Testability.prototype._runCallbacksIfReady = function() { + var _this = this; + if (!this.isStable()) { + return ; + } + async_1.PromiseWrapper.resolve(null).then(function(_) { + while (_this._callbacks.length !== 0) { + (_this._callbacks.pop())(); + } + }); + }; + Testability.prototype.whenStable = function(callback) { + this._callbacks.push(callback); + this._runCallbacksIfReady(); + }; + Testability.prototype.getPendingRequestCount = function() { + return this._pendingCount; + }; + Testability.prototype.isAngularEventPending = function() { + return this._isAngularEventPending; + }; + Testability.prototype.findBindings = function(using, provider, exactMatch) { + return []; + }; + Testability.prototype.findProviders = function(using, provider, exactMatch) { + return []; + }; + Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); + return Testability; + })(); + exports.Testability = Testability; + var TestabilityRegistry = (function() { + function TestabilityRegistry() { + this._applications = new collection_1.Map(); + testabilityGetter.addToWindow(this); + } + TestabilityRegistry.prototype.registerApplication = function(token, testability) { + this._applications.set(token, testability); + }; + TestabilityRegistry.prototype.getAllTestabilities = function() { + return collection_1.MapWrapper.values(this._applications); + }; + TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { + if (findInAncestors === void 0) { + findInAncestors = true; + } + if (elem == null) { + return null; + } + if (this._applications.has(elem)) { + return this._applications.get(elem); + } else if (!findInAncestors) { + return null; + } + if (dom_adapter_1.DOM.isShadowRoot(elem)) { + return this.findTestabilityInTree(dom_adapter_1.DOM.getHost(elem)); + } + return this.findTestabilityInTree(dom_adapter_1.DOM.parentElement(elem)); + }; + TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); + return TestabilityRegistry; + })(); + exports.TestabilityRegistry = TestabilityRegistry; + var NoopGetTestability = (function() { + function NoopGetTestability() {} + NoopGetTestability.prototype.addToWindow = function(registry) {}; + NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], NoopGetTestability); + return NoopGetTestability; + })(); + function setTestabilityGetter(getter) { + testabilityGetter = getter; + } + exports.setTestabilityGetter = setTestabilityGetter; + var testabilityGetter = lang_1.CONST_EXPR(new NoopGetTestability()); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var cd = require("angular2/src/core/change_detection/pipes"); + var ProtoPipes = (function() { + function ProtoPipes(config) { + this.config = config; + this.config = config; + } + ProtoPipes.fromProviders = function(providers) { + var config = {}; + providers.forEach(function(b) { + return config[b.name] = b; + }); + return new ProtoPipes(config); + }; + ProtoPipes.prototype.get = function(name) { + var provider = this.config[name]; + if (lang_1.isBlank(provider)) + throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); + return provider; + }; + return ProtoPipes; + })(); + exports.ProtoPipes = ProtoPipes; + var Pipes = (function() { + function Pipes(proto, injector) { + this.proto = proto; + this.injector = injector; + this._config = {}; + } + Pipes.prototype.get = function(name) { + var cached = collection_1.StringMapWrapper.get(this._config, name); + if (lang_1.isPresent(cached)) + return cached; + var p = this.proto.get(name); + var transform = this.injector.instantiateResolved(p); + var res = new cd.SelectedPipe(transform, p.pure); + if (p.pure) { + collection_1.StringMapWrapper.set(this._config, name, res); + } + return res; + }; + return Pipes; + })(); + exports.Pipes = Pipes; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/render/dom/util", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var util_1 = require("angular2/src/core/render/dom/util"); + var view_ref_2 = require("angular2/src/core/linker/view_ref"); + var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); + exports.DebugContext = interfaces_2.DebugContext; + var REFLECT_PREFIX = 'ng-reflect-'; + (function(ViewType) { + ViewType[ViewType["HOST"] = 0] = "HOST"; + ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; + ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; + })(exports.ViewType || (exports.ViewType = {})); + var ViewType = exports.ViewType; + var AppViewContainer = (function() { + function AppViewContainer() { + this.views = []; + } + return AppViewContainer; + })(); + exports.AppViewContainer = AppViewContainer; + var AppView = (function() { + function AppView(renderer, proto, viewOffset, elementOffset, textOffset, protoLocals, render, renderFragment, containerElementInjector) { + this.renderer = renderer; + this.proto = proto; + this.viewOffset = viewOffset; + this.elementOffset = elementOffset; + this.textOffset = textOffset; + this.render = render; + this.renderFragment = renderFragment; + this.containerElementInjector = containerElementInjector; + this.views = null; + this.elementInjectors = null; + this.viewContainers = null; + this.preBuiltObjects = null; + this.changeDetector = null; + this.context = null; + this.ref = new view_ref_2.ViewRef_(this); + this.locals = new change_detection_1.Locals(null, collection_1.MapWrapper.clone(protoLocals)); + } + AppView.prototype.init = function(changeDetector, elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers) { + this.changeDetector = changeDetector; + this.elementInjectors = elementInjectors; + this.rootElementInjectors = rootElementInjectors; + this.preBuiltObjects = preBuiltObjects; + this.views = views; + this.elementRefs = elementRefs; + this.viewContainers = viewContainers; + }; + AppView.prototype.setLocal = function(contextName, value) { + if (!this.hydrated()) + throw new exceptions_1.BaseException('Cannot set locals on dehydrated view.'); + if (!this.proto.templateVariableBindings.has(contextName)) { + return ; + } + var templateName = this.proto.templateVariableBindings.get(contextName); + this.locals.set(templateName, value); + }; + AppView.prototype.hydrated = function() { + return lang_1.isPresent(this.context); + }; + AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { + var locals = new collection_1.Map(); + locals.set('$event', eventObj); + this.dispatchEvent(boundElementIndex, eventName, locals); + }; + AppView.prototype.notifyOnBinding = function(b, currentValue) { + if (b.isTextNode()) { + this.renderer.setText(this.render, b.elementIndex + this.textOffset, currentValue); + } else { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + if (b.isElementProperty()) { + this.renderer.setElementProperty(elementRef, b.name, currentValue); + } else if (b.isElementAttribute()) { + this.renderer.setElementAttribute(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); + } else if (b.isElementClass()) { + this.renderer.setElementClass(elementRef, b.name, currentValue); + } else if (b.isElementStyle()) { + var unit = lang_1.isPresent(b.unit) ? b.unit : ''; + this.renderer.setElementStyle(elementRef, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); + } else { + throw new exceptions_1.BaseException('Unsupported directive record'); + } + } + }; + AppView.prototype.logBindingUpdate = function(b, value) { + if (b.isDirective() || b.isElementProperty()) { + var elementRef = this.elementRefs[this.elementOffset + b.elementIndex]; + this.renderer.setElementAttribute(elementRef, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); + } + }; + AppView.prototype.notifyAfterContentChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterContentChecked(); + } + }; + AppView.prototype.notifyAfterViewChecked = function() { + var eiCount = this.proto.elementBinders.length; + var ei = this.elementInjectors; + for (var i = eiCount - 1; i >= 0; i--) { + if (lang_1.isPresent(ei[i + this.elementOffset])) + ei[i + this.elementOffset].afterViewChecked(); + } + }; + AppView.prototype.getDirectiveFor = function(directive) { + var elementInjector = this.elementInjectors[this.elementOffset + directive.elementIndex]; + return elementInjector.getDirectiveAtIndex(directive.directiveIndex); + }; + AppView.prototype.getNestedView = function(boundElementIndex) { + var eli = this.elementInjectors[boundElementIndex]; + return lang_1.isPresent(eli) ? eli.getNestedView() : null; + }; + AppView.prototype.getContainerElement = function() { + return lang_1.isPresent(this.containerElementInjector) ? this.containerElementInjector.getElementRef() : null; + }; + AppView.prototype.getDebugContext = function(elementIndex, directiveIndex) { + try { + var offsettedIndex = this.elementOffset + elementIndex; + var hasRefForIndex = offsettedIndex < this.elementRefs.length; + var elementRef = hasRefForIndex ? this.elementRefs[this.elementOffset + elementIndex] : null; + var container = this.getContainerElement(); + var ei = hasRefForIndex ? this.elementInjectors[this.elementOffset + elementIndex] : null; + var element = lang_1.isPresent(elementRef) ? elementRef.nativeElement : null; + var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; + var directive = lang_1.isPresent(directiveIndex) ? this.getDirectiveFor(directiveIndex) : null; + var injector = lang_1.isPresent(ei) ? ei.getInjector() : null; + return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); + } catch (e) { + return null; + } + }; + AppView.prototype.getDetectorFor = function(directive) { + var childView = this.getNestedView(this.elementOffset + directive.elementIndex); + return lang_1.isPresent(childView) ? childView.changeDetector : null; + }; + AppView.prototype.invokeElementMethod = function(elementIndex, methodName, args) { + this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); + }; + AppView.prototype.dispatchRenderEvent = function(boundElementIndex, eventName, locals) { + var elementRef = this.elementRefs[boundElementIndex]; + var view = view_ref_1.internalView(elementRef.parentView); + return view.dispatchEvent(elementRef.boundElementIndex, eventName, locals); + }; + AppView.prototype.dispatchEvent = function(boundElementIndex, eventName, locals) { + try { + if (this.hydrated()) { + return !this.changeDetector.handleEvent(eventName, boundElementIndex - this.elementOffset, new change_detection_1.Locals(this.locals, locals)); + } else { + return true; + } + } catch (e) { + var c = this.getDebugContext(boundElementIndex - this.elementOffset, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector) : null; + throw new EventEvaluationError(eventName, e, e.stack, context); + } + }; + Object.defineProperty(AppView.prototype, "ownBindersCount", { + get: function() { + return this.proto.elementBinders.length; + }, + enumerable: true, + configurable: true + }); + return AppView; + })(); + exports.AppView = AppView; + function _localsToStringMap(locals) { + var res = {}; + var c = locals; + while (lang_1.isPresent(c)) { + res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); + c = c.parent; + } + return res; + } + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + } + return _Context; + })(); + var EventEvaluationError = (function(_super) { + __extends(EventEvaluationError, _super); + function EventEvaluationError(eventName, originalException, originalStack, context) { + _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); + } + return EventEvaluationError; + })(exceptions_1.WrappedException); + var AppProtoViewMergeInfo = (function() { + function AppProtoViewMergeInfo(embeddedViewCount, elementCount, viewCount) { + this.embeddedViewCount = embeddedViewCount; + this.elementCount = elementCount; + this.viewCount = viewCount; + } + return AppProtoViewMergeInfo; + })(); + exports.AppProtoViewMergeInfo = AppProtoViewMergeInfo; + var AppProtoView = (function() { + function AppProtoView(templateId, templateCmds, type, isMergable, changeDetectorFactory, templateVariableBindings, pipes) { + this.templateId = templateId; + this.templateCmds = templateCmds; + this.type = type; + this.isMergable = isMergable; + this.changeDetectorFactory = changeDetectorFactory; + this.templateVariableBindings = templateVariableBindings; + this.pipes = pipes; + this.elementBinders = null; + this.mergeInfo = null; + this.variableLocations = null; + this.textBindingCount = null; + this.render = null; + this.ref = new view_ref_2.ProtoViewRef_(this); + } + AppProtoView.prototype.init = function(render, elementBinders, textBindingCount, mergeInfo, variableLocations) { + var _this = this; + this.render = render; + this.elementBinders = elementBinders; + this.textBindingCount = textBindingCount; + this.mergeInfo = mergeInfo; + this.variableLocations = variableLocations; + this.protoLocals = new collection_1.Map(); + if (lang_1.isPresent(this.templateVariableBindings)) { + this.templateVariableBindings.forEach(function(templateName, _) { + _this.protoLocals.set(templateName, null); + }); + } + if (lang_1.isPresent(variableLocations)) { + variableLocations.forEach(function(_, templateName) { + _this.protoLocals.set(templateName, null); + }); + } + }; + AppProtoView.prototype.isInitialized = function() { + return lang_1.isPresent(this.elementBinders); + }; + return AppProtoView; + })(); + exports.AppProtoView = AppProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager_utils", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/linker/element_injector", "angular2/src/facade/lang", "angular2/src/core/linker/view", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/pipes/pipes"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var eli = require("angular2/src/core/linker/element_injector"); + var lang_1 = require("angular2/src/facade/lang"); + var viewModule = require("angular2/src/core/linker/view"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var AppViewManagerUtils = (function() { + function AppViewManagerUtils() {} + AppViewManagerUtils.prototype.getComponentInstance = function(parentView, boundElementIndex) { + var eli = parentView.elementInjectors[boundElementIndex]; + return eli.getComponent(); + }; + AppViewManagerUtils.prototype.createView = function(mergedParentViewProto, renderViewWithFragments, viewManager, renderer) { + var renderFragments = renderViewWithFragments.fragmentRefs; + var renderView = renderViewWithFragments.viewRef; + var elementCount = mergedParentViewProto.mergeInfo.elementCount; + var viewCount = mergedParentViewProto.mergeInfo.viewCount; + var elementRefs = collection_1.ListWrapper.createFixedSize(elementCount); + var viewContainers = collection_1.ListWrapper.createFixedSize(elementCount); + var preBuiltObjects = collection_1.ListWrapper.createFixedSize(elementCount); + var elementInjectors = collection_1.ListWrapper.createFixedSize(elementCount); + var views = collection_1.ListWrapper.createFixedSize(viewCount); + var elementOffset = 0; + var textOffset = 0; + var fragmentIdx = 0; + var containerElementIndicesByViewIndex = collection_1.ListWrapper.createFixedSize(viewCount); + for (var viewOffset = 0; viewOffset < viewCount; viewOffset++) { + var containerElementIndex = containerElementIndicesByViewIndex[viewOffset]; + var containerElementInjector = lang_1.isPresent(containerElementIndex) ? elementInjectors[containerElementIndex] : null; + var parentView = lang_1.isPresent(containerElementInjector) ? preBuiltObjects[containerElementIndex].view : null; + var protoView = lang_1.isPresent(containerElementIndex) ? parentView.proto.elementBinders[containerElementIndex - parentView.elementOffset].nestedProtoView : mergedParentViewProto; + var renderFragment = null; + if (viewOffset === 0 || protoView.type === viewModule.ViewType.EMBEDDED) { + renderFragment = renderFragments[fragmentIdx++]; + } + var currentView = new viewModule.AppView(renderer, protoView, viewOffset, elementOffset, textOffset, protoView.protoLocals, renderView, renderFragment, containerElementInjector); + views[viewOffset] = currentView; + if (lang_1.isPresent(containerElementIndex)) { + preBuiltObjects[containerElementIndex].nestedView = currentView; + } + var rootElementInjectors = []; + var nestedViewOffset = viewOffset + 1; + for (var binderIdx = 0; binderIdx < protoView.elementBinders.length; binderIdx++) { + var binder = protoView.elementBinders[binderIdx]; + var boundElementIndex = elementOffset + binderIdx; + var elementInjector = null; + if (lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.isMergable) { + containerElementIndicesByViewIndex[nestedViewOffset] = boundElementIndex; + nestedViewOffset += binder.nestedProtoView.mergeInfo.viewCount; + } + var protoElementInjector = binder.protoElementInjector; + if (lang_1.isPresent(protoElementInjector)) { + if (lang_1.isPresent(protoElementInjector.parent)) { + var parentElementInjector = elementInjectors[elementOffset + protoElementInjector.parent.index]; + elementInjector = protoElementInjector.instantiate(parentElementInjector); + } else { + elementInjector = protoElementInjector.instantiate(null); + rootElementInjectors.push(elementInjector); + } + } + elementInjectors[boundElementIndex] = elementInjector; + var el = new element_ref_1.ElementRef_(currentView.ref, boundElementIndex, renderer); + elementRefs[el.boundElementIndex] = el; + if (lang_1.isPresent(elementInjector)) { + var templateRef = lang_1.isPresent(binder.nestedProtoView) && binder.nestedProtoView.type === viewModule.ViewType.EMBEDDED ? new template_ref_1.TemplateRef_(el) : null; + preBuiltObjects[boundElementIndex] = new eli.PreBuiltObjects(viewManager, currentView, el, templateRef); + } + } + currentView.init(protoView.changeDetectorFactory(currentView), elementInjectors, rootElementInjectors, preBuiltObjects, views, elementRefs, viewContainers); + if (lang_1.isPresent(parentView) && protoView.type === viewModule.ViewType.COMPONENT) { + parentView.changeDetector.addViewChild(currentView.changeDetector); + } + elementOffset += protoView.elementBinders.length; + textOffset += protoView.textBindingCount; + } + return views[0]; + }; + AppViewManagerUtils.prototype.hydrateRootHostView = function(hostView, injector) { + this._hydrateView(hostView, injector, null, new Object(), null); + }; + AppViewManagerUtils.prototype.attachViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + parentView.changeDetector.addContentChild(view.changeDetector); + var viewContainer = parentView.viewContainers[boundElementIndex]; + if (lang_1.isBlank(viewContainer)) { + viewContainer = new viewModule.AppViewContainer(); + parentView.viewContainers[boundElementIndex] = viewContainer; + } + collection_1.ListWrapper.insert(viewContainer.views, index, view); + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { + if (lang_1.isPresent(elementInjector.parent)) { + view.rootElementInjectors[i].link(elementInjector.parent); + } + } + elementInjector.traverseAndSetQueriesAsDirty(); + }; + AppViewManagerUtils.prototype.detachViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty(); + view.changeDetector.remove(); + collection_1.ListWrapper.removeAt(viewContainer.views, index); + for (var i = 0; i < view.rootElementInjectors.length; ++i) { + var inj = view.rootElementInjectors[i]; + inj.unlink(); + } + }; + AppViewManagerUtils.prototype.hydrateViewInContainer = function(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedProviders) { + if (lang_1.isBlank(contextView)) { + contextView = parentView; + contextBoundElementIndex = boundElementIndex; + } + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; + var injector = lang_1.isPresent(imperativelyCreatedProviders) ? di_1.Injector.fromResolvedProviders(imperativelyCreatedProviders) : null; + this._hydrateView(view, injector, elementInjector.getHost(), contextView.context, contextView.locals); + }; + AppViewManagerUtils.prototype._hydrateView = function(initView, imperativelyCreatedInjector, hostElementInjector, context, parentLocals) { + var viewIdx = initView.viewOffset; + var endViewOffset = viewIdx + initView.proto.mergeInfo.viewCount - 1; + while (viewIdx <= endViewOffset) { + var currView = initView.views[viewIdx]; + var currProtoView = currView.proto; + if (currView !== initView && currView.proto.type === viewModule.ViewType.EMBEDDED) { + viewIdx += currView.proto.mergeInfo.viewCount; + } else { + if (currView !== initView) { + imperativelyCreatedInjector = null; + parentLocals = null; + hostElementInjector = currView.containerElementInjector; + context = hostElementInjector.getComponent(); + } + currView.context = context; + currView.locals.parent = parentLocals; + var binders = currProtoView.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var boundElementIndex = binderIdx + currView.elementOffset; + var elementInjector = initView.elementInjectors[boundElementIndex]; + if (lang_1.isPresent(elementInjector)) { + elementInjector.hydrate(imperativelyCreatedInjector, hostElementInjector, currView.preBuiltObjects[boundElementIndex]); + this._populateViewLocals(currView, elementInjector, boundElementIndex); + this._setUpEventEmitters(currView, elementInjector, boundElementIndex); + } + } + var pipes = lang_1.isPresent(hostElementInjector) ? new pipes_1.Pipes(currView.proto.pipes, hostElementInjector.getInjector()) : null; + currView.changeDetector.hydrate(currView.context, currView.locals, currView, pipes); + viewIdx++; + } + } + }; + AppViewManagerUtils.prototype._populateViewLocals = function(view, elementInjector, boundElementIdx) { + if (lang_1.isPresent(elementInjector.getDirectiveVariableBindings())) { + elementInjector.getDirectiveVariableBindings().forEach(function(directiveIndex, name) { + if (lang_1.isBlank(directiveIndex)) { + view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement); + } else { + view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex)); + } + }); + } + }; + AppViewManagerUtils.prototype._setUpEventEmitters = function(view, elementInjector, boundElementIndex) { + var emitters = elementInjector.getEventEmitterAccessors(); + for (var directiveIndex = 0; directiveIndex < emitters.length; ++directiveIndex) { + var directiveEmitters = emitters[directiveIndex]; + var directive = elementInjector.getDirectiveAtIndex(directiveIndex); + for (var eventIndex = 0; eventIndex < directiveEmitters.length; ++eventIndex) { + var eventEmitterAccessor = directiveEmitters[eventIndex]; + eventEmitterAccessor.subscribe(view, boundElementIndex, directive); + } + } + }; + AppViewManagerUtils.prototype.dehydrateView = function(initView) { + var endViewOffset = initView.viewOffset + initView.proto.mergeInfo.viewCount - 1; + for (var viewIdx = initView.viewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = initView.views[viewIdx]; + if (currView.hydrated()) { + if (lang_1.isPresent(currView.locals)) { + currView.locals.clearValues(); + } + currView.context = null; + currView.changeDetector.dehydrate(); + var binders = currView.proto.elementBinders; + for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) { + var eli = initView.elementInjectors[currView.elementOffset + binderIdx]; + if (lang_1.isPresent(eli)) { + eli.dehydrate(); + } + } + } + } + }; + AppViewManagerUtils = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], AppViewManagerUtils); + return AppViewManagerUtils; + })(); + exports.AppViewManagerUtils = AppViewManagerUtils; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function hasLifecycleHook(lcInterface, token) { + if (!(token instanceof lang_1.Type)) + return false; + var proto = token.prototype; + switch (lcInterface) { + case interfaces_1.LifecycleHooks.AfterContentInit: + return !!proto.afterContentInit; + case interfaces_1.LifecycleHooks.AfterContentChecked: + return !!proto.afterContentChecked; + case interfaces_1.LifecycleHooks.AfterViewInit: + return !!proto.afterViewInit; + case interfaces_1.LifecycleHooks.AfterViewChecked: + return !!proto.afterViewChecked; + case interfaces_1.LifecycleHooks.OnChanges: + return !!proto.onChanges; + case interfaces_1.LifecycleHooks.DoCheck: + return !!proto.doCheck; + case interfaces_1.LifecycleHooks.OnDestroy: + return !!proto.onDestroy; + case interfaces_1.LifecycleHooks.OnInit: + return !!proto.onInit; + default: + return false; + } + } + exports.hasLifecycleHook = hasLifecycleHook; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/shared_styles_host", ["angular2/src/core/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/dom/dom_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var SharedStylesHost = (function() { + function SharedStylesHost() { + this._styles = []; + this._stylesSet = new Set(); + } + SharedStylesHost.prototype.addStyles = function(styles) { + var _this = this; + var additions = []; + styles.forEach(function(style) { + if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { + _this._stylesSet.add(style); + _this._styles.push(style); + additions.push(style); + } + }); + this.onStylesAdded(additions); + }; + SharedStylesHost.prototype.onStylesAdded = function(additions) {}; + SharedStylesHost.prototype.getAllStyles = function() { + return this._styles; + }; + SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); + return SharedStylesHost; + })(); + exports.SharedStylesHost = SharedStylesHost; + var DomSharedStylesHost = (function(_super) { + __extends(DomSharedStylesHost, _super); + function DomSharedStylesHost(doc) { + _super.call(this); + this._hostNodes = new Set(); + this._hostNodes.add(doc.head); + } + DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); + } + }; + DomSharedStylesHost.prototype.addHost = function(hostNode) { + this._addStylesToHost(this._styles, hostNode); + this._hostNodes.add(hostNode); + }; + DomSharedStylesHost.prototype.removeHost = function(hostNode) { + collection_1.SetWrapper.delete(this._hostNodes, hostNode); + }; + DomSharedStylesHost.prototype.onStylesAdded = function(additions) { + var _this = this; + this._hostNodes.forEach(function(hostNode) { + _this._addStylesToHost(additions, hostNode); + }); + }; + DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); + return DomSharedStylesHost; + })(SharedStylesHost); + exports.DomSharedStylesHost = DomSharedStylesHost; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/core/render/dom/util", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var math_1 = require("angular2/src/facade/math"); + var util_1 = require("angular2/src/core/render/dom/util"); + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var Animation = (function() { + function Animation(element, data, browserDetails) { + var _this = this; + this.element = element; + this.data = data; + this.browserDetails = browserDetails; + this.callbacks = []; + this.eventClearFunctions = []; + this.completed = false; + this._stringPrefix = ''; + this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); + this.setup(); + this.wait(function(timestamp) { + return _this.start(); + }); + } + Object.defineProperty(Animation.prototype, "totalTime", { + get: function() { + var delay = this.computedDelay != null ? this.computedDelay : 0; + var duration = this.computedDuration != null ? this.computedDuration : 0; + return delay + duration; + }, + enumerable: true, + configurable: true + }); + Animation.prototype.wait = function(callback) { + this.browserDetails.raf(callback, 2); + }; + Animation.prototype.setup = function() { + if (this.data.fromStyles != null) + this.applyStyles(this.data.fromStyles); + if (this.data.duration != null) + this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); + if (this.data.delay != null) + this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); + }; + Animation.prototype.start = function() { + this.addClasses(this.data.classesToAdd); + this.addClasses(this.data.animationClasses); + this.removeClasses(this.data.classesToRemove); + if (this.data.toStyles != null) + this.applyStyles(this.data.toStyles); + var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); + this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); + this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); + this.addEvents(); + }; + Animation.prototype.applyStyles = function(styles) { + var _this = this; + collection_1.StringMapWrapper.forEach(styles, function(value, key) { + var dashCaseKey = util_1.camelCaseToDashCase(key); + if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { + dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); + } else { + dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); + } + }); + }; + Animation.prototype.addClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.addClass(this.element, classes[i]); + }; + Animation.prototype.removeClasses = function(classes) { + for (var i = 0, + len = classes.length; i < len; i++) + dom_adapter_1.DOM.removeClass(this.element, classes[i]); + }; + Animation.prototype.addEvents = function() { + var _this = this; + if (this.totalTime > 0) { + this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { + return _this.handleAnimationEvent(event); + })); + } else { + this.handleAnimationCompleted(); + } + }; + Animation.prototype.handleAnimationEvent = function(event) { + var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); + if (!this.browserDetails.elapsedTimeIncludesDelay) + elapsedTime += this.computedDelay; + event.stopPropagation(); + if (elapsedTime >= this.totalTime) + this.handleAnimationCompleted(); + }; + Animation.prototype.handleAnimationCompleted = function() { + this.removeClasses(this.data.animationClasses); + this.callbacks.forEach(function(callback) { + return callback(); + }); + this.callbacks = []; + this.eventClearFunctions.forEach(function(fn) { + return fn(); + }); + this.eventClearFunctions = []; + this.completed = true; + }; + Animation.prototype.onComplete = function(callback) { + if (this.completed) { + callback(); + } else { + this.callbacks.push(callback); + } + return this; + }; + Animation.prototype.parseDurationString = function(duration) { + var maxValue = 0; + if (duration == null || duration.length < 2) { + return maxValue; + } else if (duration.substring(duration.length - 2) == 'ms') { + var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); + if (value > maxValue) + maxValue = value; + } else if (duration.substring(duration.length - 1) == 's') { + var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; + var value = math_1.Math.floor(ms); + if (value > maxValue) + maxValue = value; + } + return maxValue; + }; + Animation.prototype.stripLetters = function(str) { + return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); + }; + return Animation; + })(); + exports.Animation = Animation; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/view", "angular2/src/core/metadata", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var view_1 = require("angular2/src/core/render/view"); + var metadata_1 = require("angular2/src/core/metadata"); + var collection_1 = require("angular2/src/facade/collection"); + function encapsulateStyles(componentTemplate) { + var processedStyles = componentTemplate.styles; + if (componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated) { + processedStyles = collection_1.ListWrapper.createFixedSize(componentTemplate.styles.length); + for (var i = 0; i < componentTemplate.styles.length; i++) { + processedStyles[i] = lang_1.StringWrapper.replaceAll(componentTemplate.styles[i], COMPONENT_REGEX, componentTemplate.shortId); + } + } + return processedStyles; + } + exports.encapsulateStyles = encapsulateStyles; + function createRenderView(componentTemplate, cmds, inplaceElement, nodeFactory) { + var view; + var eventDispatcher = function(boundElementIndex, eventName, event) { + return view.dispatchRenderEvent(boundElementIndex, eventName, event); + }; + var context = new BuildContext(eventDispatcher, nodeFactory, inplaceElement); + context.build(componentTemplate, cmds); + var fragments = []; + for (var i = 0; i < context.fragments.length; i++) { + fragments.push(new view_1.DefaultRenderFragmentRef(context.fragments[i])); + } + view = new view_1.DefaultRenderView(fragments, context.boundTextNodes, context.boundElements, context.nativeShadowRoots, context.globalEventAdders, context.rootContentInsertionPoints); + return view; + } + exports.createRenderView = createRenderView; + var BuildContext = (function() { + function BuildContext(_eventDispatcher, factory, _inplaceElement) { + this._eventDispatcher = _eventDispatcher; + this.factory = factory; + this._inplaceElement = _inplaceElement; + this._builders = []; + this.globalEventAdders = []; + this.boundElements = []; + this.boundTextNodes = []; + this.nativeShadowRoots = []; + this.fragments = []; + this.rootContentInsertionPoints = []; + this.componentCount = 0; + this.isHost = lang_1.isPresent((_inplaceElement)); + } + BuildContext.prototype.build = function(template, cmds) { + this.enqueueRootBuilder(template, cmds); + this._build(this._builders[0]); + }; + BuildContext.prototype._build = function(builder) { + this._builders = []; + builder.build(this); + var enqueuedBuilders = this._builders; + for (var i = 0; i < enqueuedBuilders.length; i++) { + this._build(enqueuedBuilders[i]); + } + }; + BuildContext.prototype.enqueueComponentBuilder = function(component) { + this.componentCount++; + this._builders.push(new RenderViewBuilder(component, null, component.template, component.template.commands)); + }; + BuildContext.prototype.enqueueFragmentBuilder = function(parentComponent, parentTemplate, commands) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(parentComponent, rootNodes, parentTemplate, commands)); + }; + BuildContext.prototype.enqueueRootBuilder = function(template, cmds) { + var rootNodes = []; + this.fragments.push(rootNodes); + this._builders.push(new RenderViewBuilder(null, rootNodes, template, cmds)); + }; + BuildContext.prototype.consumeInplaceElement = function() { + var result = this._inplaceElement; + this._inplaceElement = null; + return result; + }; + BuildContext.prototype.addEventListener = function(boundElementIndex, target, eventName) { + if (lang_1.isPresent(target)) { + var handler = createEventHandler(boundElementIndex, target + ":" + eventName, this._eventDispatcher); + this.globalEventAdders.push(createGlobalEventAdder(target, eventName, handler, this.factory)); + } else { + var handler = createEventHandler(boundElementIndex, eventName, this._eventDispatcher); + this.factory.on(this.boundElements[boundElementIndex], eventName, handler); + } + }; + return BuildContext; + })(); + function createEventHandler(boundElementIndex, eventName, eventDispatcher) { + return function($event) { + return eventDispatcher(boundElementIndex, eventName, $event); + }; + } + function createGlobalEventAdder(target, eventName, eventHandler, nodeFactory) { + return function() { + return nodeFactory.globalOn(target, eventName, eventHandler); + }; + } + var RenderViewBuilder = (function() { + function RenderViewBuilder(parentComponent, fragmentRootNodes, template, cmds) { + this.parentComponent = parentComponent; + this.fragmentRootNodes = fragmentRootNodes; + this.template = template; + this.cmds = cmds; + var rootNodesParent = lang_1.isPresent(fragmentRootNodes) ? null : parentComponent.shadowRoot; + this.parentStack = [rootNodesParent]; + } + RenderViewBuilder.prototype.build = function(context) { + var cmds = this.cmds; + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(this, context); + } + }; + Object.defineProperty(RenderViewBuilder.prototype, "parent", { + get: function() { + return this.parentStack[this.parentStack.length - 1]; + }, + enumerable: true, + configurable: true + }); + RenderViewBuilder.prototype.visitText = function(cmd, context) { + var text = context.factory.createText(cmd.value); + this._addChild(text, cmd.ngContentIndex, context); + if (cmd.isBound) { + context.boundTextNodes.push(text); + } + return null; + }; + RenderViewBuilder.prototype.visitNgContent = function(cmd, context) { + if (lang_1.isPresent(this.parentComponent)) { + if (this.parentComponent.isRoot) { + var insertionPoint = context.factory.createRootContentInsertionPoint(); + if (this.parent instanceof Component) { + context.factory.appendChild(this.parent.shadowRoot, insertionPoint); + } else { + context.factory.appendChild(this.parent, insertionPoint); + } + context.rootContentInsertionPoints.push(insertionPoint); + } else { + var projectedNodes = this.parentComponent.project(cmd.index); + for (var i = 0; i < projectedNodes.length; i++) { + var node = projectedNodes[i]; + this._addChild(node, cmd.ngContentIndex, context); + } + } + } + return null; + }; + RenderViewBuilder.prototype.visitBeginElement = function(cmd, context) { + this.parentStack.push(this._beginElement(cmd, context, null)); + return null; + }; + RenderViewBuilder.prototype.visitEndElement = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitBeginComponent = function(cmd, context) { + var templateId = cmd.templateId; + var tpl = context.factory.resolveComponentTemplate(templateId); + var el = this._beginElement(cmd, context, tpl); + var root = el; + if (tpl.encapsulation === metadata_1.ViewEncapsulation.Native) { + root = context.factory.createShadowRoot(el, templateId); + context.nativeShadowRoots.push(root); + } + var isRoot = context.componentCount === 0 && context.isHost; + var component = new Component(el, root, isRoot, tpl); + context.enqueueComponentBuilder(component); + this.parentStack.push(component); + return null; + }; + RenderViewBuilder.prototype.visitEndComponent = function(context) { + this._endElement(); + return null; + }; + RenderViewBuilder.prototype.visitEmbeddedTemplate = function(cmd, context) { + var el = context.factory.createTemplateAnchor(cmd.attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + context.boundElements.push(el); + if (cmd.isMerged) { + context.enqueueFragmentBuilder(this.parentComponent, this.template, cmd.children); + } + return null; + }; + RenderViewBuilder.prototype._beginElement = function(cmd, context, componentTemplate) { + var el = context.consumeInplaceElement(); + var attrNameAndValues = cmd.attrNameAndValues; + var templateEmulatedEncapsulation = this.template.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var componentEmulatedEncapsulation = lang_1.isPresent(componentTemplate) && componentTemplate.encapsulation === metadata_1.ViewEncapsulation.Emulated; + var newAttrLength = attrNameAndValues.length + (templateEmulatedEncapsulation ? 2 : 0) + (componentEmulatedEncapsulation ? 2 : 0); + if (newAttrLength > attrNameAndValues.length) { + var newAttrNameAndValues = collection_1.ListWrapper.createFixedSize(newAttrLength); + var attrIndex; + for (attrIndex = 0; attrIndex < attrNameAndValues.length; attrIndex++) { + newAttrNameAndValues[attrIndex] = attrNameAndValues[attrIndex]; + } + if (templateEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimContentAttribute(this.template.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + if (componentEmulatedEncapsulation) { + newAttrNameAndValues[attrIndex++] = _shimHostAttribute(componentTemplate.shortId); + newAttrNameAndValues[attrIndex++] = ''; + } + attrNameAndValues = newAttrNameAndValues; + } + if (lang_1.isPresent(el)) { + context.factory.mergeElement(el, attrNameAndValues); + this.fragmentRootNodes.push(el); + } else { + el = context.factory.createElement(cmd.name, attrNameAndValues); + this._addChild(el, cmd.ngContentIndex, context); + } + if (cmd.isBound) { + var boundElementIndex = context.boundElements.length; + context.boundElements.push(el); + for (var i = 0; i < cmd.eventTargetAndNames.length; i += 2) { + var target = cmd.eventTargetAndNames[i]; + var eventName = cmd.eventTargetAndNames[i + 1]; + context.addEventListener(boundElementIndex, target, eventName); + } + } + return el; + }; + RenderViewBuilder.prototype._endElement = function() { + this.parentStack.pop(); + }; + RenderViewBuilder.prototype._addChild = function(node, ngContentIndex, context) { + var parent = this.parent; + if (lang_1.isPresent(parent)) { + if (parent instanceof Component) { + parent.addContentNode(ngContentIndex, node, context); + } else { + context.factory.appendChild(parent, node); + } + } else { + this.fragmentRootNodes.push(node); + } + }; + return RenderViewBuilder; + })(); + var Component = (function() { + function Component(hostElement, shadowRoot, isRoot, template) { + this.hostElement = hostElement; + this.shadowRoot = shadowRoot; + this.isRoot = isRoot; + this.template = template; + this.contentNodesByNgContentIndex = []; + } + Component.prototype.addContentNode = function(ngContentIndex, node, context) { + if (lang_1.isBlank(ngContentIndex)) { + if (this.template.encapsulation === metadata_1.ViewEncapsulation.Native) { + context.factory.appendChild(this.hostElement, node); + } + } else { + while (this.contentNodesByNgContentIndex.length <= ngContentIndex) { + this.contentNodesByNgContentIndex.push([]); + } + this.contentNodesByNgContentIndex[ngContentIndex].push(node); + } + }; + Component.prototype.project = function(ngContentIndex) { + return ngContentIndex < this.contentNodesByNgContentIndex.length ? this.contentNodesByNgContentIndex[ngContentIndex] : []; + }; + return Component; + })(); + var COMPONENT_REGEX = /%COMP%/g; + exports.COMPONENT_VARIABLE = '%COMP%'; + exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; + exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; + function _shimContentAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); + } + function _shimHostAttribute(componentShortId) { + return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/render", ["angular2/src/core/render"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/src/core/metadata", "angular2/src/core/linker", "angular2/src/core/change_detection", "angular2/src/core/render", "angular2/src/facade/collection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/metadata"); + var linker_1 = require("angular2/src/core/linker"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var render_1 = require("angular2/src/core/render"); + var collection_1 = require("angular2/src/facade/collection"); + var NgClass = (function() { + function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + this._iterableDiffers = _iterableDiffers; + this._keyValueDiffers = _keyValueDiffers; + this._ngEl = _ngEl; + this._renderer = _renderer; + this._initialClasses = []; + } + Object.defineProperty(NgClass.prototype, "initialClasses", { + set: function(v) { + this._applyInitialClasses(true); + this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; + this._applyInitialClasses(false); + this._applyClasses(this._rawClass, false); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgClass.prototype, "rawClass", { + set: function(v) { + this._cleanupClasses(this._rawClass); + if (lang_1.isString(v)) { + v = v.split(' '); + } + this._rawClass = v; + if (lang_1.isPresent(v)) { + if (collection_1.isListLikeIterable(v)) { + this._differ = this._iterableDiffers.find(v).create(null); + this._mode = 'iterable'; + } else { + this._differ = this._keyValueDiffers.find(v).create(null); + this._mode = 'keyValue'; + } + } else { + this._differ = null; + } + }, + enumerable: true, + configurable: true + }); + NgClass.prototype.doCheck = function() { + if (lang_1.isPresent(this._differ)) { + var changes = this._differ.diff(this._rawClass); + if (lang_1.isPresent(changes)) { + if (this._mode == 'iterable') { + this._applyIterableChanges(changes); + } else { + this._applyKeyValueChanges(changes); + } + } + } + }; + NgClass.prototype.onDestroy = function() { + this._cleanupClasses(this._rawClass); + }; + NgClass.prototype._cleanupClasses = function(rawClassVal) { + this._applyClasses(rawClassVal, true); + this._applyInitialClasses(false); + }; + NgClass.prototype._applyKeyValueChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachChangedItem(function(record) { + _this._toggleClass(record.key, record.currentValue); + }); + changes.forEachRemovedItem(function(record) { + if (record.previousValue) { + _this._toggleClass(record.key, false); + } + }); + }; + NgClass.prototype._applyIterableChanges = function(changes) { + var _this = this; + changes.forEachAddedItem(function(record) { + _this._toggleClass(record.item, true); + }); + changes.forEachRemovedItem(function(record) { + _this._toggleClass(record.item, false); + }); + }; + NgClass.prototype._applyInitialClasses = function(isCleanup) { + var _this = this; + this._initialClasses.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + }; + NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { + var _this = this; + if (lang_1.isPresent(rawClassVal)) { + if (lang_1.isArray(rawClassVal)) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else if (rawClassVal instanceof Set) { + rawClassVal.forEach(function(className) { + return _this._toggleClass(className, !isCleanup); + }); + } else { + collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { + if (expVal) + _this._toggleClass(className, !isCleanup); + }); + } + } + }; + NgClass.prototype._toggleClass = function(className, enabled) { + className = className.trim(); + if (className.length > 0) { + this._renderer.setElementClass(this._ngEl, className, enabled); + } + }; + NgClass = __decorate([metadata_1.Directive({ + selector: '[ng-class]', + inputs: ['rawClass: ng-class', 'initialClasses: class'] + }), __metadata('design:paramtypes', [change_detection_1.IterableDiffers, change_detection_1.KeyValueDiffers, linker_1.ElementRef, render_1.Renderer])], NgClass); + return NgClass; + })(); + exports.NgClass = NgClass; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var validators_1 = require("angular2/src/common/forms/validators"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); + function controlPath(name, parent) { + var p = collection_1.ListWrapper.clone(parent.path); + p.push(name); + return p; + } + exports.controlPath = controlPath; + function setUpControl(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + if (lang_1.isBlank(dir.valueAccessor)) + _throwError(dir, "No value accessor for"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + dir.valueAccessor.writeValue(control.value); + dir.valueAccessor.registerOnChange(function(newValue) { + dir.viewToModelUpdate(newValue); + control.updateValue(newValue, {emitModelToViewChange: false}); + control.markAsDirty(); + }); + control.registerOnChange(function(newValue) { + return dir.valueAccessor.writeValue(newValue); + }); + dir.valueAccessor.registerOnTouched(function() { + return control.markAsTouched(); + }); + } + exports.setUpControl = setUpControl; + function setUpControlGroup(control, dir) { + if (lang_1.isBlank(control)) + _throwError(dir, "Cannot find control"); + control.validator = validators_1.Validators.compose([control.validator, dir.validator]); + control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); + } + exports.setUpControlGroup = setUpControlGroup; + function _throwError(dir, message) { + var path = dir.path.join(" -> "); + throw new exceptions_1.BaseException(message + " '" + path + "'"); + } + function setProperty(renderer, elementRef, propName, propValue) { + renderer.setElementProperty(elementRef, propName, propValue); + } + exports.setProperty = setProperty; + function composeValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeValidators = composeValidators; + function composeAsyncValidators(validators) { + return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null; + } + exports.composeAsyncValidators = composeAsyncValidators; + function isPropertyUpdated(changes, viewModel) { + if (!collection_1.StringMapWrapper.contains(changes, "model")) + return false; + var change = changes["model"]; + if (change.isFirstChange()) + return true; + return !lang_1.looseIdentical(viewModel, change.currentValue); + } + exports.isPropertyUpdated = isPropertyUpdated; + function selectValueAccessor(dir, valueAccessors) { + if (lang_1.isBlank(valueAccessors)) + return null; + var defaultAccessor; + var builtinAccessor; + var customAccessor; + valueAccessors.forEach(function(v) { + if (v instanceof default_value_accessor_1.DefaultValueAccessor) { + defaultAccessor = v; + } else if (v instanceof checkbox_value_accessor_1.CheckboxControlValueAccessor || v instanceof number_value_accessor_1.NumberValueAccessor || v instanceof select_control_value_accessor_1.SelectControlValueAccessor) { + if (lang_1.isPresent(builtinAccessor)) + _throwError(dir, "More than one built-in value accessor matches"); + builtinAccessor = v; + } else { + if (lang_1.isPresent(customAccessor)) + _throwError(dir, "More than one custom value accessor matches"); + customAccessor = v; + } + }); + if (lang_1.isPresent(customAccessor)) + return customAccessor; + if (lang_1.isPresent(builtinAccessor)) + return builtinAccessor; + if (lang_1.isPresent(defaultAccessor)) + return defaultAccessor; + _throwError(dir, "No valid value accessor for"); + return null; + } + exports.selectValueAccessor = selectValueAccessor; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + var validators_1 = require("angular2/src/common/forms/directives/validators"); + var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_2.NgControlName; + var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_2.NgFormControl; + var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_2.NgModel; + var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_2.NgControlGroup; + var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_2.NgFormModel; + var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_2.NgForm; + var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; + var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; + var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); + exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; + var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_2.NgControlStatus; + var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; + exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/services", ["angular2/src/compiler/app_root_url", "angular2/src/compiler/url_resolver", "angular2/src/core/services/title"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + exports.AppRootUrl = app_root_url_1.AppRootUrl; + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + exports.UrlResolver = url_resolver_1.UrlResolver; + var title_1 = require("angular2/src/core/services/title"); + exports.Title = title_1.Title; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/debug", ["angular2/src/core/debug/debug_element", "angular2/src/core/debug/debug_element_view_listener"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var debug_element_1 = require("angular2/src/core/debug/debug_element"); + exports.DebugElement = debug_element_1.DebugElement; + exports.asNativeElements = debug_element_1.asNativeElements; + exports.By = debug_element_1.By; + exports.Scope = debug_element_1.Scope; + exports.inspectElement = debug_element_1.inspectElement; + var debug_element_view_listener_1 = require("angular2/src/core/debug/debug_element_view_listener"); + exports.inspectNativeElement = debug_element_view_listener_1.inspectNativeElement; + exports.ELEMENT_PROBE_PROVIDERS = debug_element_view_listener_1.ELEMENT_PROBE_PROVIDERS; + exports.ELEMENT_PROBE_BINDINGS = debug_element_view_listener_1.ELEMENT_PROBE_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/serializer", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/render/api", "angular2/src/web_workers/shared/api", "angular2/src/core/di", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/core/metadata/view"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var api_1 = require("angular2/src/core/render/api"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var di_1 = require("angular2/src/core/di"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var view_1 = require("angular2/src/core/metadata/view"); + exports.PRIMITIVE = String; + var Serializer = (function() { + function Serializer(_protoViewStore, _renderViewStore) { + this._protoViewStore = _protoViewStore; + this._renderViewStore = _renderViewStore; + } + Serializer.prototype.serialize = function(obj, type) { + var _this = this; + if (!lang_1.isPresent(obj)) { + return null; + } + if (lang_1.isArray(obj)) { + return obj.map(function(v) { + return _this.serialize(v, type); + }); + } + if (type == exports.PRIMITIVE) { + return obj; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.serialize(obj); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.serializeRenderViewRef(obj); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.serializeRenderFragmentRef(obj); + } else if (type == api_2.WebWorkerElementRef) { + return this._serializeWorkerElementRef(obj); + } else if (type == api_2.WebWorkerTemplateCmd) { + return serializeTemplateCmd(obj); + } else if (type === api_1.RenderComponentTemplate) { + return this._serializeRenderTemplate(obj); + } else if (type === view_1.ViewEncapsulation) { + return lang_1.serializeEnum(obj); + } else { + throw new exceptions_1.BaseException("No serializer for " + type.toString()); + } + }; + Serializer.prototype.deserialize = function(map, type, data) { + var _this = this; + if (!lang_1.isPresent(map)) { + return null; + } + if (lang_1.isArray(map)) { + var obj = []; + map.forEach(function(val) { + return obj.push(_this.deserialize(val, type, data)); + }); + return obj; + } + if (type == exports.PRIMITIVE) { + return map; + } + if (type == api_1.RenderProtoViewRef) { + return this._protoViewStore.deserialize(map); + } else if (type == api_1.RenderViewRef) { + return this._renderViewStore.deserializeRenderViewRef(map); + } else if (type == api_1.RenderFragmentRef) { + return this._renderViewStore.deserializeRenderFragmentRef(map); + } else if (type == api_2.WebWorkerElementRef) { + return this._deserializeWorkerElementRef(map); + } else if (type == api_2.WebWorkerTemplateCmd) { + return deserializeTemplateCmd(map); + } else if (type === api_1.RenderComponentTemplate) { + return this._deserializeRenderTemplate(map); + } else if (type === view_1.ViewEncapsulation) { + return view_1.VIEW_ENCAPSULATION_VALUES[map]; + } else { + throw new exceptions_1.BaseException("No deserializer for " + type.toString()); + } + }; + Serializer.prototype.mapToObject = function(map, type) { + var _this = this; + var object = {}; + var serialize = lang_1.isPresent(type); + map.forEach(function(value, key) { + if (serialize) { + object[key] = _this.serialize(value, type); + } else { + object[key] = value; + } + }); + return object; + }; + Serializer.prototype.objectToMap = function(obj, type, data) { + var _this = this; + if (lang_1.isPresent(type)) { + var map = new collection_1.Map(); + collection_1.StringMapWrapper.forEach(obj, function(val, key) { + map.set(key, _this.deserialize(val, type, data)); + }); + return map; + } else { + return collection_1.MapWrapper.createFromStringMap(obj); + } + }; + Serializer.prototype.allocateRenderViews = function(fragmentCount) { + this._renderViewStore.allocate(fragmentCount); + }; + Serializer.prototype._serializeWorkerElementRef = function(elementRef) { + return { + 'renderView': this.serialize(elementRef.renderView, api_1.RenderViewRef), + 'boundElementIndex': elementRef.boundElementIndex + }; + }; + Serializer.prototype._deserializeWorkerElementRef = function(map) { + return new api_2.WebWorkerElementRef(this.deserialize(map['renderView'], api_1.RenderViewRef), map['boundElementIndex']); + }; + Serializer.prototype._serializeRenderTemplate = function(obj) { + return { + 'id': obj.id, + 'shortId': obj.shortId, + 'encapsulation': this.serialize(obj.encapsulation, view_1.ViewEncapsulation), + 'commands': this.serialize(obj.commands, api_2.WebWorkerTemplateCmd), + 'styles': this.serialize(obj.styles, exports.PRIMITIVE) + }; + }; + Serializer.prototype._deserializeRenderTemplate = function(map) { + return new api_1.RenderComponentTemplate(map['id'], map['shortId'], this.deserialize(map['encapsulation'], view_1.ViewEncapsulation), this.deserialize(map['commands'], api_2.WebWorkerTemplateCmd), this.deserialize(map['styles'], exports.PRIMITIVE)); + }; + Serializer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [render_proto_view_ref_store_1.RenderProtoViewRefStore, render_view_with_fragments_store_1.RenderViewWithFragmentsStore])], Serializer); + return Serializer; + })(); + exports.Serializer = Serializer; + function serializeTemplateCmd(cmd) { + return cmd.visit(RENDER_TEMPLATE_CMD_SERIALIZER, null); + } + function deserializeTemplateCmd(data) { + return RENDER_TEMPLATE_CMD_DESERIALIZERS[data['deserializerIndex']](data); + } + var RenderTemplateCmdSerializer = (function() { + function RenderTemplateCmdSerializer() {} + RenderTemplateCmdSerializer.prototype.visitText = function(cmd, context) { + return { + 'deserializerIndex': 0, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'value': cmd.value + }; + }; + RenderTemplateCmdSerializer.prototype.visitNgContent = function(cmd, context) { + return { + 'deserializerIndex': 1, + 'index': cmd.index, + 'ngContentIndex': cmd.ngContentIndex + }; + }; + RenderTemplateCmdSerializer.prototype.visitBeginElement = function(cmd, context) { + return { + 'deserializerIndex': 2, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndElement = function(context) { + return {'deserializerIndex': 3}; + }; + RenderTemplateCmdSerializer.prototype.visitBeginComponent = function(cmd, context) { + return { + 'deserializerIndex': 4, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'templateId': cmd.templateId + }; + }; + RenderTemplateCmdSerializer.prototype.visitEndComponent = function(context) { + return {'deserializerIndex': 5}; + }; + RenderTemplateCmdSerializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var _this = this; + var children = cmd.children.map(function(child) { + return child.visit(_this, null); + }); + return { + 'deserializerIndex': 6, + 'isBound': cmd.isBound, + 'ngContentIndex': cmd.ngContentIndex, + 'name': cmd.name, + 'attrNameAndValues': cmd.attrNameAndValues, + 'eventTargetAndNames': cmd.eventTargetAndNames, + 'isMerged': cmd.isMerged, + 'children': children + }; + }; + return RenderTemplateCmdSerializer; + })(); + var RENDER_TEMPLATE_CMD_SERIALIZER = new RenderTemplateCmdSerializer(); + var RENDER_TEMPLATE_CMD_DESERIALIZERS = [function(data) { + return new api_2.WebWorkerTextCmd(data['isBound'], data['ngContentIndex'], data['value']); + }, function(data) { + return new api_2.WebWorkerNgContentCmd(data['index'], data['ngContentIndex']); + }, function(data) { + return new api_2.WebWorkerBeginElementCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames']); + }, function(data) { + return new api_2.WebWorkerEndElementCmd(); + }, function(data) { + return new api_2.WebWorkerBeginComponentCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['templateId']); + }, function(data) { + return new api_2.WebWorkerEndComponentCmd(); + }, function(data) { + return new api_2.WebWorkerEmbeddedTemplateCmd(data['isBound'], data['ngContentIndex'], data['name'], data['attrNameAndValues'], data['eventTargetAndNames'], data['isMerged'], data['children'].map(function(childData) { + return deserializeTemplateCmd(childData); + })); + }]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/event_dispatcher", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/core/render/api", "angular2/src/web_workers/shared/serializer", "angular2/src/web_workers/shared/messaging_api", "angular2/src/web_workers/shared/message_bus", "angular2/src/facade/async", "angular2/src/web_workers/worker/event_deserializer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var collection_1 = require("angular2/src/facade/collection"); + var api_1 = require("angular2/src/core/render/api"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var async_1 = require("angular2/src/facade/async"); + var event_deserializer_1 = require("angular2/src/web_workers/worker/event_deserializer"); + var WebWorkerEventDispatcher = (function() { + function WebWorkerEventDispatcher(bus, _serializer) { + var _this = this; + this._serializer = _serializer; + this._eventDispatchRegistry = new collection_1.Map(); + bus.initChannel(messaging_api_1.EVENT_CHANNEL); + var source = bus.from(messaging_api_1.EVENT_CHANNEL); + async_1.ObservableWrapper.subscribe(source, function(message) { + return _this._dispatchEvent(new RenderEventData(message, _serializer)); + }); + } + WebWorkerEventDispatcher.prototype._dispatchEvent = function(eventData) { + var dispatcher = this._eventDispatchRegistry.get(eventData.viewRef); + eventData.locals['$event'] = event_deserializer_1.deserializeGenericEvent(eventData.locals['$event']); + dispatcher.dispatchRenderEvent(eventData.elementIndex, eventData.eventName, eventData.locals); + }; + WebWorkerEventDispatcher.prototype.registerEventDispatcher = function(viewRef, dispatcher) { + this._eventDispatchRegistry.set(viewRef, dispatcher); + }; + WebWorkerEventDispatcher = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, serializer_1.Serializer])], WebWorkerEventDispatcher); + return WebWorkerEventDispatcher; + })(); + exports.WebWorkerEventDispatcher = WebWorkerEventDispatcher; + var RenderEventData = (function() { + function RenderEventData(message, serializer) { + this.viewRef = serializer.deserialize(message['viewRef'], api_1.RenderViewRef); + this.elementIndex = message['elementIndex']; + this.eventName = message['eventName']; + this.locals = collection_1.MapWrapper.createFromStringMap(message['locals']); + } + return RenderEventData; + })(); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_1 = require("angular2/src/core/metadata/view"); + var selector_1 = require("angular2/src/compiler/selector"); + var util_1 = require("angular2/src/compiler/util"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; + var CompileTypeMetadata = (function() { + function CompileTypeMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + runtime = _b.runtime, + name = _b.name, + moduleUrl = _b.moduleUrl, + isHost = _b.isHost; + this.runtime = runtime; + this.name = name; + this.moduleUrl = moduleUrl; + this.isHost = lang_1.normalizeBool(isHost); + } + CompileTypeMetadata.fromJson = function(data) { + return new CompileTypeMetadata({ + name: data['name'], + moduleUrl: data['moduleUrl'], + isHost: data['isHost'] + }); + }; + CompileTypeMetadata.prototype.toJson = function() { + return { + 'name': this.name, + 'moduleUrl': this.moduleUrl, + 'isHost': this.isHost + }; + }; + return CompileTypeMetadata; + })(); + exports.CompileTypeMetadata = CompileTypeMetadata; + var CompileTemplateMetadata = (function() { + function CompileTemplateMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + encapsulation = _b.encapsulation, + template = _b.template, + templateUrl = _b.templateUrl, + styles = _b.styles, + styleUrls = _b.styleUrls, + ngContentSelectors = _b.ngContentSelectors; + this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; + this.template = template; + this.templateUrl = templateUrl; + this.styles = lang_1.isPresent(styles) ? styles : []; + this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; + this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; + } + CompileTemplateMetadata.fromJson = function(data) { + return new CompileTemplateMetadata({ + encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], + template: data['template'], + templateUrl: data['templateUrl'], + styles: data['styles'], + styleUrls: data['styleUrls'], + ngContentSelectors: data['ngContentSelectors'] + }); + }; + CompileTemplateMetadata.prototype.toJson = function() { + return { + 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, + 'template': this.template, + 'templateUrl': this.templateUrl, + 'styles': this.styles, + 'styleUrls': this.styleUrls, + 'ngContentSelectors': this.ngContentSelectors + }; + }; + return CompileTemplateMetadata; + })(); + exports.CompileTemplateMetadata = CompileTemplateMetadata; + var CompileDirectiveMetadata = (function() { + function CompileDirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + hostListeners = _b.hostListeners, + hostProperties = _b.hostProperties, + hostAttributes = _b.hostAttributes, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + this.type = type; + this.isComponent = isComponent; + this.dynamicLoadable = dynamicLoadable; + this.selector = selector; + this.exportAs = exportAs; + this.changeDetection = changeDetection; + this.inputs = inputs; + this.outputs = outputs; + this.hostListeners = hostListeners; + this.hostProperties = hostProperties; + this.hostAttributes = hostAttributes; + this.lifecycleHooks = lifecycleHooks; + this.template = template; + } + CompileDirectiveMetadata.create = function(_a) { + var _b = _a === void 0 ? {} : _a, + type = _b.type, + isComponent = _b.isComponent, + dynamicLoadable = _b.dynamicLoadable, + selector = _b.selector, + exportAs = _b.exportAs, + changeDetection = _b.changeDetection, + inputs = _b.inputs, + outputs = _b.outputs, + host = _b.host, + lifecycleHooks = _b.lifecycleHooks, + template = _b.template; + var hostListeners = {}; + var hostProperties = {}; + var hostAttributes = {}; + if (lang_1.isPresent(host)) { + collection_1.StringMapWrapper.forEach(host, function(value, key) { + var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); + if (lang_1.isBlank(matches)) { + hostAttributes[key] = value; + } else if (lang_1.isPresent(matches[1])) { + hostProperties[matches[1]] = value; + } else if (lang_1.isPresent(matches[2])) { + hostListeners[matches[2]] = value; + } + }); + } + var inputsMap = {}; + if (lang_1.isPresent(inputs)) { + inputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + inputsMap[parts[0]] = parts[1]; + }); + } + var outputsMap = {}; + if (lang_1.isPresent(outputs)) { + outputs.forEach(function(bindConfig) { + var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); + outputsMap[parts[0]] = parts[1]; + }); + } + return new CompileDirectiveMetadata({ + type: type, + isComponent: lang_1.normalizeBool(isComponent), + dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), + selector: selector, + exportAs: exportAs, + changeDetection: changeDetection, + inputs: inputsMap, + outputs: outputsMap, + hostListeners: hostListeners, + hostProperties: hostProperties, + hostAttributes: hostAttributes, + lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], + template: template + }); + }; + CompileDirectiveMetadata.fromJson = function(data) { + return new CompileDirectiveMetadata({ + isComponent: data['isComponent'], + dynamicLoadable: data['dynamicLoadable'], + selector: data['selector'], + exportAs: data['exportAs'], + type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], + changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], + inputs: data['inputs'], + outputs: data['outputs'], + hostListeners: data['hostListeners'], + hostProperties: data['hostProperties'], + hostAttributes: data['hostAttributes'], + lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { + return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; + }), + template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'] + }); + }; + CompileDirectiveMetadata.prototype.toJson = function() { + return { + 'isComponent': this.isComponent, + 'dynamicLoadable': this.dynamicLoadable, + 'selector': this.selector, + 'exportAs': this.exportAs, + 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, + 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, + 'inputs': this.inputs, + 'outputs': this.outputs, + 'hostListeners': this.hostListeners, + 'hostProperties': this.hostProperties, + 'hostAttributes': this.hostAttributes, + 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { + return lang_1.serializeEnum(hook); + }), + 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template + }; + }; + return CompileDirectiveMetadata; + })(); + exports.CompileDirectiveMetadata = CompileDirectiveMetadata; + function createHostComponentMeta(componentType, componentSelector) { + var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); + return CompileDirectiveMetadata.create({ + type: new CompileTypeMetadata({ + runtime: Object, + name: "Host" + componentType.name, + moduleUrl: componentType.moduleUrl, + isHost: true + }), + template: new CompileTemplateMetadata({ + template: template, + templateUrl: '', + styles: [], + styleUrls: [], + ngContentSelectors: [] + }), + changeDetection: change_detection_1.ChangeDetectionStrategy.Default, + inputs: [], + outputs: [], + host: {}, + lifecycleHooks: [], + isComponent: true, + dynamicLoadable: false, + selector: '*' + }); + } + exports.createHostComponentMeta = createHostComponentMeta; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { + var pvVisitors = []; + var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); + template_ast_1.templateVisitAll(visitor, parsedTemplate); + return createChangeDefinitions(pvVisitors, componentType, genConfig); + } + exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; + var ProtoViewVisitor = (function() { + function ProtoViewVisitor(parent, allVisitors, strategy) { + this.parent = parent; + this.allVisitors = allVisitors; + this.strategy = strategy; + this.boundTextCount = 0; + this.boundElementCount = 0; + this.variableNames = []; + this.bindingRecords = []; + this.eventRecords = []; + this.directiveRecords = []; + this.viewIndex = allVisitors.length; + allVisitors.push(this); + } + ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { + this.boundElementCount++; + template_ast_1.templateVisitAll(this, ast.outputs); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); + template_ast_1.templateVisitAll(childVisitor, ast.vars); + template_ast_1.templateVisitAll(childVisitor, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitElement = function(ast, context) { + if (ast.isBound()) { + this.boundElementCount++; + } + template_ast_1.templateVisitAll(this, ast.inputs, null); + template_ast_1.templateVisitAll(this, ast.outputs); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + for (var i = 0; i < ast.directives.length; i++) { + ast.directives[i].visit(this, i); + } + template_ast_1.templateVisitAll(this, ast.children); + return null; + }; + ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitVariable = function(ast, context) { + this.variableNames.push(ast.name); + return null; + }; + ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { + var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); + this.eventRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { + var boundElementIndex = this.boundElementCount - 1; + var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; + var bindingRecord; + if (ast.type === template_ast_1.PropertyBindingType.Property) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Class) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); + } else if (ast.type === template_ast_1.PropertyBindingType.Style) { + bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); + } + this.bindingRecords.push(bindingRecord); + return null; + }; + ProtoViewVisitor.prototype.visitAttr = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { + var boundTextIndex = this.boundTextCount++; + this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, boundTextIndex)); + return null; + }; + ProtoViewVisitor.prototype.visitText = function(ast, context) { + return null; + }; + ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { + var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); + var directiveMetadata = ast.directive; + var directiveRecord = new change_detection_1.DirectiveRecord({ + directiveIndex: directiveIndex, + callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, + callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, + callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, + callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, + callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, + callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, + callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, + changeDetection: directiveMetadata.changeDetection + }); + this.directiveRecords.push(directiveRecord); + template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); + var bindingRecords = this.bindingRecords; + if (directiveRecord.callOnChanges) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); + } + if (directiveRecord.callOnInit) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); + } + if (directiveRecord.callDoCheck) { + bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); + } + template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); + template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); + template_ast_1.templateVisitAll(this, ast.exportAsVars); + return null; + }; + ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { + var setter = reflection_1.reflector.setter(ast.directiveName); + this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); + return null; + }; + return ProtoViewVisitor; + })(); + function createChangeDefinitions(pvVisitors, componentType, genConfig) { + var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); + return pvVisitors.map(function(pvVisitor) { + var id = componentType.name + "_" + pvVisitor.viewIndex; + return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); + }); + } + function _collectNestedProtoViewsVariableNames(pvVisitors) { + var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); + pvVisitors.forEach(function(pv) { + var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; + nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); + }); + return nestedPvVariableNames; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/core/render/view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var view_1 = require("angular2/src/core/metadata/view"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var shadow_css_1 = require("angular2/src/compiler/shadow_css"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var StyleCompiler = (function() { + function StyleCompiler(_xhr, _urlResolver) { + this._xhr = _xhr; + this._urlResolver = _urlResolver; + this._styleCache = new Map(); + this._shadowCss = new shadow_css_1.ShadowCss(); + } + StyleCompiler.prototype.compileComponentRuntime = function(template) { + var styles = template.styles; + var styleAbsUrls = template.styleUrls; + return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); + }; + StyleCompiler.prototype.compileComponentCodeGen = function(template) { + var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; + return this._styleCodeGen(template.styles, template.styleUrls, shim); + }; + StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); + return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; + }; + StyleCompiler.prototype.clearCache = function() { + this._styleCache.clear(); + }; + StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { + var _this = this; + var promises = absUrls.map(function(absUrl) { + var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); + var result = _this._styleCache.get(cacheKey); + if (lang_1.isBlank(result)) { + result = _this._xhr.get(absUrl).then(function(style) { + var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); + return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); + }); + _this._styleCache.set(cacheKey, result); + } + return result; + }); + return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { + var result = plainStyles.map(function(plainStyle) { + return _this._shimIfNeeded(plainStyle, encapsulate); + }); + nestedStyles.forEach(function(styles) { + return result.push(styles); + }); + return result; + }); + }; + StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { + var _this = this; + var arrayPrefix = lang_1.IS_DART ? "const" : ''; + var styleExpressions = plainStyles.map(function(plainStyle) { + return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); + }); + for (var i = 0; i < absUrls.length; i++) { + var moduleUrl = this._createModuleUrl(absUrls[i], shim); + styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); + } + var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; + return new source_module_1.SourceExpression([], expressionSource); + }; + StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { + var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; + return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); + }; + StyleCompiler.prototype._shimIfNeeded = function(style, shim) { + return shim ? this._shadowCss.shimCssText(style, view_factory_1.CONTENT_ATTR, view_factory_1.HOST_ATTR) : style; + }; + StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { + return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + }; + StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); + return StyleCompiler; + })(); + exports.StyleCompiler = StyleCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/core/dom/dom_adapter", "angular2/src/compiler/html_ast", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var HtmlParser = (function() { + function HtmlParser() {} + HtmlParser.prototype.parse = function(template, sourceInfo) { + var root = dom_adapter_1.DOM.createTemplate(template); + return parseChildNodes(root, sourceInfo); + }; + HtmlParser.prototype.unparse = function(nodes) { + var visitor = new UnparseVisitor(); + var parts = []; + html_ast_1.htmlVisitAll(visitor, nodes, parts); + return parts.join(''); + }; + HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); + return HtmlParser; + })(); + exports.HtmlParser = HtmlParser; + function parseText(text, indexInParent, parentSourceInfo) { + var value = dom_adapter_1.DOM.getText(text); + return new html_ast_1.HtmlTextAst(value, parentSourceInfo + " > #text(" + value + "):nth-child(" + indexInParent + ")"); + } + function parseAttr(element, parentSourceInfo, attrName, attrValue) { + return new html_ast_1.HtmlAttrAst(attrName, attrValue, parentSourceInfo + "[" + attrName + "=" + attrValue + "]"); + } + function parseElement(element, indexInParent, parentSourceInfo) { + var nodeName = dom_adapter_1.DOM.nodeName(element).toLowerCase(); + var sourceInfo = parentSourceInfo + " > " + nodeName + ":nth-child(" + indexInParent + ")"; + var attrs = parseAttrs(element, sourceInfo); + var childNodes = parseChildNodes(element, sourceInfo); + return new html_ast_1.HtmlElementAst(nodeName, attrs, childNodes, sourceInfo); + } + function parseAttrs(element, elementSourceInfo) { + var attrMap = dom_adapter_1.DOM.attributeMap(element); + var attrList = []; + attrMap.forEach(function(value, name) { + return attrList.push([name, value]); + }); + attrList.sort(function(entry1, entry2) { + return lang_1.StringWrapper.compare(entry1[0], entry2[0]); + }); + return attrList.map(function(entry) { + return parseAttr(element, elementSourceInfo, entry[0], entry[1]); + }); + } + function parseChildNodes(element, parentSourceInfo) { + var root = dom_adapter_1.DOM.templateAwareRoot(element); + var childNodes = dom_adapter_1.DOM.childNodesAsList(root); + var result = []; + var index = 0; + childNodes.forEach(function(childNode) { + var childResult = null; + if (dom_adapter_1.DOM.isTextNode(childNode)) { + var text = childNode; + childResult = parseText(text, index, parentSourceInfo); + } else if (dom_adapter_1.DOM.isElementNode(childNode)) { + var el = childNode; + childResult = parseElement(el, index, parentSourceInfo); + } + if (lang_1.isPresent(childResult)) { + result.push(childResult); + } + index++; + }); + return result; + } + var UnparseVisitor = (function() { + function UnparseVisitor() {} + UnparseVisitor.prototype.visitElement = function(ast, parts) { + parts.push("<" + ast.name); + var attrs = []; + html_ast_1.htmlVisitAll(this, ast.attrs, attrs); + if (ast.attrs.length > 0) { + parts.push(' '); + parts.push(attrs.join(' ')); + } + parts.push(">"); + html_ast_1.htmlVisitAll(this, ast.children, parts); + parts.push(""); + return null; + }; + UnparseVisitor.prototype.visitAttr = function(ast, parts) { + parts.push(ast.name + "=" + util_1.escapeDoubleQuoteString(ast.value)); + return null; + }; + UnparseVisitor.prototype.visitText = function(ast, parts) { + parts.push(ast.value); + return null; + }; + return UnparseVisitor; + })(); + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tokenization/preprocessor", ["parse5/lib/common/unicode"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var UNICODE = require("parse5/lib/common/unicode"); + var $ = UNICODE.CODE_POINTS; + function isReservedCodePoint(cp) { + return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF; + } + function isSurrogatePair(cp1, cp2) { + return cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF; + } + function getSurrogatePairCodePoint(cp1, cp2) { + return (cp1 - 0xD800) * 0x400 + 0x2400 + cp2; + } + var Preprocessor = module.exports = function(html) { + this.write(html); + this.pos = this.html.charCodeAt(0) === $.BOM ? 0 : -1; + this.gapStack = []; + this.lastGapPos = -1; + this.skipNextNewLine = false; + }; + Preprocessor.prototype.write = function(html) { + if (this.html) { + this.html = this.html.substring(0, this.pos + 1) + html + this.html.substring(this.pos + 1, this.html.length); + } else + this.html = html; + this.lastCharPos = this.html.length - 1; + }; + Preprocessor.prototype.advanceAndPeekCodePoint = function() { + this.pos++; + if (this.pos > this.lastCharPos) + return $.EOF; + var cp = this.html.charCodeAt(this.pos); + if (this.skipNextNewLine && cp === $.LINE_FEED) { + this.skipNextNewLine = false; + this._addGap(); + return this.advanceAndPeekCodePoint(); + } + if (cp === $.CARRIAGE_RETURN) { + this.skipNextNewLine = true; + return $.LINE_FEED; + } + this.skipNextNewLine = false; + return cp >= 0xD800 ? this._processHighRangeCodePoint(cp) : cp; + }; + Preprocessor.prototype._processHighRangeCodePoint = function(cp) { + if (this.pos !== this.lastCharPos) { + var nextCp = this.html.charCodeAt(this.pos + 1); + if (isSurrogatePair(cp, nextCp)) { + this.pos++; + cp = getSurrogatePairCodePoint(cp, nextCp); + this._addGap(); + } + } + if (isReservedCodePoint(cp)) + cp = $.REPLACEMENT_CHARACTER; + return cp; + }; + Preprocessor.prototype._addGap = function() { + this.gapStack.push(this.lastGapPos); + this.lastGapPos = this.pos; + }; + Preprocessor.prototype.retreat = function() { + if (this.pos === this.lastGapPos) { + this.lastGapPos = this.gapStack.pop(); + this.pos--; + } + this.pos--; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_construction/open_element_stack", ["parse5/lib/common/html"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var HTML = require("parse5/lib/common/html"); + var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES; + function isImpliedEndTagRequired(tn) { + switch (tn.length) { + case 1: + return tn === $.P; + case 2: + return tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI; + case 6: + return tn === $.OPTION; + case 8: + return tn === $.OPTGROUP; + } + return false; + } + function isScopingElement(tn, ns) { + switch (tn.length) { + case 2: + if (tn === $.TD || tn === $.TH) + return ns === NS.HTML; + else if (tn === $.MI || tn === $.MO || tn == $.MN || tn === $.MS) + return ns === NS.MATHML; + break; + case 4: + if (tn === $.HTML) + return ns === NS.HTML; + else if (tn === $.DESC) + return ns === NS.SVG; + break; + case 5: + if (tn === $.TABLE) + return ns === NS.HTML; + else if (tn === $.MTEXT) + return ns === NS.MATHML; + else if (tn === $.TITLE) + return ns === NS.SVG; + break; + case 6: + return (tn === $.APPLET || tn === $.OBJECT) && ns === NS.HTML; + case 7: + return (tn === $.CAPTION || tn === $.MARQUEE) && ns === NS.HTML; + case 8: + return tn === $.TEMPLATE && ns === NS.HTML; + case 13: + return tn === $.FOREIGN_OBJECT && ns === NS.SVG; + case 14: + return tn === $.ANNOTATION_XML && ns === NS.MATHML; + } + return false; + } + var OpenElementStack = module.exports = function(document, treeAdapter) { + this.stackTop = -1; + this.items = []; + this.current = document; + this.currentTagName = null; + this.currentTmplContent = null; + this.tmplCount = 0; + this.treeAdapter = treeAdapter; + }; + OpenElementStack.prototype._indexOf = function(element) { + var idx = -1; + for (var i = this.stackTop; i >= 0; i--) { + if (this.items[i] === element) { + idx = i; + break; + } + } + return idx; + }; + OpenElementStack.prototype._isInTemplate = function() { + if (this.currentTagName !== $.TEMPLATE) + return false; + return this.treeAdapter.getNamespaceURI(this.current) === NS.HTML; + }; + OpenElementStack.prototype._updateCurrentElement = function() { + this.current = this.items[this.stackTop]; + this.currentTagName = this.current && this.treeAdapter.getTagName(this.current); + this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getChildNodes(this.current)[0] : null; + }; + OpenElementStack.prototype.push = function(element) { + this.items[++this.stackTop] = element; + this._updateCurrentElement(); + if (this._isInTemplate()) + this.tmplCount++; + }; + OpenElementStack.prototype.pop = function() { + this.stackTop--; + if (this.tmplCount > 0 && this._isInTemplate()) + this.tmplCount--; + this._updateCurrentElement(); + }; + OpenElementStack.prototype.replace = function(oldElement, newElement) { + var idx = this._indexOf(oldElement); + this.items[idx] = newElement; + if (idx === this.stackTop) + this._updateCurrentElement(); + }; + OpenElementStack.prototype.insertAfter = function(referenceElement, newElement) { + var insertionIdx = this._indexOf(referenceElement) + 1; + this.items.splice(insertionIdx, 0, newElement); + if (insertionIdx == ++this.stackTop) + this._updateCurrentElement(); + }; + OpenElementStack.prototype.popUntilTagNamePopped = function(tagName) { + while (this.stackTop > -1) { + var tn = this.currentTagName; + this.pop(); + if (tn === tagName) + break; + } + }; + OpenElementStack.prototype.popUntilTemplatePopped = function() { + while (this.stackTop > -1) { + var tn = this.currentTagName, + ns = this.treeAdapter.getNamespaceURI(this.current); + this.pop(); + if (tn === $.TEMPLATE && ns === NS.HTML) + break; + } + }; + OpenElementStack.prototype.popUntilElementPopped = function(element) { + while (this.stackTop > -1) { + var poppedElement = this.current; + this.pop(); + if (poppedElement === element) + break; + } + }; + OpenElementStack.prototype.popUntilNumberedHeaderPopped = function() { + while (this.stackTop > -1) { + var tn = this.currentTagName; + this.pop(); + if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) + break; + } + }; + OpenElementStack.prototype.popAllUpToHtmlElement = function() { + this.stackTop = 0; + this._updateCurrentElement(); + }; + OpenElementStack.prototype.clearBackToTableContext = function() { + while (this.currentTagName !== $.TABLE && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML) + this.pop(); + }; + OpenElementStack.prototype.clearBackToTableBodyContext = function() { + while (this.currentTagName !== $.TBODY && this.currentTagName !== $.TFOOT && this.currentTagName !== $.THEAD && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML) { + this.pop(); + } + }; + OpenElementStack.prototype.clearBackToTableRowContext = function() { + while (this.currentTagName !== $.TR && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML) + this.pop(); + }; + OpenElementStack.prototype.remove = function(element) { + for (var i = this.stackTop; i >= 0; i--) { + if (this.items[i] === element) { + this.items.splice(i, 1); + this.stackTop--; + this._updateCurrentElement(); + break; + } + } + }; + OpenElementStack.prototype.tryPeekProperlyNestedBodyElement = function() { + var element = this.items[1]; + return element && this.treeAdapter.getTagName(element) === $.BODY ? element : null; + }; + OpenElementStack.prototype.contains = function(element) { + return this._indexOf(element) > -1; + }; + OpenElementStack.prototype.getCommonAncestor = function(element) { + var elementIdx = this._indexOf(element); + return --elementIdx >= 0 ? this.items[elementIdx] : null; + }; + OpenElementStack.prototype.isRootHtmlElementCurrent = function() { + return this.stackTop === 0 && this.currentTagName === $.HTML; + }; + OpenElementStack.prototype.hasInScope = function(tagName) { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === tagName) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (isScopingElement(tn, ns)) + return false; + } + return true; + }; + OpenElementStack.prototype.hasNumberedHeaderInScope = function() { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) + return true; + if (isScopingElement(tn, this.treeAdapter.getNamespaceURI(this.items[i]))) + return false; + } + return true; + }; + OpenElementStack.prototype.hasInListItemScope = function(tagName) { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === tagName) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (((tn === $.UL || tn === $.OL) && ns === NS.HTML) || isScopingElement(tn, ns)) + return false; + } + return true; + }; + OpenElementStack.prototype.hasInButtonScope = function(tagName) { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === tagName) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if ((tn === $.BUTTON && ns === NS.HTML) || isScopingElement(tn, ns)) + return false; + } + return true; + }; + OpenElementStack.prototype.hasInTableScope = function(tagName) { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === tagName) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if ((tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) && ns === NS.HTML) + return false; + } + return true; + }; + OpenElementStack.prototype.hasTableBodyContextInTableScope = function() { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if ((tn === $.TABLE || tn === $.HTML) && ns === NS.HTML) + return false; + } + return true; + }; + OpenElementStack.prototype.hasInSelectScope = function(tagName) { + for (var i = this.stackTop; i >= 0; i--) { + var tn = this.treeAdapter.getTagName(this.items[i]); + if (tn === tagName) + return true; + var ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (tn !== $.OPTION && tn !== $.OPTGROUP && ns === NS.HTML) + return false; + } + return true; + }; + OpenElementStack.prototype.generateImpliedEndTags = function() { + while (isImpliedEndTagRequired(this.currentTagName)) + this.pop(); + }; + OpenElementStack.prototype.generateImpliedEndTagsWithExclusion = function(exclusionTagName) { + while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName) + this.pop(); + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/simple_api/simple_api_parser", ["parse5/lib/tokenization/tokenizer", "parse5/lib/simple_api/tokenizer_proxy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Tokenizer = require("parse5/lib/tokenization/tokenizer"), + TokenizerProxy = require("parse5/lib/simple_api/tokenizer_proxy"); + function skip() {} + var SimpleApiParser = module.exports = function(handlers) { + this.handlers = { + doctype: handlers.doctype || skip, + startTag: handlers.startTag || skip, + endTag: handlers.endTag || skip, + text: handlers.text || skip, + comment: handlers.comment || skip + }; + }; + SimpleApiParser.prototype.parse = function(html) { + var token = null; + this._reset(html); + do { + token = this.tokenizerProxy.getNextToken(); + if (token.type === Tokenizer.CHARACTER_TOKEN || token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN || token.type === Tokenizer.NULL_CHARACTER_TOKEN) { + this.pendingText = (this.pendingText || '') + token.chars; + } else { + this._emitPendingText(); + this._handleToken(token); + } + } while (token.type !== Tokenizer.EOF_TOKEN); + }; + SimpleApiParser.prototype._handleToken = function(token) { + if (token.type === Tokenizer.START_TAG_TOKEN) + this.handlers.startTag(token.tagName, token.attrs, token.selfClosing); + else if (token.type === Tokenizer.END_TAG_TOKEN) + this.handlers.endTag(token.tagName); + else if (token.type === Tokenizer.COMMENT_TOKEN) + this.handlers.comment(token.data); + else if (token.type === Tokenizer.DOCTYPE_TOKEN) + this.handlers.doctype(token.name, token.publicId, token.systemId); + }; + SimpleApiParser.prototype._reset = function(html) { + this.tokenizerProxy = new TokenizerProxy(html); + this.pendingText = null; + }; + SimpleApiParser.prototype._emitPendingText = function() { + if (this.pendingText !== null) { + this.handlers.text(this.pendingText); + this.pendingText = null; + } + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/serialization/serializer", ["parse5/lib/tree_adapters/default", "parse5/lib/common/utils", "parse5/lib/common/html"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var DefaultTreeAdapter = require("parse5/lib/tree_adapters/default"), + Utils = require("parse5/lib/common/utils"), + HTML = require("parse5/lib/common/html"); + var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES; + var DEFAULT_OPTIONS = {encodeHtmlEntities: true}; + var AMP_REGEX = /&/g, + NBSP_REGEX = /\u00a0/g, + DOUBLE_QUOTE_REGEX = /"/g, + LT_REGEX = //g; + function escapeString(str, attrMode) { + str = str.replace(AMP_REGEX, '&').replace(NBSP_REGEX, ' '); + if (attrMode) + str = str.replace(DOUBLE_QUOTE_REGEX, '"'); + else { + str = str.replace(LT_REGEX, '<').replace(GT_REGEX, '>'); + } + return str; + } + function enquoteDoctypeId(id) { + var quote = id.indexOf('"') !== -1 ? '\'' : '"'; + return quote + id + quote; + } + var Serializer = module.exports = function(treeAdapter, options) { + this.treeAdapter = treeAdapter || DefaultTreeAdapter; + this.options = Utils.mergeOptions(DEFAULT_OPTIONS, options); + }; + Serializer.prototype.serialize = function(node) { + this.html = ''; + this._serializeChildNodes(node); + return this.html; + }; + Serializer.prototype._serializeChildNodes = function(parentNode) { + var childNodes = this.treeAdapter.getChildNodes(parentNode); + if (childNodes) { + for (var i = 0, + cnLength = childNodes.length; i < cnLength; i++) { + var currentNode = childNodes[i]; + if (this.treeAdapter.isElementNode(currentNode)) + this._serializeElement(currentNode); + else if (this.treeAdapter.isTextNode(currentNode)) + this._serializeTextNode(currentNode); + else if (this.treeAdapter.isCommentNode(currentNode)) + this._serializeCommentNode(currentNode); + else if (this.treeAdapter.isDocumentTypeNode(currentNode)) + this._serializeDocumentTypeNode(currentNode); + } + } + }; + Serializer.prototype._serializeElement = function(node) { + var tn = this.treeAdapter.getTagName(node), + ns = this.treeAdapter.getNamespaceURI(node), + qualifiedTn = (ns === NS.HTML || ns === NS.SVG || ns === NS.MATHML) ? tn : (ns + ':' + tn); + this.html += '<' + qualifiedTn; + this._serializeAttributes(node); + this.html += '>'; + if (tn !== $.AREA && tn !== $.BASE && tn !== $.BASEFONT && tn !== $.BGSOUND && tn !== $.BR && tn !== $.BR && tn !== $.COL && tn !== $.EMBED && tn !== $.FRAME && tn !== $.HR && tn !== $.IMG && tn !== $.INPUT && tn !== $.KEYGEN && tn !== $.LINK && tn !== $.MENUITEM && tn !== $.META && tn !== $.PARAM && tn !== $.SOURCE && tn !== $.TRACK && tn !== $.WBR) { + if (tn === $.PRE || tn === $.TEXTAREA || tn === $.LISTING) { + var firstChild = this.treeAdapter.getFirstChild(node); + if (firstChild && this.treeAdapter.isTextNode(firstChild)) { + var content = this.treeAdapter.getTextNodeContent(firstChild); + if (content[0] === '\n') + this.html += '\n'; + } + } + var childNodesHolder = tn === $.TEMPLATE && ns === NS.HTML ? this.treeAdapter.getChildNodes(node)[0] : node; + this._serializeChildNodes(childNodesHolder); + this.html += ''; + } + }; + Serializer.prototype._serializeAttributes = function(node) { + var attrs = this.treeAdapter.getAttrList(node); + for (var i = 0, + attrsLength = attrs.length; i < attrsLength; i++) { + var attr = attrs[i], + value = this.options.encodeHtmlEntities ? escapeString(attr.value, true) : attr.value; + this.html += ' '; + if (!attr.namespace) + this.html += attr.name; + else if (attr.namespace === NS.XML) + this.html += 'xml:' + attr.name; + else if (attr.namespace === NS.XMLNS) { + if (attr.name !== 'xmlns') + this.html += 'xmlns:'; + this.html += attr.name; + } else if (attr.namespace === NS.XLINK) + this.html += 'xlink:' + attr.name; + else + this.html += attr.namespace + ':' + attr.name; + this.html += '="' + value + '"'; + } + }; + Serializer.prototype._serializeTextNode = function(node) { + var content = this.treeAdapter.getTextNodeContent(node), + parent = this.treeAdapter.getParentNode(node), + parentTn = void 0; + if (parent && this.treeAdapter.isElementNode(parent)) + parentTn = this.treeAdapter.getTagName(parent); + if (parentTn === $.STYLE || parentTn === $.SCRIPT || parentTn === $.XMP || parentTn === $.IFRAME || parentTn === $.NOEMBED || parentTn === $.NOFRAMES || parentTn === $.PLAINTEXT || parentTn === $.NOSCRIPT) { + this.html += content; + } else + this.html += this.options.encodeHtmlEntities ? escapeString(content, false) : content; + }; + Serializer.prototype._serializeCommentNode = function(node) { + this.html += ''; + }; + Serializer.prototype._serializeDocumentTypeNode = function(node) { + var name = this.treeAdapter.getDocumentTypeNodeName(node), + publicId = this.treeAdapter.getDocumentTypeNodePublicId(node), + systemId = this.treeAdapter.getDocumentTypeNodeSystemId(node); + this.html += ''; + }; + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/jsdom/jsdom_parser", ["parse5/lib/tree_construction/parser", "parse5/lib/jsdom/parsing_unit"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Parser = require("parse5/lib/tree_construction/parser"), + ParsingUnit = require("parse5/lib/jsdom/parsing_unit"); + exports.parseDocument = function(html, treeAdapter) { + var parser = new Parser(treeAdapter), + parsingUnit = new ParsingUnit(parser); + parser._runParsingLoop = function() { + parsingUnit.parsingLoopLock = true; + while (!parsingUnit.suspended && !this.stopped) + this._iterateParsingLoop(); + parsingUnit.parsingLoopLock = false; + if (this.stopped) + parsingUnit.callback(this.document); + }; + process.nextTick(function() { + parser.parse(html); + }); + return parsingUnit; + }; + exports.parseInnerHtml = function(innerHtml, contextElement, treeAdapter) { + var parser = new Parser(treeAdapter); + return parser.parseFragment(innerHtml, contextElement); + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var exceptions_2 = require("angular2/src/core/di/exceptions"); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + var Dependency = (function() { + function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { + this.key = key; + this.optional = optional; + this.lowerBoundVisibility = lowerBoundVisibility; + this.upperBoundVisibility = upperBoundVisibility; + this.properties = properties; + } + Dependency.fromKey = function(key) { + return new Dependency(key, false, null, null, []); + }; + return Dependency; + })(); + exports.Dependency = Dependency; + var _EMPTY_LIST = lang_1.CONST_EXPR([]); + var Provider = (function() { + function Provider(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + this.token = token; + this.useClass = useClass; + this.useValue = useValue; + this.useExisting = useExisting; + this.useFactory = useFactory; + this.dependencies = deps; + this._multi = multi; + } + Object.defineProperty(Provider.prototype, "multi", { + get: function() { + return lang_1.normalizeBool(this._multi); + }, + enumerable: true, + configurable: true + }); + Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); + return Provider; + })(); + exports.Provider = Provider; + var Binding = (function(_super) { + __extends(Binding, _super); + function Binding(token, _a) { + var toClass = _a.toClass, + toValue = _a.toValue, + toAlias = _a.toAlias, + toFactory = _a.toFactory, + deps = _a.deps, + multi = _a.multi; + _super.call(this, token, { + useClass: toClass, + useValue: toValue, + useExisting: toAlias, + useFactory: toFactory, + deps: deps, + multi: multi + }); + } + Object.defineProperty(Binding.prototype, "toClass", { + get: function() { + return this.useClass; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toAlias", { + get: function() { + return this.useExisting; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toFactory", { + get: function() { + return this.useFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Binding.prototype, "toValue", { + get: function() { + return this.useValue; + }, + enumerable: true, + configurable: true + }); + Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); + return Binding; + })(Provider); + exports.Binding = Binding; + var ResolvedProvider_ = (function() { + function ResolvedProvider_(key, resolvedFactories, multiProvider) { + this.key = key; + this.resolvedFactories = resolvedFactories; + this.multiProvider = multiProvider; + } + Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { + get: function() { + return this.resolvedFactories[0]; + }, + enumerable: true, + configurable: true + }); + return ResolvedProvider_; + })(); + exports.ResolvedProvider_ = ResolvedProvider_; + var ResolvedFactory = (function() { + function ResolvedFactory(factory, dependencies) { + this.factory = factory; + this.dependencies = dependencies; + } + return ResolvedFactory; + })(); + exports.ResolvedFactory = ResolvedFactory; + function bind(token) { + return new ProviderBuilder(token); + } + exports.bind = bind; + function provide(token, _a) { + var useClass = _a.useClass, + useValue = _a.useValue, + useExisting = _a.useExisting, + useFactory = _a.useFactory, + deps = _a.deps, + multi = _a.multi; + return new Provider(token, { + useClass: useClass, + useValue: useValue, + useExisting: useExisting, + useFactory: useFactory, + deps: deps, + multi: multi + }); + } + exports.provide = provide; + var ProviderBuilder = (function() { + function ProviderBuilder(token) { + this.token = token; + } + ProviderBuilder.prototype.toClass = function(type) { + if (!lang_1.isType(type)) { + throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); + } + return new Provider(this.token, {useClass: type}); + }; + ProviderBuilder.prototype.toValue = function(value) { + return new Provider(this.token, {useValue: value}); + }; + ProviderBuilder.prototype.toAlias = function(aliasToken) { + if (lang_1.isBlank(aliasToken)) { + throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); + } + return new Provider(this.token, {useExisting: aliasToken}); + }; + ProviderBuilder.prototype.toFactory = function(factory, dependencies) { + if (!lang_1.isFunction(factory)) { + throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); + } + return new Provider(this.token, { + useFactory: factory, + deps: dependencies + }); + }; + return ProviderBuilder; + })(); + exports.ProviderBuilder = ProviderBuilder; + function resolveFactory(provider) { + var factoryFn; + var resolvedDeps; + if (lang_1.isPresent(provider.useClass)) { + var useClass = forward_ref_1.resolveForwardRef(provider.useClass); + factoryFn = reflection_1.reflector.factory(useClass); + resolvedDeps = _dependenciesFor(useClass); + } else if (lang_1.isPresent(provider.useExisting)) { + factoryFn = function(aliasInstance) { + return aliasInstance; + }; + resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; + } else if (lang_1.isPresent(provider.useFactory)) { + factoryFn = provider.useFactory; + resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); + } else { + factoryFn = function() { + return provider.useValue; + }; + resolvedDeps = _EMPTY_LIST; + } + return new ResolvedFactory(factoryFn, resolvedDeps); + } + exports.resolveFactory = resolveFactory; + function resolveProvider(provider) { + return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], false); + } + exports.resolveProvider = resolveProvider; + function resolveProviders(providers) { + var normalized = _createListOfProviders(_normalizeProviders(providers, new Map())); + return normalized.map(function(b) { + if (b instanceof _NormalizedProvider) { + return new ResolvedProvider_(b.key, [b.resolvedFactory], false); + } else { + var arr = b; + return new ResolvedProvider_(arr[0].key, arr.map(function(_) { + return _.resolvedFactory; + }), true); + } + }); + } + exports.resolveProviders = resolveProviders; + var _NormalizedProvider = (function() { + function _NormalizedProvider(key, resolvedFactory) { + this.key = key; + this.resolvedFactory = resolvedFactory; + } + return _NormalizedProvider; + })(); + function _createListOfProviders(flattenedProviders) { + return collection_1.MapWrapper.values(flattenedProviders); + } + function _normalizeProviders(providers, res) { + providers.forEach(function(b) { + if (b instanceof lang_1.Type) { + _normalizeProvider(provide(b, {useClass: b}), res); + } else if (b instanceof Provider) { + _normalizeProvider(b, res); + } else if (b instanceof Array) { + _normalizeProviders(b, res); + } else if (b instanceof ProviderBuilder) { + throw new exceptions_2.InvalidProviderError(b.token); + } else { + throw new exceptions_2.InvalidProviderError(b); + } + }); + return res; + } + function _normalizeProvider(b, res) { + var key = key_1.Key.get(b.token); + var factory = resolveFactory(b); + var normalized = new _NormalizedProvider(key, factory); + if (b.multi) { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + existingProvider.push(normalized); + } else if (lang_1.isBlank(existingProvider)) { + res.set(key.id, [normalized]); + } else { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + } else { + var existingProvider = res.get(key.id); + if (existingProvider instanceof Array) { + throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existingProvider, b); + } + res.set(key.id, normalized); + } + } + function _constructDependencies(factoryFunction, dependencies) { + if (lang_1.isBlank(dependencies)) { + return _dependenciesFor(factoryFunction); + } else { + var params = dependencies.map(function(t) { + return [t]; + }); + return dependencies.map(function(t) { + return _extractToken(factoryFunction, t, params); + }); + } + } + function _dependenciesFor(typeOrFunc) { + var params = reflection_1.reflector.parameters(typeOrFunc); + if (lang_1.isBlank(params)) + return []; + if (params.some(lang_1.isBlank)) { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + return params.map(function(p) { + return _extractToken(typeOrFunc, p, params); + }); + } + function _extractToken(typeOrFunc, metadata, params) { + var depProps = []; + var token = null; + var optional = false; + if (!lang_1.isArray(metadata)) { + if (metadata instanceof metadata_1.InjectMetadata) { + return _createDependency(metadata.token, optional, null, null, depProps); + } else { + return _createDependency(metadata, optional, null, null, depProps); + } + } + var lowerBoundVisibility = null; + var upperBoundVisibility = null; + for (var i = 0; i < metadata.length; ++i) { + var paramMetadata = metadata[i]; + if (paramMetadata instanceof lang_1.Type) { + token = paramMetadata; + } else if (paramMetadata instanceof metadata_1.InjectMetadata) { + token = paramMetadata.token; + } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { + optional = true; + } else if (paramMetadata instanceof metadata_1.SelfMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.HostMetadata) { + upperBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { + lowerBoundVisibility = paramMetadata; + } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { + if (lang_1.isPresent(paramMetadata.token)) { + token = paramMetadata.token; + } + depProps.push(paramMetadata); + } + } + token = forward_ref_1.resolveForwardRef(token); + if (lang_1.isPresent(token)) { + return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } else { + throw new exceptions_2.NoAnnotationError(typeOrFunc, params); + } + } + function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { + return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/core/change_detection/observable_facade"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var collection_1 = require("angular2/src/facade/collection"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var profile_1 = require("angular2/src/core/profile/profile"); + var observable_facade_1 = require("angular2/src/core/change_detection/observable_facade"); + var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); + var _Context = (function() { + function _Context(element, componentElement, context, locals, injector, expression) { + this.element = element; + this.componentElement = componentElement; + this.context = context; + this.locals = locals; + this.injector = injector; + this.expression = expression; + } + return _Context; + })(); + var AbstractChangeDetector = (function() { + function AbstractChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { + this.id = id; + this.dispatcher = dispatcher; + this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; + this.bindingTargets = bindingTargets; + this.directiveIndices = directiveIndices; + this.strategy = strategy; + this.contentChildren = []; + this.viewChildren = []; + this.state = constants_1.ChangeDetectorState.NeverChecked; + this.locals = null; + this.mode = null; + this.pipes = null; + this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); + } + AbstractChangeDetector.prototype.addContentChild = function(cd) { + this.contentChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeContentChild = function(cd) { + collection_1.ListWrapper.remove(this.contentChildren, cd); + }; + AbstractChangeDetector.prototype.addViewChild = function(cd) { + this.viewChildren.push(cd); + cd.parent = this; + }; + AbstractChangeDetector.prototype.removeViewChild = function(cd) { + collection_1.ListWrapper.remove(this.viewChildren, cd); + }; + AbstractChangeDetector.prototype.remove = function() { + this.parent.removeContentChild(this); + }; + AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, locals) { + var res = this.handleEventInternal(eventName, elIndex, locals); + this.markPathToRootAsCheckOnce(); + return res; + }; + AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + return false; + }; + AbstractChangeDetector.prototype.detectChanges = function() { + this.runDetectChanges(false); + }; + AbstractChangeDetector.prototype.checkNoChanges = function() { + if (lang_1.assertionsEnabled()) { + this.runDetectChanges(true); + } + }; + AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { + if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) + return ; + var s = _scope_check(this.id, throwOnChange); + this.detectChangesInRecords(throwOnChange); + this._detectChangesContentChildren(throwOnChange); + if (!throwOnChange) + this.afterContentLifecycleCallbacks(); + this._detectChangesInViewChildren(throwOnChange); + if (!throwOnChange) + this.afterViewLifecycleCallbacks(); + if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) + this.mode = constants_1.ChangeDetectionStrategy.Checked; + this.state = constants_1.ChangeDetectorState.CheckedBefore; + profile_1.wtfLeave(s); + }; + AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { + if (!this.hydrated()) { + this.throwDehydratedError(); + } + try { + this.detectChangesInRecordsInternal(throwOnChange); + } catch (e) { + if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { + this.state = constants_1.ChangeDetectorState.Errored; + } + this._throwError(e, e.stack); + } + }; + AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; + AbstractChangeDetector.prototype.hydrate = function(context, locals, directives, pipes) { + this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); + this.context = context; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this.observeComponent(context); + } + this.locals = locals; + this.pipes = pipes; + this.hydrateDirectives(directives); + this.state = constants_1.ChangeDetectorState.NeverChecked; + }; + AbstractChangeDetector.prototype.hydrateDirectives = function(directives) {}; + AbstractChangeDetector.prototype.dehydrate = function() { + this.dehydrateDirectives(true); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + this._unsubsribeFromObservables(); + } + this.context = null; + this.locals = null; + this.pipes = null; + }; + AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; + AbstractChangeDetector.prototype.hydrated = function() { + return this.context !== null; + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { + this.dispatcher.notifyAfterContentChecked(); + this.afterContentLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { + this.dispatcher.notifyAfterViewChecked(); + this.afterViewLifecycleCallbacksInternal(); + }; + AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; + AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { + var c = this.contentChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { + var c = this.viewChildren; + for (var i = 0; i < c.length; ++i) { + c[i].runDetectChanges(throwOnChange); + } + }; + AbstractChangeDetector.prototype.markAsCheckOnce = function() { + this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + }; + AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { + var c = this; + while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { + if (c.mode === constants_1.ChangeDetectionStrategy.Checked) + c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; + c = c.parent; + } + }; + AbstractChangeDetector.prototype._unsubsribeFromObservables = function() { + if (lang_1.isPresent(this.subscriptions)) { + for (var i = 0; i < this.subscriptions.length; ++i) { + var s = this.subscriptions[i]; + if (lang_1.isPresent(this.subscriptions[i])) { + s.cancel(); + this.subscriptions[i] = null; + } + } + } + }; + AbstractChangeDetector.prototype.observeValue = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + if (lang_1.isBlank(this.subscriptions[index])) { + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } else if (this.streams[index] !== value.changes) { + this.subscriptions[index].cancel(); + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + } + return value; + }; + AbstractChangeDetector.prototype.observeDirective = function(value, index) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; + this.streams[arrayIndex] = value.changes; + this.subscriptions[arrayIndex] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype.observeComponent = function(value) { + var _this = this; + if (observable_facade_1.isObservable(value)) { + this._createArrayToStoreObservables(); + var index = this.numberOfPropertyProtoRecords + 1; + this.streams[index] = value.changes; + this.subscriptions[index] = value.changes.listen(function(_) { + return _this.ref.markForCheck(); + }); + } + return value; + }; + AbstractChangeDetector.prototype._createArrayToStoreObservables = function() { + if (lang_1.isBlank(this.subscriptions)) { + this.subscriptions = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + this.streams = collection_1.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords + this.directiveIndices.length + 2); + } + }; + AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { + return directives.getDirectiveFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { + return directives.getDetectorFor(this.directiveIndices[index]); + }; + AbstractChangeDetector.prototype.notifyDispatcher = function(value) { + this.dispatcher.notifyOnBinding(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.logBindingUpdate = function(value) { + this.dispatcher.logBindingUpdate(this._currentBinding(), value); + }; + AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { + if (lang_1.isBlank(changes)) { + changes = {}; + } + changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); + return changes; + }; + AbstractChangeDetector.prototype._throwError = function(exception, stack) { + var error; + try { + var c = this.dispatcher.getDebugContext(this._currentBinding().elementIndex, null); + var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; + error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); + } catch (e) { + error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); + } + throw error; + }; + AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { + throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); + }; + AbstractChangeDetector.prototype.throwDehydratedError = function() { + throw new exceptions_1.DehydratedException(); + }; + AbstractChangeDetector.prototype._currentBinding = function() { + return this.bindingTargets[this.propertyBindingIndex]; + }; + return AbstractChangeDetector; + })(); + exports.AbstractChangeDetector = AbstractChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); + var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); + var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + var IS_CHANGED_LOCAL = "isChanged"; + var CHANGES_LOCAL = "changes"; + var ChangeDetectorJITGenerator = (function() { + function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { + this.changeDetectionUtilVarName = changeDetectionUtilVarName; + this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; + this.changeDetectorStateVarName = changeDetectorStateVarName; + var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); + var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); + var propertyBindingTargets = definition.bindingRecords.map(function(b) { + return b.target; + }); + this.id = definition.id; + this.changeDetectionStrategy = definition.strategy; + this.genConfig = definition.genConfig; + this.records = propertyBindingRecords; + this.propertyBindingTargets = propertyBindingTargets; + this.eventBindings = eventBindingRecords; + this.directiveRecords = definition.directiveRecords; + this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); + this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, this.changeDetectionStrategy); + this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); + } + ChangeDetectorJITGenerator.prototype.generate = function() { + var factorySource = "\n " + this.generateSource() + "\n return function(dispatcher) {\n return new " + this.typeName + "(dispatcher);\n }\n "; + return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); + }; + ChangeDetectorJITGenerator.prototype.generateSource = function() { + return "\n var " + this.typeName + " = function " + this.typeName + "(dispatcher) {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", dispatcher, " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; + }; + ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { + var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); + return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { + var indices = this._logic.genDirectiveIndices(this.directiveRecords); + return this.typeName + ".gen_directiveIndices = " + indices + ";"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { + var _this = this; + if (this.eventBindings.length > 0) { + var handlers = this.eventBindings.map(function(eb) { + return _this._genEventBinding(eb); + }).join("\n"); + return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { + var _this = this; + var codes = []; + this._endOfBlockIdxs = []; + collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { + var code; + if (r.isConditionalSkipRecord()) { + code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); + } else if (r.isUnconditionalSkipRecord()) { + code = _this._genUnconditionalSkip(r); + } else { + code = _this._genEventBindingEval(eb, r); + } + code += _this._genEndOfSkipBlock(i); + codes.push(code); + }); + return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { + if (r.lastInBinding) { + var evalRecord = this._logic.genEventBindingEvalValue(eb, r); + var markPath = this._genMarkPathToRootAsCheckOnce(r); + var prevDefault = this._genUpdatePreventDefault(eb, r); + return evalRecord + "\n" + markPath + "\n" + prevDefault; + } else { + return this._logic.genEventBindingEvalValue(eb, r); + } + }; + ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { + var br = r.bindingRecord; + if (br.isDefaultChangeDetection()) { + return ""; + } else { + return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; + } + }; + ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { + var local = this._names.getEventLocalName(eb, r.selfIndex); + return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { + var destroyPipesCode = this._names.genPipeOnDestroy(); + if (destroyPipesCode) { + destroyPipesCode = "if (destroyPipes) { " + destroyPipesCode + " }"; + } + var dehydrateFieldsCode = this._names.genDehydrateFields(); + if (!destroyPipesCode && !dehydrateFieldsCode) + return ''; + return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n " + destroyPipesCode + "\n " + dehydrateFieldsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { + var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); + var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); + if (!hydrateDirectivesCode && !hydrateDetectorsCode) + return ''; + return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { + var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { + var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); + if (notifications.length > 0) { + var directiveNotifications = notifications.join("\n"); + return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { + var codes = []; + this._endOfBlockIdxs = []; + for (var i = 0; i < rs.length; i++) { + var code = void 0; + var r = rs[i]; + if (r.isLifeCycleRecord()) { + code = this._genDirectiveLifecycle(r); + } else if (r.isPipeRecord()) { + code = this._genPipeCheck(r); + } else if (r.isConditionalSkipRecord()) { + code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); + } else if (r.isUnconditionalSkipRecord()) { + code = this._genUnconditionalSkip(r); + } else { + code = this._genReferenceCheck(r); + } + code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; + codes.push(code); + } + return codes.join("\n"); + }; + ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { + var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "if (" + maybeNegate + condition + ") {"; + }; + ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { + this._endOfBlockIdxs.pop(); + this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); + return "} else {"; + }; + ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { + if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { + var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); + if (protoIndex === endOfBlock) { + this._endOfBlockIdxs.pop(); + return '}'; + } + } + return ''; + }; + ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { + if (r.name === "DoCheck") { + return this._genOnCheck(r); + } else if (r.name === "OnInit") { + return this._genOnInit(r); + } else if (r.name === "OnChanges") { + return this._genOnChange(r); + } else { + throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); + } + }; + ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { + var _this = this; + var context = this._names.getLocalName(r.contextIndex); + var argString = r.args.map(function(arg) { + return _this._names.getLocalName(arg); + }).join(", "); + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var pipe = this._names.getPipeName(r.selfIndex); + var pipeName = r.name; + var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; + var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; + var contexOrArgCheck = r.args.map(function(a) { + return _this._names.getChangeName(a); + }); + contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); + var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isUsedByOtherRecord()) { + return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return init + " if (" + condition + ") { " + genCode + " }"; + } + }; + ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { + var _this = this; + var oldValue = this._names.getFieldName(r.selfIndex); + var newValue = this._names.getLocalName(r.selfIndex); + var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; + var check = "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; + var genCode = r.shouldBeChecked() ? "" + read + check : read; + if (r.isPureFunction()) { + var condition = r.args.map(function(a) { + return _this._names.getChangeName(a); + }).join(" || "); + if (r.isUsedByOtherRecord()) { + return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; + } else { + return "if (" + condition + ") { " + genCode + " }"; + } + } else { + return genCode; + } + }; + ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { + return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; + }; + ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { + if (!r.lastInBinding) + return ""; + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; + var br = r.bindingRecord; + if (br.target.isDirective()) { + var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; + } else { + return "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; + } + }; + ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { + if (lang_1.assertionsEnabled()) { + return "\n if(throwOnChange) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; + } else { + return ''; + } + }; + ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { + var newValue = this._names.getLocalName(r.selfIndex); + var oldValue = this._names.getFieldName(r.selfIndex); + if (!r.bindingRecord.callOnChanges()) + return ""; + return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; + }; + ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); + var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; + }; + ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { + if (!r.lastInDirective) + return ""; + return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; + }; + ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".doCheck();"; + }; + ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onInit();"; + }; + ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { + var br = r.bindingRecord; + return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".onChanges(" + CHANGES_LOCAL + ");"; + }; + ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { + var br = r.bindingRecord; + if (!r.lastInDirective || br.isDefaultChangeDetection()) + return ""; + var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; + return retVal; + }; + return ChangeDetectorJITGenerator; + })(); + exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Observable", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/util/root", "@reactivex/rxjs/dist/cjs/util/Symbol_observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _utilRoot = require("@reactivex/rxjs/dist/cjs/util/root"); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var Observable = (function() { + function Observable(subscribe) { + _classCallCheck(this, Observable); + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function lift(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[_utilSymbol_observable2['default']] = function() { + return this; + }; + Observable.prototype.subscribe = function subscribe(observerOrNext, error, complete) { + var subscriber = undefined; + if (observerOrNext && typeof observerOrNext === "object") { + if (observerOrNext instanceof _Subscriber2['default']) { + subscriber = observerOrNext; + } else { + subscriber = new _Subscriber2['default'](observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = _Subscriber2['default'].create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function forEach(next, PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (_utilRoot.root.Rx && _utilRoot.root.Rx.config && _utilRoot.root.Rx.config.Promise) { + PromiseCtor = _utilRoot.root.Rx.config.Promise; + } else if (_utilRoot.root.Promise) { + PromiseCtor = _utilRoot.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + _this.subscribe(next, reject, resolve); + }); + }; + Observable.prototype._subscribe = function _subscribe(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + return Observable; + })(); + exports['default'] = Observable; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _ErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _ErrorObservable2 = _interopRequireDefault(_ErrorObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ScalarObservable = (function(_Observable) { + _inherits(ScalarObservable, _Observable); + function ScalarObservable(value, scheduler) { + _classCallCheck(this, ScalarObservable); + _Observable.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function create(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function dispatch(state) { + var done = state.done; + var value = state.value; + var subscriber = state.subscriber; + if (done) { + subscriber.complete(); + return ; + } + subscriber.next(value); + if (subscriber.isUnsubscribed) { + return ; + } + state.done = true; + this.schedule(state); + }; + ScalarObservable.prototype._subscribe = function _subscribe(subscriber) { + var value = this.value; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ScalarObservable.dispatch, 0, { + done: false, + value: value, + subscriber: subscriber + })); + } else { + subscriber.next(value); + if (!subscriber.isUnsubscribed) { + subscriber.complete(); + } + } + }; + return ScalarObservable; + })(_Observable3['default']); + exports['default'] = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = _utilTryCatch2['default'](project).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = _utilTryCatch2['default'](select).call(thisArg || this, this.value, 0); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else if (result) { + return this; + } else { + return new _EmptyObservable2['default'](); + } + }; + proto.reduce = function(project, acc) { + if (typeof acc === 'undefined') { + return this; + } + var result = _utilTryCatch2['default'](project)(acc, this.value); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate, thisArg) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = _utilTryCatch2['default'](predicate).call(thisArg || this, this.value, 0, this); + if (result === _utilErrorObject.errorObject) { + return new _ErrorObservable2['default'](_utilErrorObject.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new _EmptyObservable2['default'](); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new _EmptyObservable2['default'](); + }; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support", ["@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject", "@reactivex/rxjs/dist/cjs/OuterSubscriber", "@reactivex/rxjs/dist/cjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + var _OuterSubscriber2 = require("@reactivex/rxjs/dist/cjs/OuterSubscriber"); + var _OuterSubscriber3 = _interopRequireDefault(_OuterSubscriber2); + var _utilSubscribeToResult = require("@reactivex/rxjs/dist/cjs/util/subscribeToResult"); + var _utilSubscribeToResult2 = _interopRequireDefault(_utilSubscribeToResult); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + _classCallCheck(this, CombineLatestOperator); + this.project = project; + } + CombineLatestOperator.prototype.call = function call(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_OuterSubscriber) { + _inherits(CombineLatestSubscriber, _OuterSubscriber); + function CombineLatestSubscriber(destination, project) { + _classCallCheck(this, CombineLatestSubscriber); + _OuterSubscriber.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function _next(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function _complete() { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } else { + this.active = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(_utilSubscribeToResult2['default'](this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function notifyComplete(innerSubscriber) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function notifyNext(observable, value, outerIndex, innerIndex) { + var values = this.values; + values[outerIndex] = value; + var toRespond = this.toRespond; + if (toRespond.length > 0) { + var found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + if (toRespond.length === 0) { + var project = this.project; + var destination = this.destination; + if (project) { + var result = _utilTryCatch2['default'](project).apply(this, values); + if (result === _utilErrorObject.errorObject) { + destination.error(_utilErrorObject.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(_OuterSubscriber3['default']); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _ImmediateScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler2 = _interopRequireDefault(_ImmediateScheduler); + exports['default'] = new _ImmediateScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable", ["@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IteratorObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/util/Symbol_observable", "@reactivex/rxjs/dist/cjs/util/Symbol_iterator", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/observeOn-support", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _PromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _PromiseObservable2 = _interopRequireDefault(_PromiseObservable); + var _IteratorObservable = require("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"); + var _IteratorObservable2 = _interopRequireDefault(_IteratorObservable); + var _ArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _ArrayObservable2 = _interopRequireDefault(_ArrayObservable); + var _utilSymbol_observable = require("@reactivex/rxjs/dist/cjs/util/Symbol_observable"); + var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable); + var _utilSymbol_iterator = require("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"); + var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _operatorsObserveOnSupport = require("@reactivex/rxjs/dist/cjs/operators/observeOn-support"); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + var isArray = Array.isArray; + var FromObservable = (function(_Observable) { + _inherits(FromObservable, _Observable); + function FromObservable(ish, scheduler) { + _classCallCheck(this, FromObservable); + _Observable.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function create(ish) { + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersImmediate2['default'] : arguments[1]; + if (ish) { + if (isArray(ish)) { + return new _ArrayObservable2['default'](ish, scheduler); + } else if (typeof ish.then === 'function') { + return new _PromiseObservable2['default'](ish, scheduler); + } else if (typeof ish[_utilSymbol_observable2['default']] === 'function') { + if (ish instanceof _Observable3['default']) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[_utilSymbol_iterator2['default']] === 'function') { + return new _IteratorObservable2['default'](ish, null, null, scheduler); + } + } + throw new TypeError(typeof ish + ' is not observable'); + }; + FromObservable.prototype._subscribe = function _subscribe(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === _schedulersImmediate2['default']) { + return ish[_utilSymbol_observable2['default']]().subscribe(subscriber); + } else { + return ish[_utilSymbol_observable2['default']]().subscribe(new _operatorsObserveOnSupport.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(_Observable3['default']); + exports['default'] = FromObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler", ["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler", "@reactivex/rxjs/dist/cjs/schedulers/NextTickAction", "@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _ImmediateScheduler2 = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"); + var _ImmediateScheduler3 = _interopRequireDefault(_ImmediateScheduler2); + var _NextTickAction = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"); + var _NextTickAction2 = _interopRequireDefault(_NextTickAction); + var _ImmediateAction = require("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"); + var _ImmediateAction2 = _interopRequireDefault(_ImmediateAction); + var NextTickScheduler = (function(_ImmediateScheduler) { + _inherits(NextTickScheduler, _ImmediateScheduler); + function NextTickScheduler() { + _classCallCheck(this, NextTickScheduler); + _ImmediateScheduler.apply(this, arguments); + } + NextTickScheduler.prototype.scheduleNow = function scheduleNow(work, state) { + return (this.scheduled ? new _ImmediateAction2['default'](this, work) : new _NextTickAction2['default'](this, work)).schedule(state); + }; + return NextTickScheduler; + })(_ImmediateScheduler3['default']); + exports['default'] = NextTickScheduler; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/groupBy", ["@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/util/Map", "@reactivex/rxjs/dist/cjs/util/FastMap", "@reactivex/rxjs/dist/cjs/operators/groupBy-support", "@reactivex/rxjs/dist/cjs/util/tryCatch", "@reactivex/rxjs/dist/cjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports.groupBy = groupBy; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Subscriber3 = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber4 = _interopRequireDefault(_Subscriber3); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _utilMap = require("@reactivex/rxjs/dist/cjs/util/Map"); + var _utilMap2 = _interopRequireDefault(_utilMap); + var _utilFastMap = require("@reactivex/rxjs/dist/cjs/util/FastMap"); + var _utilFastMap2 = _interopRequireDefault(_utilFastMap); + var _groupBySupport = require("@reactivex/rxjs/dist/cjs/operators/groupBy-support"); + var _utilTryCatch = require("@reactivex/rxjs/dist/cjs/util/tryCatch"); + var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch); + var _utilErrorObject = require("@reactivex/rxjs/dist/cjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + var GroupByObservable = (function(_Observable) { + _inherits(GroupByObservable, _Observable); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupByObservable); + _Observable.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function _subscribe(subscriber) { + var refCountSubscription = new _groupBySupport.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(_Observable3['default']); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_Subscriber) { + _inherits(GroupBySubscriber, _Subscriber); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _classCallCheck(this, GroupBySubscriber); + _Subscriber.call(this); + this.refCountSubscription = refCountSubscription; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + this.groups = null; + this.destination = destination; + this.add(destination); + } + GroupBySubscriber.prototype._next = function _next(x) { + var key = _utilTryCatch2['default'](this.keySelector)(x); + if (key === _utilErrorObject.errorObject) { + this.error(key.e); + } else { + var groups = this.groups; + var elementSelector = this.elementSelector; + var durationSelector = this.durationSelector; + if (!groups) { + groups = this.groups = typeof key === 'string' ? new _utilFastMap2['default']() : new _utilMap2['default'](); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new _Subject2['default']()); + var groupedObservable = new _groupBySupport.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = _utilTryCatch2['default'](durationSelector)(new _groupBySupport.GroupedObservable(key, group)); + if (duration === _utilErrorObject.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = _utilTryCatch2['default'](elementSelector)(x); + if (value === _utilErrorObject.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function _error(err) { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.error(err); + _this.removeGroup(key); + }); + } + this.destination.error(err); + }; + GroupBySubscriber.prototype._complete = function _complete() { + var _this2 = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this2.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function removeGroup(key) { + this.groups['delete'](key); + }; + return GroupBySubscriber; + })(_Subscriber4['default']); + var GroupDurationSubscriber = (function(_Subscriber2) { + _inherits(GroupDurationSubscriber, _Subscriber2); + function GroupDurationSubscriber(key, group, parent) { + _classCallCheck(this, GroupDurationSubscriber); + _Subscriber2.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function _next(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function _error(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function _complete() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(_Subscriber4['default']); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref", "angular2/src/core/render/api", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_listener", "angular2/src/core/profile/profile", "angular2/src/core/linker/proto_view_factory"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var viewModule = require("angular2/src/core/linker/view"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var api_1 = require("angular2/src/core/render/api"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var profile_1 = require("angular2/src/core/profile/profile"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var AppViewManager = (function() { + function AppViewManager() {} + AppViewManager.prototype.getHostElement = function(hostViewRef) { + var hostView = view_ref_1.internalView(hostViewRef); + if (hostView.proto.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This operation is only allowed on host views'); + } + return hostView.elementRefs[hostView.elementOffset]; + }; + return AppViewManager; + })(); + exports.AppViewManager = AppViewManager; + var AppViewManager_ = (function(_super) { + __extends(AppViewManager_, _super); + function AppViewManager_(_viewPool, _viewListener, _utils, _renderer, _protoViewFactory) { + _super.call(this); + this._viewPool = _viewPool; + this._viewListener = _viewListener; + this._utils = _utils; + this._renderer = _renderer; + this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); + this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); + this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); + this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); + this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); + this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); + this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); + this._protoViewFactory = _protoViewFactory; + } + AppViewManager_.prototype.getViewContainer = function(location) { + var hostView = view_ref_1.internalView(location.parentView); + return hostView.elementInjectors[location.boundElementIndex].getViewContainerRef(); + }; + AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + var componentView = hostView.getNestedView(boundElementIndex); + if (lang_1.isBlank(componentView)) { + throw new exceptions_1.BaseException("There is no component directive at element " + boundElementIndex); + } + var binderIdx = componentView.proto.variableLocations.get(variableName); + if (lang_1.isBlank(binderIdx)) { + throw new exceptions_1.BaseException("Could not find variable " + variableName); + } + return componentView.elementRefs[componentView.elementOffset + binderIdx]; + }; + AppViewManager_.prototype.getComponent = function(hostLocation) { + var hostView = view_ref_1.internalView(hostLocation.parentView); + var boundElementIndex = hostLocation.boundElementIndex; + return this._utils.getComponentInstance(hostView, boundElementIndex); + }; + AppViewManager_.prototype.createRootHostView = function(hostProtoViewRef, overrideSelector, injector) { + var s = this._createRootHostViewScope(); + var hostProtoView = view_ref_1.internalProtoView(hostProtoViewRef); + this._protoViewFactory.initializeProtoViewIfNeeded(hostProtoView); + var hostElementSelector = overrideSelector; + if (lang_1.isBlank(hostElementSelector)) { + hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector; + } + var renderViewWithFragments = this._renderer.createRootHostView(hostProtoView.render, hostProtoView.mergeInfo.embeddedViewCount + 1, hostElementSelector); + var hostView = this._createMainView(hostProtoView, renderViewWithFragments); + this._renderer.hydrateView(hostView.render); + this._utils.hydrateRootHostView(hostView, injector); + return profile_1.wtfLeave(s, hostView.ref); + }; + AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { + var s = this._destroyRootHostViewScope(); + var hostView = view_ref_1.internalView(hostViewRef); + this._renderer.detachFragment(hostView.renderFragment); + this._renderer.dehydrateView(hostView.render); + this._viewDehydrateRecurse(hostView); + this._viewListener.onViewDestroyed(hostView); + this._renderer.destroyView(hostView.render); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { + var s = this._createEmbeddedViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(templateRef.protoViewRef); + if (protoView.type !== viewModule.ViewType.EMBEDDED) { + throw new exceptions_1.BaseException('This method can only be called with embedded ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, templateRef.elementRef, null)); + }; + AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, protoViewRef, imperativelyCreatedInjector) { + var s = this._createHostViewInContainerScope(); + var protoView = view_ref_1.internalProtoView(protoViewRef); + if (protoView.type !== viewModule.ViewType.HOST) { + throw new exceptions_1.BaseException('This method can only be called with host ProtoViews!'); + } + this._protoViewFactory.initializeProtoViewIfNeeded(protoView); + return profile_1.wtfLeave(s, this._createViewInContainer(viewContainerLocation, index, protoView, viewContainerLocation, imperativelyCreatedInjector)); + }; + AppViewManager_.prototype._createViewInContainer = function(viewContainerLocation, index, protoView, context, imperativelyCreatedInjector) { + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var contextView = view_ref_1.internalView(context.parentView); + var contextBoundElementIndex = context.boundElementIndex; + var embeddedFragmentView = contextView.getNestedView(contextBoundElementIndex); + var view; + if (protoView.type === viewModule.ViewType.EMBEDDED && lang_1.isPresent(embeddedFragmentView) && !embeddedFragmentView.hydrated()) { + view = embeddedFragmentView; + this._attachRenderView(parentView, boundElementIndex, index, view); + } else { + view = this._createPooledView(protoView); + this._attachRenderView(parentView, boundElementIndex, index, view); + this._renderer.hydrateView(view.render); + } + this._utils.attachViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, view); + this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView, contextBoundElementIndex, index, imperativelyCreatedInjector); + return view.ref; + }; + AppViewManager_.prototype._attachRenderView = function(parentView, boundElementIndex, index, view) { + var elementRef = parentView.elementRefs[boundElementIndex]; + if (index === 0) { + this._renderer.attachFragmentAfterElement(elementRef, view.renderFragment); + } else { + var prevView = parentView.viewContainers[boundElementIndex].views[index - 1]; + this._renderer.attachFragmentAfterFragment(prevView.renderFragment, view.renderFragment); + } + }; + AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { + var s = this._destroyViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._destroyViewInContainer(parentView, boundElementIndex, index); + profile_1.wtfLeave(s); + }; + AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { + var s = this._attachViewInContainerScope(); + var view = view_ref_1.internalView(viewRef); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + this._utils.attachViewInContainer(parentView, boundElementIndex, null, null, index, view); + this._attachRenderView(parentView, boundElementIndex, index, view); + return profile_1.wtfLeave(s, viewRef); + }; + AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { + var s = this._detachViewInContainerScope(); + var parentView = view_ref_1.internalView(viewContainerLocation.parentView); + var boundElementIndex = viewContainerLocation.boundElementIndex; + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + this._renderer.detachFragment(view.renderFragment); + return profile_1.wtfLeave(s, view.ref); + }; + AppViewManager_.prototype._createMainView = function(protoView, renderViewWithFragments) { + var mergedParentView = this._utils.createView(protoView, renderViewWithFragments, this, this._renderer); + this._renderer.setEventDispatcher(mergedParentView.render, mergedParentView); + this._viewListener.onViewCreated(mergedParentView); + return mergedParentView; + }; + AppViewManager_.prototype._createPooledView = function(protoView) { + var view = this._viewPool.getView(protoView); + if (lang_1.isBlank(view)) { + view = this._createMainView(protoView, this._renderer.createView(protoView.render, protoView.mergeInfo.embeddedViewCount + 1)); + } + return view; + }; + AppViewManager_.prototype._destroyPooledView = function(view) { + var wasReturned = this._viewPool.returnView(view); + if (!wasReturned) { + this._viewListener.onViewDestroyed(view); + this._renderer.destroyView(view.render); + } + }; + AppViewManager_.prototype._destroyViewInContainer = function(parentView, boundElementIndex, index) { + var viewContainer = parentView.viewContainers[boundElementIndex]; + var view = viewContainer.views[index]; + this._viewDehydrateRecurse(view); + this._utils.detachViewInContainer(parentView, boundElementIndex, index); + if (view.viewOffset > 0) { + this._renderer.detachFragment(view.renderFragment); + } else { + this._renderer.dehydrateView(view.render); + this._renderer.detachFragment(view.renderFragment); + this._destroyPooledView(view); + } + }; + AppViewManager_.prototype._viewDehydrateRecurse = function(view) { + if (view.hydrated()) { + this._utils.dehydrateView(view); + } + var viewContainers = view.viewContainers; + var startViewOffset = view.viewOffset; + var endViewOffset = view.viewOffset + view.proto.mergeInfo.viewCount - 1; + var elementOffset = view.elementOffset; + for (var viewIdx = startViewOffset; viewIdx <= endViewOffset; viewIdx++) { + var currView = view.views[viewIdx]; + for (var binderIdx = 0; binderIdx < currView.proto.elementBinders.length; binderIdx++, elementOffset++) { + var vc = viewContainers[elementOffset]; + if (lang_1.isPresent(vc)) { + for (var j = vc.views.length - 1; j >= 0; j--) { + this._destroyViewInContainer(currView, elementOffset, j); + } + } + } + } + }; + AppViewManager_ = __decorate([di_1.Injectable(), __param(4, di_1.Inject(di_1.forwardRef(function() { + return proto_view_factory_1.ProtoViewFactory; + }))), __metadata('design:paramtypes', [view_pool_1.AppViewPool, view_listener_1.AppViewListener, view_manager_utils_1.AppViewManagerUtils, api_1.Renderer, Object])], AppViewManager_); + return AppViewManager_; + })(AppViewManager); + exports.AppViewManager_ = AppViewManager_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); + var animation_1 = require("angular2/src/animate/animation"); + var CssAnimationBuilder = (function() { + function CssAnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + this.data = new css_animation_options_1.CssAnimationOptions(); + } + CssAnimationBuilder.prototype.addAnimationClass = function(className) { + this.data.animationClasses.push(className); + return this; + }; + CssAnimationBuilder.prototype.addClass = function(className) { + this.data.classesToAdd.push(className); + return this; + }; + CssAnimationBuilder.prototype.removeClass = function(className) { + this.data.classesToRemove.push(className); + return this; + }; + CssAnimationBuilder.prototype.setDuration = function(duration) { + this.data.duration = duration; + return this; + }; + CssAnimationBuilder.prototype.setDelay = function(delay) { + this.data.delay = delay; + return this; + }; + CssAnimationBuilder.prototype.setStyles = function(from, to) { + return this.setFromStyles(from).setToStyles(to); + }; + CssAnimationBuilder.prototype.setFromStyles = function(from) { + this.data.fromStyles = from; + return this; + }; + CssAnimationBuilder.prototype.setToStyles = function(to) { + this.data.toStyles = to; + return this; + }; + CssAnimationBuilder.prototype.start = function(element) { + return new animation_1.Animation(element, this.data, this.browserDetails); + }; + return CssAnimationBuilder; + })(); + exports.CssAnimationBuilder = CssAnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var ng_class_1 = require("angular2/src/common/directives/ng_class"); + exports.NgClass = ng_class_1.NgClass; + var ng_for_1 = require("angular2/src/common/directives/ng_for"); + exports.NgFor = ng_for_1.NgFor; + var ng_if_1 = require("angular2/src/common/directives/ng_if"); + exports.NgIf = ng_if_1.NgIf; + var ng_style_1 = require("angular2/src/common/directives/ng_style"); + exports.NgStyle = ng_style_1.NgStyle; + var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); + exports.NgSwitch = ng_switch_1.NgSwitch; + exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; + exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; + __export(require("angular2/src/common/directives/observable_list_diff")); + var core_directives_1 = require("angular2/src/common/directives/core_directives"); + exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + var shared_1 = require("angular2/src/common/forms/directives/shared"); + var validators_1 = require("angular2/src/common/forms/validators"); + var controlNameBinding = lang_1.CONST_EXPR(new di_1.Provider(ng_control_1.NgControl, {useExisting: di_1.forwardRef(function() { + return NgControlName; + })})); + var NgControlName = (function(_super) { + __extends(NgControlName, _super); + function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { + _super.call(this); + this._parent = _parent; + this._validators = _validators; + this._asyncValidators = _asyncValidators; + this.update = new async_1.EventEmitter(); + this._added = false; + this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); + } + NgControlName.prototype.onChanges = function(changes) { + if (!this._added) { + this.formDirective.addControl(this); + this._added = true; + } + if (shared_1.isPropertyUpdated(changes, this.viewModel)) { + this.viewModel = this.model; + this.formDirective.updateModel(this, this.model); + } + }; + NgControlName.prototype.onDestroy = function() { + this.formDirective.removeControl(this); + }; + NgControlName.prototype.viewToModelUpdate = function(newValue) { + this.viewModel = newValue; + async_1.ObservableWrapper.callNext(this.update, newValue); + }; + Object.defineProperty(NgControlName.prototype, "path", { + get: function() { + return shared_1.controlPath(this.name, this._parent); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "formDirective", { + get: function() { + return this._parent.formDirective; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "validator", { + get: function() { + return shared_1.composeValidators(this._validators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "asyncValidator", { + get: function() { + return shared_1.composeAsyncValidators(this._asyncValidators); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NgControlName.prototype, "control", { + get: function() { + return this.formDirective.getControl(this); + }, + enumerable: true, + configurable: true + }); + NgControlName = __decorate([metadata_1.Directive({ + selector: '[ng-control]', + bindings: [controlNameBinding], + inputs: ['name: ngControl', 'model: ngModel'], + outputs: ['update: ngModelChange'], + exportAs: 'form' + }), __param(0, di_1.Host()), __param(0, di_1.SkipSelf()), __param(1, di_1.Optional()), __param(1, di_1.Inject(validators_1.NG_VALIDATORS)), __param(2, di_1.Optional()), __param(2, di_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, di_1.Optional()), __param(3, di_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); + return NgControlName; + })(ng_control_1.NgControl); + exports.NgControlName = NgControlName; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/shared/client_message_broker", ["angular2/src/web_workers/shared/message_bus", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/web_workers/shared/serializer", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/lang"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var di_1 = require("angular2/src/core/di"); + var lang_2 = require("angular2/src/facade/lang"); + var lang_3 = require("angular2/src/facade/lang"); + exports.Type = lang_3.Type; + var ClientMessageBrokerFactory = (function() { + function ClientMessageBrokerFactory() {} + return ClientMessageBrokerFactory; + })(); + exports.ClientMessageBrokerFactory = ClientMessageBrokerFactory; + var ClientMessageBrokerFactory_ = (function(_super) { + __extends(ClientMessageBrokerFactory_, _super); + function ClientMessageBrokerFactory_(_messageBus, _serializer) { + _super.call(this); + this._messageBus = _messageBus; + this._serializer = _serializer; + } + ClientMessageBrokerFactory_.prototype.createMessageBroker = function(channel, runInZone) { + if (runInZone === void 0) { + runInZone = true; + } + this._messageBus.initChannel(channel, runInZone); + return new ClientMessageBroker_(this._messageBus, this._serializer, channel); + }; + ClientMessageBrokerFactory_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, serializer_1.Serializer])], ClientMessageBrokerFactory_); + return ClientMessageBrokerFactory_; + })(ClientMessageBrokerFactory); + exports.ClientMessageBrokerFactory_ = ClientMessageBrokerFactory_; + var ClientMessageBroker = (function() { + function ClientMessageBroker() {} + return ClientMessageBroker; + })(); + exports.ClientMessageBroker = ClientMessageBroker; + var ClientMessageBroker_ = (function(_super) { + __extends(ClientMessageBroker_, _super); + function ClientMessageBroker_(messageBus, _serializer, channel) { + var _this = this; + _super.call(this); + this.channel = channel; + this._pending = new Map(); + this._sink = messageBus.to(channel); + this._serializer = _serializer; + var source = messageBus.from(channel); + async_1.ObservableWrapper.subscribe(source, function(message) { + return _this._handleMessage(message); + }); + } + ClientMessageBroker_.prototype._generateMessageId = function(name) { + var time = lang_1.stringify(lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now())); + var iteration = 0; + var id = name + time + lang_1.stringify(iteration); + while (lang_1.isPresent(this._pending[id])) { + id = "" + name + time + iteration; + iteration++; + } + return id; + }; + ClientMessageBroker_.prototype.runOnService = function(args, returnType) { + var _this = this; + var fnArgs = []; + if (lang_1.isPresent(args.args)) { + args.args.forEach(function(argument) { + if (argument.type != null) { + fnArgs.push(_this._serializer.serialize(argument.value, argument.type)); + } else { + fnArgs.push(argument.value); + } + }); + } + var promise; + var id = null; + if (returnType != null) { + var completer = async_1.PromiseWrapper.completer(); + id = this._generateMessageId(args.method); + this._pending.set(id, completer); + async_1.PromiseWrapper.catchError(completer.promise, function(err, stack) { + lang_1.print(err); + completer.reject(err, stack); + }); + promise = async_1.PromiseWrapper.then(completer.promise, function(value) { + if (_this._serializer == null) { + return value; + } else { + return _this._serializer.deserialize(value, returnType); + } + }); + } else { + promise = null; + } + var message = { + 'method': args.method, + 'args': fnArgs + }; + if (id != null) { + message['id'] = id; + } + async_1.ObservableWrapper.callNext(this._sink, message); + return promise; + }; + ClientMessageBroker_.prototype._handleMessage = function(message) { + var data = new MessageData(message); + if (lang_2.StringWrapper.equals(data.type, "result") || lang_2.StringWrapper.equals(data.type, "error")) { + var id = data.id; + if (this._pending.has(id)) { + if (lang_2.StringWrapper.equals(data.type, "result")) { + this._pending.get(id).resolve(data.value); + } else { + this._pending.get(id).reject(data.value, null); + } + this._pending.delete(id); + } + } + }; + return ClientMessageBroker_; + })(ClientMessageBroker); + exports.ClientMessageBroker_ = ClientMessageBroker_; + var MessageData = (function() { + function MessageData(data) { + this.type = collection_1.StringMapWrapper.get(data, "type"); + this.id = this._getValueIfPresent(data, "id"); + this.value = this._getValueIfPresent(data, "value"); + } + MessageData.prototype._getValueIfPresent = function(data, key) { + if (collection_1.StringMapWrapper.contains(data, key)) { + return collection_1.StringMapWrapper.get(data, key); + } else { + return null; + } + }; + return MessageData; + })(); + var FnArg = (function() { + function FnArg(value, type) { + this.value = value; + this.type = type; + } + return FnArg; + })(); + exports.FnArg = FnArg; + var UiArguments = (function() { + function UiArguments(method, args) { + this.method = method; + this.args = args; + } + return UiArguments; + })(); + exports.UiArguments = UiArguments; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/renderer", ["angular2/src/core/render/api", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/web_workers/shared/api", "angular2/src/web_workers/shared/messaging_api", "angular2/src/web_workers/worker/event_dispatcher"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var api_1 = require("angular2/src/core/render/api"); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var event_dispatcher_1 = require("angular2/src/web_workers/worker/event_dispatcher"); + var WebWorkerRenderer = (function() { + function WebWorkerRenderer(messageBrokerFactory, _renderProtoViewRefStore, _renderViewStore, _eventDispatcher) { + this._renderProtoViewRefStore = _renderProtoViewRefStore; + this._renderViewStore = _renderViewStore; + this._eventDispatcher = _eventDispatcher; + this._messageBroker = messageBrokerFactory.createMessageBroker(messaging_api_1.RENDERER_CHANNEL); + } + WebWorkerRenderer.prototype.registerComponentTemplate = function(template) { + var fnArgs = [new client_message_broker_1.FnArg(template, api_1.RenderComponentTemplate)]; + var args = new client_message_broker_1.UiArguments("registerComponentTemplate", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.createProtoView = function(componentTemplateId, cmds) { + var renderProtoViewRef = this._renderProtoViewRefStore.allocate(); + var fnArgs = [new client_message_broker_1.FnArg(componentTemplateId, null), new client_message_broker_1.FnArg(cmds, api_2.WebWorkerTemplateCmd), new client_message_broker_1.FnArg(renderProtoViewRef, api_1.RenderProtoViewRef)]; + var args = new client_message_broker_1.UiArguments("createProtoView", fnArgs); + this._messageBroker.runOnService(args, null); + return renderProtoViewRef; + }; + WebWorkerRenderer.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + return this._createViewHelper(hostProtoViewRef, fragmentCount, hostElementSelector); + }; + WebWorkerRenderer.prototype.createView = function(protoViewRef, fragmentCount) { + return this._createViewHelper(protoViewRef, fragmentCount); + }; + WebWorkerRenderer.prototype._createViewHelper = function(protoViewRef, fragmentCount, hostElementSelector) { + var renderViewWithFragments = this._renderViewStore.allocate(fragmentCount); + var startIndex = (renderViewWithFragments.viewRef).refNumber; + var fnArgs = [new client_message_broker_1.FnArg(protoViewRef, api_1.RenderProtoViewRef), new client_message_broker_1.FnArg(fragmentCount, null)]; + var method = "createView"; + if (lang_1.isPresent(hostElementSelector) && hostElementSelector != null) { + fnArgs.push(new client_message_broker_1.FnArg(hostElementSelector, null)); + method = "createRootHostView"; + } + fnArgs.push(new client_message_broker_1.FnArg(startIndex, null)); + var args = new client_message_broker_1.UiArguments(method, fnArgs); + this._messageBroker.runOnService(args, null); + return renderViewWithFragments; + }; + WebWorkerRenderer.prototype.destroyView = function(viewRef) { + var fnArgs = [new client_message_broker_1.FnArg(viewRef, api_1.RenderViewRef)]; + var args = new client_message_broker_1.UiArguments("destroyView", fnArgs); + this._messageBroker.runOnService(args, null); + this._renderViewStore.remove(viewRef); + }; + WebWorkerRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var fnArgs = [new client_message_broker_1.FnArg(previousFragmentRef, api_1.RenderFragmentRef), new client_message_broker_1.FnArg(fragmentRef, api_1.RenderFragmentRef)]; + var args = new client_message_broker_1.UiArguments("attachFragmentAfterFragment", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var fnArgs = [new client_message_broker_1.FnArg(elementRef, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(fragmentRef, api_1.RenderFragmentRef)]; + var args = new client_message_broker_1.UiArguments("attachFragmentAfterElement", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.detachFragment = function(fragmentRef) { + var fnArgs = [new client_message_broker_1.FnArg(fragmentRef, api_1.RenderFragmentRef)]; + var args = new client_message_broker_1.UiArguments("detachFragment", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.hydrateView = function(viewRef) { + var fnArgs = [new client_message_broker_1.FnArg(viewRef, api_1.RenderViewRef)]; + var args = new client_message_broker_1.UiArguments("hydrateView", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.dehydrateView = function(viewRef) { + var fnArgs = [new client_message_broker_1.FnArg(viewRef, api_1.RenderViewRef)]; + var args = new client_message_broker_1.UiArguments("dehydrateView", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.getNativeElementSync = function(location) { + return null; + }; + WebWorkerRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var fnArgs = [new client_message_broker_1.FnArg(location, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(propertyName, null), new client_message_broker_1.FnArg(propertyValue, null)]; + var args = new client_message_broker_1.UiArguments("setElementProperty", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var fnArgs = [new client_message_broker_1.FnArg(location, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(attributeName, null), new client_message_broker_1.FnArg(attributeValue, null)]; + var args = new client_message_broker_1.UiArguments("setElementAttribute", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.setElementClass = function(location, className, isAdd) { + var fnArgs = [new client_message_broker_1.FnArg(location, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(className, null), new client_message_broker_1.FnArg(isAdd, null)]; + var args = new client_message_broker_1.UiArguments("setElementClass", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var fnArgs = [new client_message_broker_1.FnArg(location, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(styleName, null), new client_message_broker_1.FnArg(styleValue, null)]; + var args = new client_message_broker_1.UiArguments("setElementStyle", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var fnArgs = [new client_message_broker_1.FnArg(location, api_2.WebWorkerElementRef), new client_message_broker_1.FnArg(methodName, null), new client_message_broker_1.FnArg(args, null)]; + var uiArgs = new client_message_broker_1.UiArguments("invokeElementMethod", fnArgs); + this._messageBroker.runOnService(uiArgs, null); + }; + WebWorkerRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var fnArgs = [new client_message_broker_1.FnArg(viewRef, api_1.RenderViewRef), new client_message_broker_1.FnArg(textNodeIndex, null), new client_message_broker_1.FnArg(text, null)]; + var args = new client_message_broker_1.UiArguments("setText", fnArgs); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + var fnArgs = [new client_message_broker_1.FnArg(viewRef, api_1.RenderViewRef)]; + var args = new client_message_broker_1.UiArguments("setEventDispatcher", fnArgs); + this._eventDispatcher.registerEventDispatcher(viewRef, dispatcher); + this._messageBroker.runOnService(args, null); + }; + WebWorkerRenderer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [client_message_broker_1.ClientMessageBrokerFactory, render_proto_view_ref_store_1.RenderProtoViewRefStore, render_view_with_fragments_store_1.RenderViewWithFragmentsStore, event_dispatcher_1.WebWorkerEventDispatcher])], WebWorkerRenderer); + return WebWorkerRenderer; + })(); + exports.WebWorkerRenderer = WebWorkerRenderer; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); + var lang_1 = require("angular2/src/facade/lang"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); + var util_1 = require("angular2/src/compiler/util"); + var di_1 = require("angular2/src/core/di"); + var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; + var UTIL = "ChangeDetectionUtil"; + var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; + var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); + var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); + var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); + var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); + var ChangeDetectionCompiler = (function() { + function ChangeDetectionCompiler(_genConfig) { + this._genConfig = _genConfig; + } + ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { + var _this = this; + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + return changeDetectorDefinitions.map(function(definition) { + return _this._createChangeDetectorFactory(definition); + }); + }; + ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { + if (lang_1.IS_DART || !this._genConfig.useJit) { + var proto = new change_detection_1.DynamicProtoChangeDetector(definition); + return function(dispatcher) { + return proto.instantiate(dispatcher); + }; + } else { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR, CHANGE_DETECTOR_STATE).generate(); + } + }; + ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { + var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); + var factories = []; + var index = 0; + var sourceParts = changeDetectorDefinitions.map(function(definition) { + var codegen; + var sourcePart; + if (lang_1.IS_DART) { + codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); + var className = "_" + definition.id; + var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; + codegen.generate(typeRef, className, definition); + factories.push(className + ".newChangeDetector"); + sourcePart = codegen.toString(); + } else { + codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); + factories.push("function(dispatcher) { return new " + codegen.typeName + "(dispatcher); }"); + sourcePart = codegen.generateSource(); + } + index++; + return sourcePart; + }); + return new source_module_1.SourceExpressions(sourceParts, factories); + }; + ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); + return ChangeDetectionCompiler; + })(); + exports.ChangeDetectionCompiler = ChangeDetectionCompiler; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var collection_1 = require("angular2/src/facade/collection"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_ast_1 = require("angular2/src/compiler/template_ast"); + var selector_1 = require("angular2/src/compiler/selector"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var template_preparser_1 = require("angular2/src/compiler/template_preparser"); + var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); + var html_ast_1 = require("angular2/src/compiler/html_ast"); + var util_1 = require("angular2/src/compiler/util"); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = new RegExp('\\.'); + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + } + TemplateParser.prototype.parse = function(template, directives, sourceInfo) { + var parseVisitor = new TemplateParseVisitor(directives, this._exprParser, this._schemaRegistry); + var result = html_ast_1.htmlVisitAll(parseVisitor, this._htmlParser.parse(template, sourceInfo), EMPTY_COMPONENT); + if (parseVisitor.errors.length > 0) { + var errorString = parseVisitor.errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result; + }; + TemplateParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser])], TemplateParser); + return TemplateParser; + })(); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(directives, _exprParser, _schemaRegistry) { + var _this = this; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + } + TemplateParseVisitor.prototype._reportError = function(message) { + this.errors.push(message); + }; + TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceInfo) { + try { + return this._exprParser.parseInterpolation(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseAction = function(value, sourceInfo) { + try { + return this._exprParser.parseAction(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseBinding = function(value, sourceInfo) { + try { + return this._exprParser.parseBinding(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); + } + }; + TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceInfo) { + try { + return this._exprParser.parseTemplateBindings(value, sourceInfo); + } catch (e) { + this._reportError("" + e); + return []; + } + }; + TemplateParseVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + var expr = this._parseInterpolation(ast.value, ast.sourceInfo); + if (lang_1.isPresent(expr)) { + return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceInfo); + } else { + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + } + }; + TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + TemplateParseVisitor.prototype.visitElement = function(element, component) { + var _this = this; + var nodeName = element.name; + var preparsedElement = template_preparser_1.preparseElement(element); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { + return null; + } + if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { + return null; + } + var matchableAttrs = []; + var elementOrDirectiveProps = []; + var vars = []; + var events = []; + var templateElementOrDirectiveProps = []; + var templateVars = []; + var templateMatchableAttrs = []; + var hasInlineTemplates = false; + var attrs = []; + element.attrs.forEach(function(attr) { + matchableAttrs.push([attr.name, attr.value]); + var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); + var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); + if (!hasBinding && !hasTemplateBinding) { + attrs.push(_this.visitAttr(attr, null)); + } + if (hasTemplateBinding) { + hasInlineTemplates = true; + } + }); + var isTemplateElement = nodeName == TEMPLATE_ELEMENT; + var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); + var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceInfo); + var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); + var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); + var elementNgContentIndex = hasInlineTemplates ? null : component.findNgContentIndex(elementCssSelector); + var parsedElement; + if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { + parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, elementNgContentIndex, element.sourceInfo); + } else if (isTemplateElement) { + this._assertAllEventsPublishedByDirectives(directives, events, element.sourceInfo); + this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, elementNgContentIndex, element.sourceInfo); + } else { + this._assertOnlyOneComponent(directives, element.sourceInfo); + var elementExportAsVars = vars.filter(function(varAst) { + return varAst.value.length === 0; + }); + parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, elementNgContentIndex, element.sourceInfo); + } + if (hasInlineTemplates) { + var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); + var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceInfo); + var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); + this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceInfo); + parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], component.findNgContentIndex(templateCssSelector), element.sourceInfo); + } + return parsedElement; + }; + TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { + var templateBindingsSource = null; + if (attr.name == TEMPLATE_ATTR) { + templateBindingsSource = attr.value; + } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { + var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; + } + if (lang_1.isPresent(templateBindingsSource)) { + var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceInfo); + for (var i = 0; i < bindings.length; i++) { + var binding = bindings[i]; + var dashCaseKey = util_1.camelCaseToDashCase(binding.key); + if (binding.keyIsVar) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(binding.key), binding.name, attr.sourceInfo)); + targetMatchableAttrs.push([dashCaseKey, binding.name]); + } else if (lang_1.isPresent(binding.expression)) { + this._parsePropertyAst(dashCaseKey, binding.expression, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else { + targetMatchableAttrs.push([dashCaseKey, '']); + this._parseLiteralAttr(dashCaseKey, null, attr.sourceInfo, targetProps); + } + } + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { + var attrName = this._normalizeAttributeName(attr.name); + var attrValue = attr.value; + var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); + var hasBinding = false; + if (lang_1.isPresent(bindParts)) { + hasBinding = true; + if (lang_1.isPresent(bindParts[1])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[2])) { + var identifier = bindParts[5]; + this._parseVariable(identifier, attrValue, attr.sourceInfo, targetVars); + } else if (lang_1.isPresent(bindParts[3])) { + this._parseEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[4])) { + this._parseProperty(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[6])) { + this._parseProperty(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } else if (lang_1.isPresent(bindParts[7])) { + this._parseProperty(bindParts[7], attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } else if (lang_1.isPresent(bindParts[8])) { + this._parseEvent(bindParts[8], attrValue, attr.sourceInfo, targetMatchableAttrs, targetEvents); + } + } else { + hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceInfo, targetMatchableAttrs, targetProps); + } + if (!hasBinding) { + this._parseLiteralAttr(attrName, attrValue, attr.sourceInfo, targetProps); + } + return hasBinding; + }; + TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { + return attrName.startsWith('data-') ? attrName.substring(5) : attrName; + }; + TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceInfo, targetVars) { + targetVars.push(new template_ast_1.VariableAst(util_1.dashCaseToCamelCase(identifier), value, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceInfo, targetMatchableAttrs, targetProps) { + this._parsePropertyAst(name, this._parseBinding(expression, sourceInfo), sourceInfo, targetMatchableAttrs, targetProps); + }; + TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceInfo, targetMatchableAttrs, targetProps) { + var expr = this._parseInterpolation(value, sourceInfo); + if (lang_1.isPresent(expr)) { + this._parsePropertyAst(name, expr, sourceInfo, targetMatchableAttrs, targetProps); + return true; + } + return false; + }; + TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceInfo, targetMatchableAttrs, targetProps) { + targetMatchableAttrs.push([name, ast.source]); + targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + this._parseEvent(name + "-change", expression + "=$event", sourceInfo, targetMatchableAttrs, targetEvents); + }; + TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceInfo, targetMatchableAttrs, targetEvents) { + var parts = util_1.splitAtColon(name, [null, name]); + var target = parts[0]; + var eventName = parts[1]; + targetEvents.push(new template_ast_1.BoundEventAst(util_1.dashCaseToCamelCase(eventName), target, this._parseAction(expression, sourceInfo), sourceInfo)); + }; + TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceInfo, targetProps) { + targetProps.push(new BoundElementOrDirectiveProperty(util_1.dashCaseToCamelCase(name), this._exprParser.wrapLiteralPrimitive(value, sourceInfo), true, sourceInfo)); + }; + TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { + var _this = this; + var directives = []; + selectorMatcher.match(elementCssSelector, function(selector, directive) { + directives.push(directive); + }); + collection_1.ListWrapper.sort(directives, function(dir1, dir2) { + var dir1Comp = dir1.isComponent; + var dir2Comp = dir2.isComponent; + if (dir1Comp && !dir2Comp) { + return -1; + } else if (!dir1Comp && dir2Comp) { + return 1; + } else { + return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); + } + }); + return directives; + }; + TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceInfo) { + var _this = this; + var matchedVariables = new Set(); + var directiveAsts = directives.map(function(directive) { + var hostProperties = []; + var hostEvents = []; + var directiveProperties = []; + _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceInfo, hostProperties); + _this._createDirectiveHostEventAsts(directive.hostListeners, sourceInfo, hostEvents); + _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); + var exportAsVars = []; + possibleExportAsVars.forEach(function(varAst) { + if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { + exportAsVars.push(varAst); + matchedVariables.add(varAst.name); + } + }); + return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceInfo); + }); + possibleExportAsVars.forEach(function(varAst) { + if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { + _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\" at " + varAst.sourceInfo); + } + }); + return directiveAsts; + }; + TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceInfo, targetPropertyAsts) { + var _this = this; + if (lang_1.isPresent(hostProps)) { + collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { + var exprAst = _this._parseBinding(expression, sourceInfo); + targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceInfo)); + }); + } + }; + TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceInfo, targetEventAsts) { + var _this = this; + if (lang_1.isPresent(hostListeners)) { + collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { + _this._parseEvent(propName, expression, sourceInfo, [], targetEventAsts); + }); + } + }; + TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { + if (lang_1.isPresent(directiveProperties)) { + var boundPropsByName = new Map(); + boundProps.forEach(function(boundProp) { + var key = util_1.dashCaseToCamelCase(boundProp.name); + var prevValue = boundPropsByName.get(boundProp.name); + if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { + boundPropsByName.set(key, boundProp); + } + }); + collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { + elProp = util_1.dashCaseToCamelCase(elProp); + var boundProp = boundPropsByName.get(elProp); + if (lang_1.isPresent(boundProp)) { + targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceInfo)); + } + }); + } + }; + TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { + var _this = this; + var boundElementProps = []; + var boundDirectivePropsIndex = new Map(); + directives.forEach(function(directive) { + directive.inputs.forEach(function(prop) { + boundDirectivePropsIndex.set(prop.templateName, prop); + }); + }); + props.forEach(function(prop) { + if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { + boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceInfo)); + } + }); + return boundElementProps; + }; + TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceInfo) { + var unit = null; + var bindingType; + var boundPropertyName; + var parts = lang_1.StringWrapper.split(name, PROPERTY_PARTS_SEPARATOR); + if (parts.length === 1) { + boundPropertyName = this._schemaRegistry.getMappedPropName(util_1.dashCaseToCamelCase(parts[0])); + bindingType = template_ast_1.PropertyBindingType.Property; + if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { + this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property in " + sourceInfo); + } + } else if (parts[0] == ATTRIBUTE_PREFIX) { + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Attribute; + } else if (parts[0] == CLASS_PREFIX) { + boundPropertyName = parts[1]; + bindingType = template_ast_1.PropertyBindingType.Class; + } else if (parts[0] == STYLE_PREFIX) { + unit = parts.length > 2 ? parts[2] : null; + boundPropertyName = util_1.dashCaseToCamelCase(parts[1]); + bindingType = template_ast_1.PropertyBindingType.Style; + } else { + this._reportError("Invalid property name " + name + " in " + sourceInfo); + bindingType = null; + } + return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceInfo); + }; + TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { + var componentTypeNames = []; + directives.forEach(function(directive) { + var typeName = directive.directive.type.name; + if (directive.directive.isComponent) { + componentTypeNames.push(typeName); + } + }); + return componentTypeNames; + }; + TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceInfo) { + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 1) { + this._reportError("More than one component: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + }; + TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceInfo) { + var _this = this; + var componentTypeNames = this._findComponentDirectiveNames(directives); + if (componentTypeNames.length > 0) { + this._reportError("Components on an embedded template: " + componentTypeNames.join(',') + " in " + sourceInfo); + } + elementProps.forEach(function(prop) { + _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template in " + prop.sourceInfo); + }); + }; + TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events, sourceInfo) { + var _this = this; + var allDirectiveEvents = new Set(); + directives.forEach(function(directive) { + collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { + allDirectiveEvents.add(eventName); + }); + }); + events.forEach(function(event) { + if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { + _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template in " + sourceInfo); + } + }); + }; + return TemplateParseVisitor; + })(); + var NonBindableVisitor = (function() { + function NonBindableVisitor() {} + NonBindableVisitor.prototype.visitElement = function(ast, component) { + var preparsedElement = template_preparser_1.preparseElement(ast); + if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { + return null; + } + var attrNameAndValues = ast.attrs.map(function(attrAst) { + return [attrAst.name, attrAst.value]; + }); + var selector = createElementCssSelector(ast.name, attrNameAndValues); + var ngContentIndex = component.findNgContentIndex(selector); + var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); + return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitAttr = function(ast, context) { + return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceInfo); + }; + NonBindableVisitor.prototype.visitText = function(ast, component) { + var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); + return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceInfo); + }; + return NonBindableVisitor; + })(); + var BoundElementOrDirectiveProperty = (function() { + function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceInfo) { + this.name = name; + this.expression = expression; + this.isLiteral = isLiteral; + this.sourceInfo = sourceInfo; + } + return BoundElementOrDirectiveProperty; + })(); + function splitClasses(classAttrValue) { + return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); + } + exports.splitClasses = splitClasses; + var Component = (function() { + function Component(ngContentIndexMatcher, wildcardNgContentIndex) { + this.ngContentIndexMatcher = ngContentIndexMatcher; + this.wildcardNgContentIndex = wildcardNgContentIndex; + } + Component.create = function(directives) { + if (directives.length === 0 || !directives[0].directive.isComponent) { + return EMPTY_COMPONENT; + } + var matcher = new selector_1.SelectorMatcher(); + var ngContentSelectors = directives[0].directive.template.ngContentSelectors; + var wildcardNgContentIndex = null; + for (var i = 0; i < ngContentSelectors.length; i++) { + var selector = ngContentSelectors[i]; + if (lang_1.StringWrapper.equals(selector, '*')) { + wildcardNgContentIndex = i; + } else { + matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); + } + } + return new Component(matcher, wildcardNgContentIndex); + }; + Component.prototype.findNgContentIndex = function(selector) { + var ngContentIndices = []; + this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { + ngContentIndices.push(ngContentIndex); + }); + collection_1.ListWrapper.sort(ngContentIndices); + if (lang_1.isPresent(this.wildcardNgContentIndex)) { + ngContentIndices.push(this.wildcardNgContentIndex); + } + return ngContentIndices.length > 0 ? ngContentIndices[0] : null; + }; + return Component; + })(); + function createElementCssSelector(elementName, matchableAttrs) { + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(elementName); + for (var i = 0; i < matchableAttrs.length; i++) { + var attrName = matchableAttrs[i][0].toLowerCase(); + var attrValue = matchableAttrs[i][1]; + cssSelector.addAttribute(attrName, attrValue); + if (attrName == CLASS_ATTR) { + var classes = splitClasses(attrValue); + classes.forEach(function(className) { + return cssSelector.addClassName(className); + }); + } + } + return cssSelector; + } + var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); + var NON_BINDABLE_VISITOR = new NonBindableVisitor(); + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tokenization/tokenizer", ["parse5/lib/tokenization/preprocessor", "parse5/lib/common/unicode", "parse5/lib/tokenization/named_entity_trie"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Preprocessor = require("parse5/lib/tokenization/preprocessor"), + UNICODE = require("parse5/lib/common/unicode"), + NAMED_ENTITY_TRIE = require("parse5/lib/tokenization/named_entity_trie"); + var $ = UNICODE.CODE_POINTS, + $$ = UNICODE.CODE_POINT_SEQUENCES; + var NUMERIC_ENTITY_REPLACEMENTS = { + 0x00: 0xFFFD, + 0x0D: 0x000D, + 0x80: 0x20AC, + 0x81: 0x0081, + 0x82: 0x201A, + 0x83: 0x0192, + 0x84: 0x201E, + 0x85: 0x2026, + 0x86: 0x2020, + 0x87: 0x2021, + 0x88: 0x02C6, + 0x89: 0x2030, + 0x8A: 0x0160, + 0x8B: 0x2039, + 0x8C: 0x0152, + 0x8D: 0x008D, + 0x8E: 0x017D, + 0x8F: 0x008F, + 0x90: 0x0090, + 0x91: 0x2018, + 0x92: 0x2019, + 0x93: 0x201C, + 0x94: 0x201D, + 0x95: 0x2022, + 0x96: 0x2013, + 0x97: 0x2014, + 0x98: 0x02DC, + 0x99: 0x2122, + 0x9A: 0x0161, + 0x9B: 0x203A, + 0x9C: 0x0153, + 0x9D: 0x009D, + 0x9E: 0x017E, + 0x9F: 0x0178 + }; + var DATA_STATE = 'DATA_STATE', + CHARACTER_REFERENCE_IN_DATA_STATE = 'CHARACTER_REFERENCE_IN_DATA_STATE', + RCDATA_STATE = 'RCDATA_STATE', + CHARACTER_REFERENCE_IN_RCDATA_STATE = 'CHARACTER_REFERENCE_IN_RCDATA_STATE', + RAWTEXT_STATE = 'RAWTEXT_STATE', + SCRIPT_DATA_STATE = 'SCRIPT_DATA_STATE', + PLAINTEXT_STATE = 'PLAINTEXT_STATE', + TAG_OPEN_STATE = 'TAG_OPEN_STATE', + END_TAG_OPEN_STATE = 'END_TAG_OPEN_STATE', + TAG_NAME_STATE = 'TAG_NAME_STATE', + RCDATA_LESS_THAN_SIGN_STATE = 'RCDATA_LESS_THAN_SIGN_STATE', + RCDATA_END_TAG_OPEN_STATE = 'RCDATA_END_TAG_OPEN_STATE', + RCDATA_END_TAG_NAME_STATE = 'RCDATA_END_TAG_NAME_STATE', + RAWTEXT_LESS_THAN_SIGN_STATE = 'RAWTEXT_LESS_THAN_SIGN_STATE', + RAWTEXT_END_TAG_OPEN_STATE = 'RAWTEXT_END_TAG_OPEN_STATE', + RAWTEXT_END_TAG_NAME_STATE = 'RAWTEXT_END_TAG_NAME_STATE', + SCRIPT_DATA_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_END_TAG_OPEN_STATE = 'SCRIPT_DATA_END_TAG_OPEN_STATE', + SCRIPT_DATA_END_TAG_NAME_STATE = 'SCRIPT_DATA_END_TAG_NAME_STATE', + SCRIPT_DATA_ESCAPE_START_STATE = 'SCRIPT_DATA_ESCAPE_START_STATE', + SCRIPT_DATA_ESCAPE_START_DASH_STATE = 'SCRIPT_DATA_ESCAPE_START_DASH_STATE', + SCRIPT_DATA_ESCAPED_STATE = 'SCRIPT_DATA_ESCAPED_STATE', + SCRIPT_DATA_ESCAPED_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_STATE', + SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_DASH_STATE', + SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE', + SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE', + SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE', + BEFORE_ATTRIBUTE_NAME_STATE = 'BEFORE_ATTRIBUTE_NAME_STATE', + ATTRIBUTE_NAME_STATE = 'ATTRIBUTE_NAME_STATE', + AFTER_ATTRIBUTE_NAME_STATE = 'AFTER_ATTRIBUTE_NAME_STATE', + BEFORE_ATTRIBUTE_VALUE_STATE = 'BEFORE_ATTRIBUTE_VALUE_STATE', + ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE', + ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE', + ATTRIBUTE_VALUE_UNQUOTED_STATE = 'ATTRIBUTE_VALUE_UNQUOTED_STATE', + CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE = 'CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE', + AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = 'AFTER_ATTRIBUTE_VALUE_QUOTED_STATE', + SELF_CLOSING_START_TAG_STATE = 'SELF_CLOSING_START_TAG_STATE', + BOGUS_COMMENT_STATE = 'BOGUS_COMMENT_STATE', + MARKUP_DECLARATION_OPEN_STATE = 'MARKUP_DECLARATION_OPEN_STATE', + COMMENT_START_STATE = 'COMMENT_START_STATE', + COMMENT_START_DASH_STATE = 'COMMENT_START_DASH_STATE', + COMMENT_STATE = 'COMMENT_STATE', + COMMENT_END_DASH_STATE = 'COMMENT_END_DASH_STATE', + COMMENT_END_STATE = 'COMMENT_END_STATE', + COMMENT_END_BANG_STATE = 'COMMENT_END_BANG_STATE', + DOCTYPE_STATE = 'DOCTYPE_STATE', + BEFORE_DOCTYPE_NAME_STATE = 'BEFORE_DOCTYPE_NAME_STATE', + DOCTYPE_NAME_STATE = 'DOCTYPE_NAME_STATE', + AFTER_DOCTYPE_NAME_STATE = 'AFTER_DOCTYPE_NAME_STATE', + AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE = 'AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE', + BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE', + DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE', + DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE', + AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE', + BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = 'BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE', + AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE = 'AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE', + BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE', + DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE', + DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE', + AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE', + BOGUS_DOCTYPE_STATE = 'BOGUS_DOCTYPE_STATE', + CDATA_SECTION_STATE = 'CDATA_SECTION_STATE'; + function isWhitespace(cp) { + return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED; + } + function isAsciiDigit(cp) { + return cp >= $.DIGIT_0 && cp <= $.DIGIT_9; + } + function isAsciiUpper(cp) { + return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z; + } + function isAsciiLower(cp) { + return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z; + } + function isAsciiAlphaNumeric(cp) { + return isAsciiDigit(cp) || isAsciiUpper(cp) || isAsciiLower(cp); + } + function isDigit(cp, isHex) { + return isAsciiDigit(cp) || (isHex && ((cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F) || (cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F))); + } + function isReservedCodePoint(cp) { + return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF; + } + function toAsciiLowerCodePoint(cp) { + return cp + 0x0020; + } + function toChar(cp) { + if (cp <= 0xFFFF) + return String.fromCharCode(cp); + cp -= 0x10000; + return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF); + } + function toAsciiLowerChar(cp) { + return String.fromCharCode(toAsciiLowerCodePoint(cp)); + } + var Tokenizer = module.exports = function(html) { + this.preprocessor = new Preprocessor(html); + this.tokenQueue = []; + this.allowCDATA = false; + this.state = DATA_STATE; + this.returnState = ''; + this.consumptionPos = 0; + this.tempBuff = []; + this.additionalAllowedCp = void 0; + this.lastStartTagName = ''; + this.currentCharacterToken = null; + this.currentToken = null; + this.currentAttr = null; + }; + Tokenizer.CHARACTER_TOKEN = 'CHARACTER_TOKEN'; + Tokenizer.NULL_CHARACTER_TOKEN = 'NULL_CHARACTER_TOKEN'; + Tokenizer.WHITESPACE_CHARACTER_TOKEN = 'WHITESPACE_CHARACTER_TOKEN'; + Tokenizer.START_TAG_TOKEN = 'START_TAG_TOKEN'; + Tokenizer.END_TAG_TOKEN = 'END_TAG_TOKEN'; + Tokenizer.COMMENT_TOKEN = 'COMMENT_TOKEN'; + Tokenizer.DOCTYPE_TOKEN = 'DOCTYPE_TOKEN'; + Tokenizer.EOF_TOKEN = 'EOF_TOKEN'; + Tokenizer.DATA_STATE = DATA_STATE; + Tokenizer.RCDATA_STATE = RCDATA_STATE; + Tokenizer.RAWTEXT_STATE = RAWTEXT_STATE; + Tokenizer.SCRIPT_DATA_STATE = SCRIPT_DATA_STATE; + Tokenizer.PLAINTEXT_STATE = PLAINTEXT_STATE; + Tokenizer.getTokenAttr = function(token, attrName) { + for (var i = token.attrs.length - 1; i >= 0; i--) { + if (token.attrs[i].name === attrName) + return token.attrs[i].value; + } + return null; + }; + Tokenizer.prototype.getNextToken = function() { + while (!this.tokenQueue.length) + this[this.state](this._consume()); + return this.tokenQueue.shift(); + }; + Tokenizer.prototype._consume = function() { + this.consumptionPos++; + return this.preprocessor.advanceAndPeekCodePoint(); + }; + Tokenizer.prototype._unconsume = function() { + this.consumptionPos--; + this.preprocessor.retreat(); + }; + Tokenizer.prototype._unconsumeSeveral = function(count) { + while (count--) + this._unconsume(); + }; + Tokenizer.prototype._reconsumeInState = function(state) { + this.state = state; + this._unconsume(); + }; + Tokenizer.prototype._consumeSubsequentIfMatch = function(pattern, startCp, caseSensitive) { + var rollbackPos = this.consumptionPos, + isMatch = true, + patternLength = pattern.length, + patternPos = 0, + cp = startCp, + patternCp = void 0; + for (; patternPos < patternLength; patternPos++) { + if (patternPos > 0) + cp = this._consume(); + if (cp === $.EOF) { + isMatch = false; + break; + } + patternCp = pattern[patternPos]; + if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { + isMatch = false; + break; + } + } + if (!isMatch) + this._unconsumeSeveral(this.consumptionPos - rollbackPos); + return isMatch; + }; + Tokenizer.prototype._lookahead = function() { + var cp = this.preprocessor.advanceAndPeekCodePoint(); + this.preprocessor.retreat(); + return cp; + }; + Tokenizer.prototype.isTempBufferEqualToScriptString = function() { + if (this.tempBuff.length !== $$.SCRIPT_STRING.length) + return false; + for (var i = 0; i < this.tempBuff.length; i++) { + if (this.tempBuff[i] !== $$.SCRIPT_STRING[i]) + return false; + } + return true; + }; + Tokenizer.prototype.buildStartTagToken = function(tagName) { + return { + type: Tokenizer.START_TAG_TOKEN, + tagName: tagName, + selfClosing: false, + attrs: [] + }; + }; + Tokenizer.prototype.buildEndTagToken = function(tagName) { + return { + type: Tokenizer.END_TAG_TOKEN, + tagName: tagName, + ignored: false, + attrs: [] + }; + }; + Tokenizer.prototype._createStartTagToken = function(tagNameFirstCh) { + this.currentToken = this.buildStartTagToken(tagNameFirstCh); + }; + Tokenizer.prototype._createEndTagToken = function(tagNameFirstCh) { + this.currentToken = this.buildEndTagToken(tagNameFirstCh); + }; + Tokenizer.prototype._createCommentToken = function() { + this.currentToken = { + type: Tokenizer.COMMENT_TOKEN, + data: '' + }; + }; + Tokenizer.prototype._createDoctypeToken = function(doctypeNameFirstCh) { + this.currentToken = { + type: Tokenizer.DOCTYPE_TOKEN, + name: doctypeNameFirstCh || '', + forceQuirks: false, + publicId: null, + systemId: null + }; + }; + Tokenizer.prototype._createAttr = function(attrNameFirstCh) { + this.currentAttr = { + name: attrNameFirstCh, + value: '' + }; + }; + Tokenizer.prototype._isDuplicateAttr = function() { + return Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) !== null; + }; + Tokenizer.prototype._leaveAttrName = function(toState) { + this.state = toState; + if (!this._isDuplicateAttr()) + this.currentToken.attrs.push(this.currentAttr); + }; + Tokenizer.prototype._isAppropriateEndTagToken = function() { + return this.lastStartTagName === this.currentToken.tagName; + }; + Tokenizer.prototype._emitCurrentToken = function() { + this._emitCurrentCharacterToken(); + if (this.currentToken.type === Tokenizer.START_TAG_TOKEN) + this.lastStartTagName = this.currentToken.tagName; + this.tokenQueue.push(this.currentToken); + this.currentToken = null; + }; + Tokenizer.prototype._emitCurrentCharacterToken = function() { + if (this.currentCharacterToken) { + this.tokenQueue.push(this.currentCharacterToken); + this.currentCharacterToken = null; + } + }; + Tokenizer.prototype._emitEOFToken = function() { + this._emitCurrentCharacterToken(); + this.tokenQueue.push({type: Tokenizer.EOF_TOKEN}); + }; + Tokenizer.prototype._appendCharToCurrentCharacterToken = function(type, ch) { + if (this.currentCharacterToken && this.currentCharacterToken.type !== type) + this._emitCurrentCharacterToken(); + if (this.currentCharacterToken) + this.currentCharacterToken.chars += ch; + else { + this.currentCharacterToken = { + type: type, + chars: ch + }; + } + }; + Tokenizer.prototype._emitCodePoint = function(cp) { + var type = Tokenizer.CHARACTER_TOKEN; + if (isWhitespace(cp)) + type = Tokenizer.WHITESPACE_CHARACTER_TOKEN; + else if (cp === $.NULL) + type = Tokenizer.NULL_CHARACTER_TOKEN; + this._appendCharToCurrentCharacterToken(type, toChar(cp)); + }; + Tokenizer.prototype._emitSeveralCodePoints = function(codePoints) { + for (var i = 0; i < codePoints.length; i++) + this._emitCodePoint(codePoints[i]); + }; + Tokenizer.prototype._emitChar = function(ch) { + this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch); + }; + Tokenizer.prototype._consumeNumericEntity = function(isHex) { + var digits = '', + nextCp = void 0; + do { + digits += toChar(this._consume()); + nextCp = this._lookahead(); + } while (nextCp !== $.EOF && isDigit(nextCp, isHex)); + if (this._lookahead() === $.SEMICOLON) + this._consume(); + var referencedCp = parseInt(digits, isHex ? 16 : 10), + replacement = NUMERIC_ENTITY_REPLACEMENTS[referencedCp]; + if (replacement) + return replacement; + if (isReservedCodePoint(referencedCp)) + return $.REPLACEMENT_CHARACTER; + return referencedCp; + }; + Tokenizer.prototype._consumeNamedEntity = function(startCp, inAttr) { + var referencedCodePoints = null, + entityCodePointsCount = 0, + cp = startCp, + leaf = NAMED_ENTITY_TRIE[cp], + consumedCount = 1, + semicolonTerminated = false; + for (; leaf && cp !== $.EOF; cp = this._consume(), consumedCount++, leaf = leaf.l && leaf.l[cp]) { + if (leaf.c) { + referencedCodePoints = leaf.c; + entityCodePointsCount = consumedCount; + if (cp === $.SEMICOLON) { + semicolonTerminated = true; + break; + } + } + } + if (referencedCodePoints) { + if (!semicolonTerminated) { + this._unconsumeSeveral(consumedCount - entityCodePointsCount); + if (inAttr) { + var nextCp = this._lookahead(); + if (nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp)) { + this._unconsumeSeveral(entityCodePointsCount); + return null; + } + } + } + return referencedCodePoints; + } + this._unconsumeSeveral(consumedCount); + return null; + }; + Tokenizer.prototype._consumeCharacterReference = function(startCp, inAttr) { + if (isWhitespace(startCp) || startCp === $.GREATER_THAN_SIGN || startCp === $.AMPERSAND || startCp === this.additionalAllowedCp || startCp === $.EOF) { + this._unconsume(); + return null; + } else if (startCp === $.NUMBER_SIGN) { + var isHex = false, + nextCp = this._lookahead(); + if (nextCp === $.LATIN_SMALL_X || nextCp === $.LATIN_CAPITAL_X) { + this._consume(); + isHex = true; + } + nextCp = this._lookahead(); + if (nextCp !== $.EOF && isDigit(nextCp, isHex)) + return [this._consumeNumericEntity(isHex)]; + else { + this._unconsumeSeveral(isHex ? 2 : 1); + return null; + } + } else + return this._consumeNamedEntity(startCp, inAttr); + }; + var _ = Tokenizer.prototype; + _[DATA_STATE] = function dataState(cp) { + if (cp === $.AMPERSAND) + this.state = CHARACTER_REFERENCE_IN_DATA_STATE; + else if (cp === $.LESS_THAN_SIGN) + this.state = TAG_OPEN_STATE; + else if (cp === $.NULL) + this._emitCodePoint(cp); + else if (cp === $.EOF) + this._emitEOFToken(); + else + this._emitCodePoint(cp); + }; + _[CHARACTER_REFERENCE_IN_DATA_STATE] = function characterReferenceInDataState(cp) { + this.state = DATA_STATE; + this.additionalAllowedCp = void 0; + var referencedCodePoints = this._consumeCharacterReference(cp, false); + if (referencedCodePoints) + this._emitSeveralCodePoints(referencedCodePoints); + else + this._emitChar('&'); + }; + _[RCDATA_STATE] = function rcdataState(cp) { + if (cp === $.AMPERSAND) + this.state = CHARACTER_REFERENCE_IN_RCDATA_STATE; + else if (cp === $.LESS_THAN_SIGN) + this.state = RCDATA_LESS_THAN_SIGN_STATE; + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._emitEOFToken(); + else + this._emitCodePoint(cp); + }; + _[CHARACTER_REFERENCE_IN_RCDATA_STATE] = function characterReferenceInRcdataState(cp) { + this.state = RCDATA_STATE; + this.additionalAllowedCp = void 0; + var referencedCodePoints = this._consumeCharacterReference(cp, false); + if (referencedCodePoints) + this._emitSeveralCodePoints(referencedCodePoints); + else + this._emitChar('&'); + }; + _[RAWTEXT_STATE] = function rawtextState(cp) { + if (cp === $.LESS_THAN_SIGN) + this.state = RAWTEXT_LESS_THAN_SIGN_STATE; + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._emitEOFToken(); + else + this._emitCodePoint(cp); + }; + _[SCRIPT_DATA_STATE] = function scriptDataState(cp) { + if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE; + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._emitEOFToken(); + else + this._emitCodePoint(cp); + }; + _[PLAINTEXT_STATE] = function plaintextState(cp) { + if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._emitEOFToken(); + else + this._emitCodePoint(cp); + }; + _[TAG_OPEN_STATE] = function tagOpenState(cp) { + if (cp === $.EXCLAMATION_MARK) + this.state = MARKUP_DECLARATION_OPEN_STATE; + else if (cp === $.SOLIDUS) + this.state = END_TAG_OPEN_STATE; + else if (isAsciiUpper(cp)) { + this._createStartTagToken(toAsciiLowerChar(cp)); + this.state = TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createStartTagToken(toChar(cp)); + this.state = TAG_NAME_STATE; + } else if (cp === $.QUESTION_MARK) { + this[BOGUS_COMMENT_STATE](cp); + } else { + this._emitChar('<'); + this._reconsumeInState(DATA_STATE); + } + }; + _[END_TAG_OPEN_STATE] = function endTagOpenState(cp) { + if (isAsciiUpper(cp)) { + this._createEndTagToken(toAsciiLowerChar(cp)); + this.state = TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createEndTagToken(toChar(cp)); + this.state = TAG_NAME_STATE; + } else if (cp === $.GREATER_THAN_SIGN) + this.state = DATA_STATE; + else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + this._emitChar('<'); + this._emitChar('/'); + } else { + this[BOGUS_COMMENT_STATE](cp); + } + }; + _[TAG_NAME_STATE] = function tagNameState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + else if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (isAsciiUpper(cp)) + this.currentToken.tagName += toAsciiLowerChar(cp); + else if (cp === $.NULL) + this.currentToken.tagName += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this.currentToken.tagName += toChar(cp); + }; + _[RCDATA_LESS_THAN_SIGN_STATE] = function rcdataLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = RCDATA_END_TAG_OPEN_STATE; + } else { + this._emitChar('<'); + this._reconsumeInState(RCDATA_STATE); + } + }; + _[RCDATA_END_TAG_OPEN_STATE] = function rcdataEndTagOpenState(cp) { + if (isAsciiUpper(cp)) { + this._createEndTagToken(toAsciiLowerChar(cp)); + this.tempBuff.push(cp); + this.state = RCDATA_END_TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createEndTagToken(toChar(cp)); + this.tempBuff.push(cp); + this.state = RCDATA_END_TAG_NAME_STATE; + } else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(RCDATA_STATE); + } + }; + _[RCDATA_END_TAG_NAME_STATE] = function rcdataEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return ; + } + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return ; + } + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + return ; + } + } + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(RCDATA_STATE); + } + }; + _[RAWTEXT_LESS_THAN_SIGN_STATE] = function rawtextLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = RAWTEXT_END_TAG_OPEN_STATE; + } else { + this._emitChar('<'); + this._reconsumeInState(RAWTEXT_STATE); + } + }; + _[RAWTEXT_END_TAG_OPEN_STATE] = function rawtextEndTagOpenState(cp) { + if (isAsciiUpper(cp)) { + this._createEndTagToken(toAsciiLowerChar(cp)); + this.tempBuff.push(cp); + this.state = RAWTEXT_END_TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createEndTagToken(toChar(cp)); + this.tempBuff.push(cp); + this.state = RAWTEXT_END_TAG_NAME_STATE; + } else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(RAWTEXT_STATE); + } + }; + _[RAWTEXT_END_TAG_NAME_STATE] = function rawtextEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return ; + } + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return ; + } + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return ; + } + } + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(RAWTEXT_STATE); + } + }; + _[SCRIPT_DATA_LESS_THAN_SIGN_STATE] = function scriptDataLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_END_TAG_OPEN_STATE; + } else if (cp === $.EXCLAMATION_MARK) { + this.state = SCRIPT_DATA_ESCAPE_START_STATE; + this._emitChar('<'); + this._emitChar('!'); + } else { + this._emitChar('<'); + this._reconsumeInState(SCRIPT_DATA_STATE); + } + }; + _[SCRIPT_DATA_END_TAG_OPEN_STATE] = function scriptDataEndTagOpenState(cp) { + if (isAsciiUpper(cp)) { + this._createEndTagToken(toAsciiLowerChar(cp)); + this.tempBuff.push(cp); + this.state = SCRIPT_DATA_END_TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createEndTagToken(toChar(cp)); + this.tempBuff.push(cp); + this.state = SCRIPT_DATA_END_TAG_NAME_STATE; + } else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(SCRIPT_DATA_STATE); + } + }; + _[SCRIPT_DATA_END_TAG_NAME_STATE] = function scriptDataEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return ; + } else if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return ; + } else if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return ; + } + } + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(SCRIPT_DATA_STATE); + } + }; + _[SCRIPT_DATA_ESCAPE_START_STATE] = function scriptDataEscapeStartState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE; + this._emitChar('-'); + } else + this._reconsumeInState(SCRIPT_DATA_STATE); + }; + _[SCRIPT_DATA_ESCAPE_START_DASH_STATE] = function scriptDataEscapeStartDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } else + this._reconsumeInState(SCRIPT_DATA_STATE); + }; + _[SCRIPT_DATA_ESCAPED_STATE] = function scriptDataEscapedState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_STATE; + this._emitChar('-'); + } else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this._emitCodePoint(cp); + }; + _[SCRIPT_DATA_ESCAPED_DASH_STATE] = function scriptDataEscapedDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + else if (cp === $.NULL) { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } + }; + _[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE] = function scriptDataEscapedDashDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this._emitChar('-'); + else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.state = SCRIPT_DATA_STATE; + this._emitChar('>'); + } else if (cp === $.NULL) { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } + }; + _[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataEscapedLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE; + } else if (isAsciiUpper(cp)) { + this.tempBuff = []; + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this.state = SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE; + this._emitChar('<'); + this._emitCodePoint(cp); + } else if (isAsciiLower(cp)) { + this.tempBuff = []; + this.tempBuff.push(cp); + this.state = SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE; + this._emitChar('<'); + this._emitCodePoint(cp); + } else { + this._emitChar('<'); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } + }; + _[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE] = function scriptDataEscapedEndTagOpenState(cp) { + if (isAsciiUpper(cp)) { + this._createEndTagToken(toAsciiLowerChar(cp)); + this.tempBuff.push(cp); + this.state = SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE; + } else if (isAsciiLower(cp)) { + this._createEndTagToken(toChar(cp)); + this.tempBuff.push(cp); + this.state = SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE; + } else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } + }; + _[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE] = function scriptDataEscapedEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return ; + } + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return ; + } + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return ; + } + } + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } + }; + _[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE] = function scriptDataDoubleEscapeStartState(cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { + this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE : SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } else if (isAsciiUpper(cp)) { + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this._emitCodePoint(cp); + } else if (isAsciiLower(cp)) { + this.tempBuff.push(cp); + this._emitCodePoint(cp); + } else + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + }; + _[SCRIPT_DATA_DOUBLE_ESCAPED_STATE] = function scriptDataDoubleEscapedState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE; + this._emitChar('-'); + } else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this._emitCodePoint(cp); + }; + _[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE] = function scriptDataDoubleEscapedDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } else if (cp === $.NULL) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } + }; + _[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE] = function scriptDataDoubleEscapedDashDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this._emitChar('-'); + else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = SCRIPT_DATA_STATE; + this._emitChar('>'); + } else if (cp === $.NULL) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } + }; + _[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataDoubleEscapedLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE; + this._emitChar('/'); + } else + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); + }; + _[SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE] = function scriptDataDoubleEscapeEndState(cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { + this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } else if (isAsciiUpper(cp)) { + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this._emitCodePoint(cp); + } else if (isAsciiLower(cp)) { + this.tempBuff.push(cp); + this._emitCodePoint(cp); + } else + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); + }; + _[BEFORE_ATTRIBUTE_NAME_STATE] = function beforeAttributeNameState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (isAsciiUpper(cp)) { + this._createAttr(toAsciiLowerChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.NULL) { + this._createAttr(UNICODE.REPLACEMENT_CHARACTER); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN || cp === $.EQUALS_SIGN) { + this._createAttr(toChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this._createAttr(toChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } + }; + _[ATTRIBUTE_NAME_STATE] = function attributeNameState(cp) { + if (isWhitespace(cp)) + this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE); + else if (cp === $.SOLIDUS) + this._leaveAttrName(SELF_CLOSING_START_TAG_STATE); + else if (cp === $.EQUALS_SIGN) + this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE); + else if (cp === $.GREATER_THAN_SIGN) { + this._leaveAttrName(DATA_STATE); + this._emitCurrentToken(); + } else if (isAsciiUpper(cp)) + this.currentAttr.name += toAsciiLowerChar(cp); + else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN) + this.currentAttr.name += toChar(cp); + else if (cp === $.NULL) + this.currentAttr.name += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this.currentAttr.name += toChar(cp); + }; + _[AFTER_ATTRIBUTE_NAME_STATE] = function afterAttributeNameState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + else if (cp === $.EQUALS_SIGN) + this.state = BEFORE_ATTRIBUTE_VALUE_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (isAsciiUpper(cp)) { + this._createAttr(toAsciiLowerChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.NULL) { + this._createAttr(UNICODE.REPLACEMENT_CHARACTER); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN) { + this._createAttr(toChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this._createAttr(toChar(cp)); + this.state = ATTRIBUTE_NAME_STATE; + } + }; + _[BEFORE_ATTRIBUTE_VALUE_STATE] = function beforeAttributeValueState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.QUOTATION_MARK) + this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE; + else if (cp === $.AMPERSAND) + this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE); + else if (cp === $.APOSTROPHE) + this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE; + else if (cp === $.NULL) { + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + this.state = ATTRIBUTE_VALUE_UNQUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.LESS_THAN_SIGN || cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT) { + this.currentAttr.value += toChar(cp); + this.state = ATTRIBUTE_VALUE_UNQUOTED_STATE; + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else { + this.currentAttr.value += toChar(cp); + this.state = ATTRIBUTE_VALUE_UNQUOTED_STATE; + } + }; + _[ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE] = function attributeValueDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.QUOTATION_MARK; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this.currentAttr.value += toChar(cp); + }; + _[ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE] = function attributeValueSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.APOSTROPHE; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this.currentAttr.value += toChar(cp); + }; + _[ATTRIBUTE_VALUE_UNQUOTED_STATE] = function attributeValueUnquotedState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.GREATER_THAN_SIGN; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN || cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT) { + this.currentAttr.value += toChar(cp); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this.currentAttr.value += toChar(cp); + }; + _[CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE] = function characterReferenceInAttributeValueState(cp) { + var referencedCodePoints = this._consumeCharacterReference(cp, true); + if (referencedCodePoints) { + for (var i = 0; i < referencedCodePoints.length; i++) + this.currentAttr.value += toChar(referencedCodePoints[i]); + } else + this.currentAttr.value += '&'; + this.state = this.returnState; + }; + _[AFTER_ATTRIBUTE_VALUE_QUOTED_STATE] = function afterAttributeValueQuotedState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + else if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); + }; + _[SELF_CLOSING_START_TAG_STATE] = function selfClosingStartTagState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.selfClosing = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + else + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); + }; + _[BOGUS_COMMENT_STATE] = function bogusCommentState(cp) { + this._createCommentToken(); + while (true) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + break; + } else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + break; + } else { + this.currentToken.data += cp === $.NULL ? UNICODE.REPLACEMENT_CHARACTER : toChar(cp); + cp = this._consume(); + } + } + this._emitCurrentToken(); + }; + _[MARKUP_DECLARATION_OPEN_STATE] = function markupDeclarationOpenState(cp) { + if (this._consumeSubsequentIfMatch($$.DASH_DASH_STRING, cp, true)) { + this._createCommentToken(); + this.state = COMMENT_START_STATE; + } else if (this._consumeSubsequentIfMatch($$.DOCTYPE_STRING, cp, false)) + this.state = DOCTYPE_STATE; + else if (this.allowCDATA && this._consumeSubsequentIfMatch($$.CDATA_START_STRING, cp, true)) + this.state = CDATA_SECTION_STATE; + else { + this[BOGUS_COMMENT_STATE](cp); + } + }; + _[COMMENT_START_STATE] = function commentStartState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_START_DASH_STATE; + else if (cp === $.NULL) { + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } + }; + _[COMMENT_START_DASH_STATE] = function commentStartDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_STATE; + else if (cp === $.NULL) { + this.currentToken.data += '-'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.data += '-'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } + }; + _[COMMENT_STATE] = function commentState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_DASH_STATE; + else if (cp === $.NULL) + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.data += toChar(cp); + }; + _[COMMENT_END_DASH_STATE] = function commentEndDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_STATE; + else if (cp === $.NULL) { + this.currentToken.data += '-'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.data += '-'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } + }; + _[COMMENT_END_STATE] = function commentEndState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EXCLAMATION_MARK) + this.state = COMMENT_END_BANG_STATE; + else if (cp === $.HYPHEN_MINUS) + this.currentToken.data += '-'; + else if (cp === $.NULL) { + this.currentToken.data += '--'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + this._emitCurrentToken(); + } else { + this.currentToken.data += '--'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } + }; + _[COMMENT_END_BANG_STATE] = function commentEndBangState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.currentToken.data += '--!'; + this.state = COMMENT_END_DASH_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.NULL) { + this.currentToken.data += '--!'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.data += '--!'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } + }; + _[DOCTYPE_STATE] = function doctypeState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_DOCTYPE_NAME_STATE; + else if (cp === $.EOF) { + this._createDoctypeToken(); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this._reconsumeInState(BEFORE_DOCTYPE_NAME_STATE); + }; + _[BEFORE_DOCTYPE_NAME_STATE] = function beforeDoctypeNameState(cp) { + if (isWhitespace(cp)) + return ; + if (isAsciiUpper(cp)) { + this._createDoctypeToken(toAsciiLowerChar(cp)); + this.state = DOCTYPE_NAME_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._createDoctypeToken(); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._createDoctypeToken(); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else if (cp === $.NULL) { + this._createDoctypeToken(UNICODE.REPLACEMENT_CHARACTER); + this.state = DOCTYPE_NAME_STATE; + } else { + this._createDoctypeToken(toChar(cp)); + this.state = DOCTYPE_NAME_STATE; + } + }; + _[DOCTYPE_NAME_STATE] = function doctypeNameState(cp) { + if (isWhitespace(cp)) + this.state = AFTER_DOCTYPE_NAME_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (isAsciiUpper(cp)) + this.currentToken.name += toAsciiLowerChar(cp); + else if (cp === $.NULL) + this.currentToken.name += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.name += toChar(cp); + }; + _[AFTER_DOCTYPE_NAME_STATE] = function afterDoctypeNameState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else if (this._consumeSubsequentIfMatch($$.PUBLIC_STRING, cp, false)) + this.state = AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE; + else if (this._consumeSubsequentIfMatch($$.SYSTEM_STRING, cp, false)) + this.state = AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE; + else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE] = function afterDoctypePublicKeywordState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + else if (cp === $.QUOTATION_MARK) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE] = function beforeDoctypePublicIdentifierState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.QUOTATION_MARK) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypePublicIdentifierDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + else if (cp === $.NULL) + this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.publicId += toChar(cp); + }; + _[DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypePublicIdentifierSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + else if (cp === $.NULL) + this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.publicId += toChar(cp); + }; + _[AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE] = function afterDoctypePublicIdentifierState(cp) { + if (isWhitespace(cp)) + this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE] = function betweenDoctypePublicAndSystemIdentifiersState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE] = function afterDoctypeSystemKeywordState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + else if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function beforeDoctypeSystemIdentifierState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + }; + _[DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypeSystemIdentifierDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.NULL) + this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.systemId += toChar(cp); + }; + _[DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypeSystemIdentifierSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.NULL) + this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.currentToken.systemId += toChar(cp); + }; + _[AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function afterDoctypeSystemIdentifierState(cp) { + if (isWhitespace(cp)) + return ; + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } else + this.state = BOGUS_DOCTYPE_STATE; + }; + _[BOGUS_DOCTYPE_STATE] = function bogusDoctypeState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + }; + _[CDATA_SECTION_STATE] = function cdataSectionState(cp) { + while (true) { + if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + break; + } else if (this._consumeSubsequentIfMatch($$.CDATA_END_STRING, cp, true)) { + this.state = DATA_STATE; + break; + } else { + this._emitCodePoint(cp); + cp = this._consume(); + } + } + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var collection_1 = require("angular2/src/facade/collection"); + var provider_1 = require("angular2/src/core/di/provider"); + var exceptions_1 = require("angular2/src/core/di/exceptions"); + var lang_1 = require("angular2/src/facade/lang"); + var key_1 = require("angular2/src/core/di/key"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var _MAX_CONSTRUCTION_COUNTER = 10; + exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); + (function(Visibility) { + Visibility[Visibility["Public"] = 0] = "Public"; + Visibility[Visibility["Private"] = 1] = "Private"; + Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; + })(exports.Visibility || (exports.Visibility = {})); + var Visibility = exports.Visibility; + function canSee(src, dst) { + return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); + } + var ProtoInjectorInlineStrategy = (function() { + function ProtoInjectorInlineStrategy(protoEI, bwv) { + this.provider0 = null; + this.provider1 = null; + this.provider2 = null; + this.provider3 = null; + this.provider4 = null; + this.provider5 = null; + this.provider6 = null; + this.provider7 = null; + this.provider8 = null; + this.provider9 = null; + this.keyId0 = null; + this.keyId1 = null; + this.keyId2 = null; + this.keyId3 = null; + this.keyId4 = null; + this.keyId5 = null; + this.keyId6 = null; + this.keyId7 = null; + this.keyId8 = null; + this.keyId9 = null; + this.visibility0 = null; + this.visibility1 = null; + this.visibility2 = null; + this.visibility3 = null; + this.visibility4 = null; + this.visibility5 = null; + this.visibility6 = null; + this.visibility7 = null; + this.visibility8 = null; + this.visibility9 = null; + var length = bwv.length; + if (length > 0) { + this.provider0 = bwv[0].provider; + this.keyId0 = bwv[0].getKeyId(); + this.visibility0 = bwv[0].visibility; + } + if (length > 1) { + this.provider1 = bwv[1].provider; + this.keyId1 = bwv[1].getKeyId(); + this.visibility1 = bwv[1].visibility; + } + if (length > 2) { + this.provider2 = bwv[2].provider; + this.keyId2 = bwv[2].getKeyId(); + this.visibility2 = bwv[2].visibility; + } + if (length > 3) { + this.provider3 = bwv[3].provider; + this.keyId3 = bwv[3].getKeyId(); + this.visibility3 = bwv[3].visibility; + } + if (length > 4) { + this.provider4 = bwv[4].provider; + this.keyId4 = bwv[4].getKeyId(); + this.visibility4 = bwv[4].visibility; + } + if (length > 5) { + this.provider5 = bwv[5].provider; + this.keyId5 = bwv[5].getKeyId(); + this.visibility5 = bwv[5].visibility; + } + if (length > 6) { + this.provider6 = bwv[6].provider; + this.keyId6 = bwv[6].getKeyId(); + this.visibility6 = bwv[6].visibility; + } + if (length > 7) { + this.provider7 = bwv[7].provider; + this.keyId7 = bwv[7].getKeyId(); + this.visibility7 = bwv[7].visibility; + } + if (length > 8) { + this.provider8 = bwv[8].provider; + this.keyId8 = bwv[8].getKeyId(); + this.visibility8 = bwv[8].visibility; + } + if (length > 9) { + this.provider9 = bwv[9].provider; + this.keyId9 = bwv[9].getKeyId(); + this.visibility9 = bwv[9].visibility; + } + } + ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { + if (index == 0) + return this.provider0; + if (index == 1) + return this.provider1; + if (index == 2) + return this.provider2; + if (index == 3) + return this.provider3; + if (index == 4) + return this.provider4; + if (index == 5) + return this.provider5; + if (index == 6) + return this.provider6; + if (index == 7) + return this.provider7; + if (index == 8) + return this.provider8; + if (index == 9) + return this.provider9; + throw new exceptions_1.OutOfBoundsError(index); + }; + ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { + return new InjectorInlineStrategy(injector, this); + }; + return ProtoInjectorInlineStrategy; + })(); + exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; + var ProtoInjectorDynamicStrategy = (function() { + function ProtoInjectorDynamicStrategy(protoInj, bwv) { + var len = bwv.length; + this.providers = collection_1.ListWrapper.createFixedSize(len); + this.keyIds = collection_1.ListWrapper.createFixedSize(len); + this.visibilities = collection_1.ListWrapper.createFixedSize(len); + for (var i = 0; i < len; i++) { + this.providers[i] = bwv[i].provider; + this.keyIds[i] = bwv[i].getKeyId(); + this.visibilities[i] = bwv[i].visibility; + } + } + ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { + if (index < 0 || index >= this.providers.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.providers[index]; + }; + ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { + return new InjectorDynamicStrategy(this, ei); + }; + return ProtoInjectorDynamicStrategy; + })(); + exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; + var ProtoInjector = (function() { + function ProtoInjector(bwv) { + this.numberOfProviders = bwv.length; + this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); + } + ProtoInjector.prototype.getProviderAtIndex = function(index) { + return this._strategy.getProviderAtIndex(index); + }; + return ProtoInjector; + })(); + exports.ProtoInjector = ProtoInjector; + var InjectorInlineStrategy = (function() { + function InjectorInlineStrategy(injector, protoStrategy) { + this.injector = injector; + this.protoStrategy = protoStrategy; + this.obj0 = exports.UNDEFINED; + this.obj1 = exports.UNDEFINED; + this.obj2 = exports.UNDEFINED; + this.obj3 = exports.UNDEFINED; + this.obj4 = exports.UNDEFINED; + this.obj5 = exports.UNDEFINED; + this.obj6 = exports.UNDEFINED; + this.obj7 = exports.UNDEFINED; + this.obj8 = exports.UNDEFINED; + this.obj9 = exports.UNDEFINED; + } + InjectorInlineStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorInlineStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + var inj = this.injector; + if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { + if (this.obj0 === exports.UNDEFINED) { + this.obj0 = inj._new(p.provider0, p.visibility0); + } + return this.obj0; + } + if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { + if (this.obj1 === exports.UNDEFINED) { + this.obj1 = inj._new(p.provider1, p.visibility1); + } + return this.obj1; + } + if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { + if (this.obj2 === exports.UNDEFINED) { + this.obj2 = inj._new(p.provider2, p.visibility2); + } + return this.obj2; + } + if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { + if (this.obj3 === exports.UNDEFINED) { + this.obj3 = inj._new(p.provider3, p.visibility3); + } + return this.obj3; + } + if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { + if (this.obj4 === exports.UNDEFINED) { + this.obj4 = inj._new(p.provider4, p.visibility4); + } + return this.obj4; + } + if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { + if (this.obj5 === exports.UNDEFINED) { + this.obj5 = inj._new(p.provider5, p.visibility5); + } + return this.obj5; + } + if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { + if (this.obj6 === exports.UNDEFINED) { + this.obj6 = inj._new(p.provider6, p.visibility6); + } + return this.obj6; + } + if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { + if (this.obj7 === exports.UNDEFINED) { + this.obj7 = inj._new(p.provider7, p.visibility7); + } + return this.obj7; + } + if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { + if (this.obj8 === exports.UNDEFINED) { + this.obj8 = inj._new(p.provider8, p.visibility8); + } + return this.obj8; + } + if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { + if (this.obj9 === exports.UNDEFINED) { + this.obj9 = inj._new(p.provider9, p.visibility9); + } + return this.obj9; + } + return exports.UNDEFINED; + }; + InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { + if (index == 0) + return this.obj0; + if (index == 1) + return this.obj1; + if (index == 2) + return this.obj2; + if (index == 3) + return this.obj3; + if (index == 4) + return this.obj4; + if (index == 5) + return this.obj5; + if (index == 6) + return this.obj6; + if (index == 7) + return this.obj7; + if (index == 8) + return this.obj8; + if (index == 9) + return this.obj9; + throw new exceptions_1.OutOfBoundsError(index); + }; + InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { + return _MAX_CONSTRUCTION_COUNTER; + }; + return InjectorInlineStrategy; + })(); + exports.InjectorInlineStrategy = InjectorInlineStrategy; + var InjectorDynamicStrategy = (function() { + function InjectorDynamicStrategy(protoStrategy, injector) { + this.protoStrategy = protoStrategy; + this.injector = injector; + this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); + collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); + } + InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { + this.injector._constructionCounter = 0; + }; + InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { + return this.injector._new(provider, visibility); + }; + InjectorDynamicStrategy.prototype.attach = function(parent, isHost) { + var inj = this.injector; + inj._parent = parent; + inj._isHost = isHost; + }; + InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { + var p = this.protoStrategy; + for (var i = 0; i < p.keyIds.length; i++) { + if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { + if (this.objs[i] === exports.UNDEFINED) { + this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); + } + return this.objs[i]; + } + } + return exports.UNDEFINED; + }; + InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { + if (index < 0 || index >= this.objs.length) { + throw new exceptions_1.OutOfBoundsError(index); + } + return this.objs[index]; + }; + InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { + return this.objs.length; + }; + return InjectorDynamicStrategy; + })(); + exports.InjectorDynamicStrategy = InjectorDynamicStrategy; + var ProviderWithVisibility = (function() { + function ProviderWithVisibility(provider, visibility) { + this.provider = provider; + this.visibility = visibility; + } + ; + ProviderWithVisibility.prototype.getKeyId = function() { + return this.provider.key.id; + }; + return ProviderWithVisibility; + })(); + exports.ProviderWithVisibility = ProviderWithVisibility; + var Injector = (function() { + function Injector(_proto, _parent, _depProvider, _debugContext) { + if (_parent === void 0) { + _parent = null; + } + if (_depProvider === void 0) { + _depProvider = null; + } + if (_debugContext === void 0) { + _debugContext = null; + } + this._depProvider = _depProvider; + this._debugContext = _debugContext; + this._isHost = false; + this._constructionCounter = 0; + this._proto = _proto; + this._parent = _parent; + this._strategy = _proto._strategy.createInjectorStrategy(this); + } + Injector.resolve = function(providers) { + return provider_1.resolveProviders(providers); + }; + Injector.resolveAndCreate = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return Injector.fromResolvedProviders(resolvedProviders); + }; + Injector.fromResolvedProviders = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + return new Injector(proto, null, null); + }; + Injector.fromResolvedBindings = function(providers) { + return Injector.fromResolvedProviders(providers); + }; + Injector.prototype.debugContext = function() { + return this._debugContext(); + }; + Injector.prototype.get = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); + }; + Injector.prototype.getOptional = function(token) { + return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); + }; + Injector.prototype.getAt = function(index) { + return this._strategy.getObjAtIndex(index); + }; + Object.defineProperty(Injector.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Injector.prototype, "internalStrategy", { + get: function() { + return this._strategy; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.resolveAndCreateChild = function(providers) { + var resolvedProviders = Injector.resolve(providers); + return this.createChildFromResolved(resolvedProviders); + }; + Injector.prototype.createChildFromResolved = function(providers) { + var bd = providers.map(function(b) { + return new ProviderWithVisibility(b, Visibility.Public); + }); + var proto = new ProtoInjector(bd); + var inj = new Injector(proto, null, null); + inj._parent = this; + return inj; + }; + Injector.prototype.resolveAndInstantiate = function(provider) { + return this.instantiateResolved(Injector.resolve([provider])[0]); + }; + Injector.prototype.instantiateResolved = function(provider) { + return this._instantiateProvider(provider, Visibility.PublicAndPrivate); + }; + Injector.prototype._new = function(provider, visibility) { + if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { + throw new exceptions_1.CyclicDependencyError(this, provider.key); + } + return this._instantiateProvider(provider, visibility); + }; + Injector.prototype._instantiateProvider = function(provider, visibility) { + if (provider.multiProvider) { + var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); + for (var i = 0; i < provider.resolvedFactories.length; ++i) { + res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); + } + return res; + } else { + return this._instantiate(provider, provider.resolvedFactories[0], visibility); + } + }; + Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { + var factory = resolvedFactory.factory; + var deps = resolvedFactory.dependencies; + var length = deps.length; + var d0, + d1, + d2, + d3, + d4, + d5, + d6, + d7, + d8, + d9, + d10, + d11, + d12, + d13, + d14, + d15, + d16, + d17, + d18, + d19; + try { + d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; + d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; + d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; + d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; + d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; + d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; + d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; + d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; + d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; + d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; + d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; + d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; + d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; + d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; + d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; + d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; + d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; + d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; + d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; + d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; + } catch (e) { + if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { + e.addKey(this, provider.key); + } + throw e; + } + var obj; + try { + switch (length) { + case 0: + obj = factory(); + break; + case 1: + obj = factory(d0); + break; + case 2: + obj = factory(d0, d1); + break; + case 3: + obj = factory(d0, d1, d2); + break; + case 4: + obj = factory(d0, d1, d2, d3); + break; + case 5: + obj = factory(d0, d1, d2, d3, d4); + break; + case 6: + obj = factory(d0, d1, d2, d3, d4, d5); + break; + case 7: + obj = factory(d0, d1, d2, d3, d4, d5, d6); + break; + case 8: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); + break; + case 9: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); + break; + case 10: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); + break; + case 11: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); + break; + case 12: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); + break; + case 13: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); + break; + case 14: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); + break; + case 15: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); + break; + case 16: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); + break; + case 17: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); + break; + case 18: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); + break; + case 19: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); + break; + case 20: + obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); + break; + } + } catch (e) { + throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); + } + return obj; + }; + Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { + var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; + if (special !== exports.UNDEFINED) { + return special; + } else { + return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); + } + }; + Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { + if (key === INJECTOR_KEY) { + return this; + } + if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { + return this._getByKeySelf(key, optional, providerVisibility); + } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { + return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); + } else { + return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); + } + }; + Injector.prototype._throwOrNull = function(key, optional) { + if (optional) { + return null; + } else { + throw new exceptions_1.NoProviderError(this, key); + } + }; + Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { + var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + if (inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + if (lang_1.isPresent(inj._parent) && inj._isHost) { + return this._getPrivateDependency(key, optional, inj); + } else { + inj = inj._parent; + } + } + return this._throwOrNull(key, optional); + }; + Injector.prototype._getPrivateDependency = function(key, optional, inj) { + var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); + return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); + }; + Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { + var inj = this; + if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + while (inj != null) { + var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); + if (obj !== exports.UNDEFINED) + return obj; + providerVisibility = inj._isHost ? Visibility.PublicAndPrivate : Visibility.Public; + inj = inj._parent; + } + return this._throwOrNull(key, optional); + }; + Object.defineProperty(Injector.prototype, "displayName", { + get: function() { + return "Injector(providers: [" + _mapProviders(this, function(b) { + return (" \"" + b.key.displayName + "\" "); + }).join(", ") + "])"; + }, + enumerable: true, + configurable: true + }); + Injector.prototype.toString = function() { + return this.displayName; + }; + return Injector; + })(); + exports.Injector = Injector; + var INJECTOR_KEY = key_1.Key.get(Injector); + function _mapProviders(injector, fn) { + var res = []; + for (var i = 0; i < injector._proto.numberOfProviders; ++i) { + res.push(fn(injector._proto.getProviderAtIndex(i))); + } + return res; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var constants_1 = require("angular2/src/core/change_detection/constants"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicChangeDetector = (function(_super) { + __extends(DynamicChangeDetector, _super); + function DynamicChangeDetector(id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { + _super.call(this, id, dispatcher, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); + this._records = _records; + this._eventBindings = _eventBindings; + this._directiveRecords = _directiveRecords; + this._genConfig = _genConfig; + this.directives = null; + var len = _records.length + 1; + this.values = collection_1.ListWrapper.createFixedSize(len); + this.localPipes = collection_1.ListWrapper.createFixedSize(len); + this.prevContexts = collection_1.ListWrapper.createFixedSize(len); + this.changes = collection_1.ListWrapper.createFixedSize(len); + this.dehydrateDirectives(false); + } + DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { + var _this = this; + var preventDefault = false; + this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { + var res = _this._processEventBinding(rec, locals); + if (res === false) { + preventDefault = true; + } + }); + return preventDefault; + }; + DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { + var values = collection_1.ListWrapper.createFixedSize(eb.records.length); + values[0] = this.values[0]; + for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { + var proto = eb.records[protoIdx]; + if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, values); + } else { + var res = this._calculateCurrValue(proto, values, locals); + if (proto.lastInBinding) { + this._markPathAsCheckOnce(proto); + return res; + } else { + this._writeSelf(proto, res, values); + } + } + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { + if (proto.mode === proto_record_1.RecordType.SkipRecords) { + return proto.fixedArgs[0] - protoIndex - 1; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { + var condition = this._readContext(proto, values); + return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; + } + if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { + var condition = this._readContext(proto, values); + return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; + } + throw new exceptions_1.BaseException("Cannot be reached"); + }; + DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { + if (!proto.bindingRecord.isDefaultChangeDetection()) { + var dir = proto.bindingRecord.directiveRecord; + this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); + } + }; + DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { + return this._eventBindings.filter(function(eb) { + return eb.eventName == eventName && eb.elIndex === elIndex; + }); + }; + DynamicChangeDetector.prototype.hydrateDirectives = function(directives) { + this.values[0] = this.context; + this.directives = directives; + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + for (var i = 0; i < this.directiveIndices.length; ++i) { + var index = this.directiveIndices[i]; + _super.prototype.observeDirective.call(this, directives.getDirectiveFor(index), i); + } + } + }; + DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { + if (destroyPipes) { + this._destroyPipes(); + } + this.values[0] = null; + this.directives = null; + collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); + collection_1.ListWrapper.fill(this.changes, false); + collection_1.ListWrapper.fill(this.localPipes, null); + collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); + }; + DynamicChangeDetector.prototype._destroyPipes = function() { + for (var i = 0; i < this.localPipes.length; ++i) { + if (lang_1.isPresent(this.localPipes[i])) { + change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); + } + } + }; + DynamicChangeDetector.prototype.checkNoChanges = function() { + this.runDetectChanges(true); + }; + DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { + var protos = this._records; + var changes = null; + var isChanged = false; + for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { + var proto = protos[protoIdx]; + var bindingRecord = proto.bindingRecord; + var directiveRecord = bindingRecord.directiveRecord; + if (this._firstInBinding(proto)) { + this.propertyBindingIndex = proto.propertyBindingIndex; + } + if (proto.isLifeCycleRecord()) { + if (proto.name === "DoCheck" && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).doCheck(); + } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(directiveRecord.directiveIndex).onInit(); + } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { + this._getDirectiveFor(directiveRecord.directiveIndex).onChanges(changes); + } + } else if (proto.isSkipRecord()) { + protoIdx += this._computeSkipLength(protoIdx, proto, this.values); + } else { + var change = this._check(proto, throwOnChange, this.values, this.locals); + if (lang_1.isPresent(change)) { + this._updateDirectiveOrElement(change, bindingRecord); + isChanged = true; + changes = this._addChange(bindingRecord, change, changes); + } + } + if (proto.lastInDirective) { + changes = null; + if (isChanged && !bindingRecord.isDefaultChangeDetection()) { + this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); + } + isChanged = false; + } + } + }; + DynamicChangeDetector.prototype._firstInBinding = function(r) { + var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); + return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; + }; + DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentInit(); + } + if (dir.callAfterContentChecked) { + this._getDirectiveFor(dir.directiveIndex).afterContentChecked(); + } + } + }; + DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { + var dirs = this._directiveRecords; + for (var i = dirs.length - 1; i >= 0; --i) { + var dir = dirs[i]; + if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewInit(); + } + if (dir.callAfterViewChecked) { + this._getDirectiveFor(dir.directiveIndex).afterViewChecked(); + } + } + }; + DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { + if (lang_1.isBlank(bindingRecord.directiveRecord)) { + _super.prototype.notifyDispatcher.call(this, change.currentValue); + } else { + var directiveIndex = bindingRecord.directiveRecord.directiveIndex; + bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); + } + if (this._genConfig.logBindingUpdate) { + _super.prototype.logBindingUpdate.call(this, change.currentValue); + } + }; + DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { + if (bindingRecord.callOnChanges()) { + return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); + } else { + return changes; + } + }; + DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { + return this.directives.getDirectiveFor(directiveIndex); + }; + DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { + return this.directives.getDetectorFor(directiveIndex); + }; + DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { + if (proto.isPipeRecord()) { + return this._pipeCheck(proto, throwOnChange, values); + } else { + return this._referenceCheck(proto, throwOnChange, values, locals); + } + }; + DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { + if (this._pureFuncAndArgsDidNotChange(proto)) { + this._setChanged(proto, false); + return null; + } + var currValue = this._calculateCurrValue(proto, values, locals); + if (this.strategy === constants_1.ChangeDetectionStrategy.OnPushObserve) { + _super.prototype.observeValue.call(this, currValue, proto.selfIndex); + } + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + }; + DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { + switch (proto.mode) { + case proto_record_1.RecordType.Self: + return this._readContext(proto, values); + case proto_record_1.RecordType.Const: + return proto.funcOrValue; + case proto_record_1.RecordType.PropertyRead: + var context = this._readContext(proto, values); + return proto.funcOrValue(context); + case proto_record_1.RecordType.SafeProperty: + var context = this._readContext(proto, values); + return lang_1.isBlank(context) ? null : proto.funcOrValue(context); + case proto_record_1.RecordType.PropertyWrite: + var context = this._readContext(proto, values); + var value = this._readArgs(proto, values)[0]; + proto.funcOrValue(context, value); + return value; + case proto_record_1.RecordType.KeyedWrite: + var context = this._readContext(proto, values); + var key = this._readArgs(proto, values)[0]; + var value = this._readArgs(proto, values)[1]; + context[key] = value; + return value; + case proto_record_1.RecordType.Local: + return locals.get(proto.name); + case proto_record_1.RecordType.InvokeMethod: + var context = this._readContext(proto, values); + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.SafeMethodInvoke: + var context = this._readContext(proto, values); + if (lang_1.isBlank(context)) { + return null; + } + var args = this._readArgs(proto, values); + return proto.funcOrValue(context, args); + case proto_record_1.RecordType.KeyedRead: + var arg = this._readArgs(proto, values)[0]; + return this._readContext(proto, values)[arg]; + case proto_record_1.RecordType.Chain: + var args = this._readArgs(proto, values); + return args[args.length - 1]; + case proto_record_1.RecordType.InvokeClosure: + return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); + case proto_record_1.RecordType.Interpolate: + case proto_record_1.RecordType.PrimitiveOp: + case proto_record_1.RecordType.CollectionLiteral: + return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); + default: + throw new exceptions_1.BaseException("Unknown operation " + proto.mode); + } + }; + DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { + var context = this._readContext(proto, values); + var selectedPipe = this._pipeFor(proto, context); + if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { + var args = this._readArgs(proto, values); + var currValue = selectedPipe.pipe.transform(context, args); + if (proto.shouldBeChecked()) { + var prevValue = this._readSelf(proto, values); + if (change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue)) { + currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); + if (proto.lastInBinding) { + var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); + if (throwOnChange) + this.throwOnChangeError(prevValue, currValue); + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return change; + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } else { + this._setChanged(proto, false); + return null; + } + } else { + this._writeSelf(proto, currValue, values); + this._setChanged(proto, true); + return null; + } + } + }; + DynamicChangeDetector.prototype._pipeFor = function(proto, context) { + var storedPipe = this._readPipe(proto); + if (lang_1.isPresent(storedPipe)) + return storedPipe; + var pipe = this.pipes.get(proto.name); + this._writePipe(proto, pipe); + return pipe; + }; + DynamicChangeDetector.prototype._readContext = function(proto, values) { + if (proto.contextIndex == -1) { + return this._getDirectiveFor(proto.directiveIndex); + } + return values[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readSelf = function(proto, values) { + return values[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { + values[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._readPipe = function(proto) { + return this.localPipes[proto.selfIndex]; + }; + DynamicChangeDetector.prototype._writePipe = function(proto, value) { + this.localPipes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._setChanged = function(proto, value) { + if (proto.argumentToPureFunction) + this.changes[proto.selfIndex] = value; + }; + DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { + return proto.isPureFunction() && !this._argsChanged(proto); + }; + DynamicChangeDetector.prototype._argsChanged = function(proto) { + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + if (this.changes[args[i]]) { + return true; + } + } + return false; + }; + DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { + return this._argsChanged(proto) || this.changes[proto.contextIndex]; + }; + DynamicChangeDetector.prototype._readArgs = function(proto, values) { + var res = collection_1.ListWrapper.createFixedSize(proto.args.length); + var args = proto.args; + for (var i = 0; i < args.length; ++i) { + res[i] = values[args[i]]; + } + return res; + }; + return DynamicChangeDetector; + })(abstract_change_detector_1.AbstractChangeDetector); + exports.DynamicChangeDetector = DynamicChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); + var JitProtoChangeDetector = (function() { + function JitProtoChangeDetector(definition) { + this.definition = definition; + this._factory = this._createFactory(definition); + } + JitProtoChangeDetector.isSupported = function() { + return true; + }; + JitProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return this._factory(dispatcher); + }; + JitProtoChangeDetector.prototype._createFactory = function(definition) { + return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); + }; + return JitProtoChangeDetector; + })(); + exports.JitProtoChangeDetector = JitProtoChangeDetector; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/observables/ScalarObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _ScalarObservable = require("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"); + var _ScalarObservable2 = _interopRequireDefault(_ScalarObservable); + var _EmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _EmptyObservable2 = _interopRequireDefault(_EmptyObservable); + var ArrayObservable = (function(_Observable) { + _inherits(ArrayObservable, _Observable); + function ArrayObservable(array, scheduler) { + _classCallCheck(this, ArrayObservable); + _Observable.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function create(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function of() { + for (var _len = arguments.length, + array = Array(_len), + _key = 0; _key < _len; _key++) { + array[_key] = arguments[_key]; + } + var scheduler = array[array.length - 1]; + if (scheduler && typeof scheduler.schedule === 'function') { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new _ScalarObservable2['default'](array[0], scheduler); + } else { + return new _EmptyObservable2['default'](scheduler); + } + }; + ArrayObservable.dispatch = function dispatch(state) { + var array = state.array; + var index = state.index; + var count = state.count; + var subscriber = state.subscriber; + if (index >= count) { + subscriber.complete(); + return ; + } + subscriber.next(array[index]); + if (subscriber.isUnsubscribed) { + return ; + } + state.index = index + 1; + this.schedule(state); + }; + ArrayObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var array = this.array; + var count = array.length; + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(ArrayObservable.dispatch, 0, { + array: array, + index: index, + count: count, + subscriber: subscriber + })); + } else { + for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { + subscriber.next(array[i]); + } + subscriber.complete(); + } + }; + return ArrayObservable; + })(_Observable3['default']); + exports['default'] = ArrayObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/concat-static", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = concat; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + function concat() { + var scheduler = _schedulersImmediate2['default']; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + var args = observables; + if (typeof args[observables.length - 1].schedule === 'function') { + scheduler = args.pop(); + args.push(1, scheduler); + } + return _Observable2['default'].fromArray(observables).mergeAll(1); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick", ["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _NextTickScheduler = require("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"); + var _NextTickScheduler2 = _interopRequireDefault(_NextTickScheduler); + exports['default'] = new _NextTickScheduler2['default'](); + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/element_injector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/event_config", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/interfaces", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var di_1 = require("angular2/src/core/di"); + var injector_1 = require("angular2/src/core/di/injector"); + var provider_1 = require("angular2/src/core/di/provider"); + var di_2 = require("angular2/src/core/metadata/di"); + var avmModule = require("angular2/src/core/linker/view_manager"); + var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); + var element_ref_1 = require("angular2/src/core/linker/element_ref"); + var template_ref_1 = require("angular2/src/core/linker/template_ref"); + var directives_1 = require("angular2/src/core/metadata/directives"); + var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var query_list_1 = require("angular2/src/core/linker/query_list"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var event_config_1 = require("angular2/src/core/linker/event_config"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var interfaces_1 = require("angular2/src/core/linker/interfaces"); + var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); + var _staticKeys; + var StaticKeys = (function() { + function StaticKeys() { + this.viewManagerId = di_1.Key.get(avmModule.AppViewManager).id; + this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; + this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; + this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; + this.elementRefId = di_1.Key.get(element_ref_1.ElementRef).id; + } + StaticKeys.instance = function() { + if (lang_1.isBlank(_staticKeys)) + _staticKeys = new StaticKeys(); + return _staticKeys; + }; + return StaticKeys; + })(); + exports.StaticKeys = StaticKeys; + var TreeNode = (function() { + function TreeNode(parent) { + if (lang_1.isPresent(parent)) { + parent.addChild(this); + } else { + this._parent = null; + } + } + TreeNode.prototype.addChild = function(child) { + child._parent = this; + }; + TreeNode.prototype.remove = function() { + this._parent = null; + }; + Object.defineProperty(TreeNode.prototype, "parent", { + get: function() { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return TreeNode; + })(); + exports.TreeNode = TreeNode; + var DirectiveDependency = (function(_super) { + __extends(DirectiveDependency, _super); + function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { + _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); + this.attributeName = attributeName; + this.queryDecorator = queryDecorator; + this._verify(); + } + DirectiveDependency.prototype._verify = function() { + var count = 0; + if (lang_1.isPresent(this.queryDecorator)) + count++; + if (lang_1.isPresent(this.attributeName)) + count++; + if (count > 1) + throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); + }; + DirectiveDependency.createFrom = function(d) { + return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); + }; + DirectiveDependency._attributeName = function(properties) { + var p = properties.find(function(p) { + return p instanceof di_2.AttributeMetadata; + }); + return lang_1.isPresent(p) ? p.attributeName : null; + }; + DirectiveDependency._query = function(properties) { + return properties.find(function(p) { + return p instanceof di_2.QueryMetadata; + }); + }; + return DirectiveDependency; + })(di_1.Dependency); + exports.DirectiveDependency = DirectiveDependency; + var DirectiveProvider = (function(_super) { + __extends(DirectiveProvider, _super); + function DirectiveProvider(key, factory, deps, metadata, providers, viewProviders) { + _super.call(this, key, [new provider_1.ResolvedFactory(factory, deps)], false); + this.metadata = metadata; + this.providers = providers; + this.viewProviders = viewProviders; + this.callOnDestroy = directive_lifecycle_reflector_1.hasLifecycleHook(interfaces_1.LifecycleHooks.OnDestroy, key.token); + } + Object.defineProperty(DirectiveProvider.prototype, "displayName", { + get: function() { + return this.key.displayName; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "queries", { + get: function() { + if (lang_1.isBlank(this.metadata.queries)) + return []; + var res = []; + collection_1.StringMapWrapper.forEach(this.metadata.queries, function(meta, fieldName) { + var setter = reflection_1.reflector.setter(fieldName); + res.push(new QueryMetadataWithSetter(setter, meta)); + }); + return res; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveProvider.prototype, "eventEmitters", { + get: function() { + return lang_1.isPresent(this.metadata) && lang_1.isPresent(this.metadata.outputs) ? this.metadata.outputs : []; + }, + enumerable: true, + configurable: true + }); + DirectiveProvider.createFromProvider = function(provider, meta) { + if (lang_1.isBlank(meta)) { + meta = new directives_1.DirectiveMetadata(); + } + var rb = provider_1.resolveProvider(provider); + var rf = rb.resolvedFactories[0]; + var deps = rf.dependencies.map(DirectiveDependency.createFrom); + var providers = lang_1.isPresent(meta.providers) ? meta.providers : []; + var viewBindigs = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? meta.viewProviders : []; + return new DirectiveProvider(rb.key, rf.factory, deps, meta, providers, viewBindigs); + }; + DirectiveProvider.createFromType = function(type, annotation) { + var provider = new di_1.Provider(type, {useClass: type}); + return DirectiveProvider.createFromProvider(provider, annotation); + }; + return DirectiveProvider; + })(provider_1.ResolvedProvider_); + exports.DirectiveProvider = DirectiveProvider; + var PreBuiltObjects = (function() { + function PreBuiltObjects(viewManager, view, elementRef, templateRef) { + this.viewManager = viewManager; + this.view = view; + this.elementRef = elementRef; + this.templateRef = templateRef; + this.nestedView = null; + } + return PreBuiltObjects; + })(); + exports.PreBuiltObjects = PreBuiltObjects; + var QueryMetadataWithSetter = (function() { + function QueryMetadataWithSetter(setter, metadata) { + this.setter = setter; + this.metadata = metadata; + } + return QueryMetadataWithSetter; + })(); + exports.QueryMetadataWithSetter = QueryMetadataWithSetter; + var EventEmitterAccessor = (function() { + function EventEmitterAccessor(eventName, getter) { + this.eventName = eventName; + this.getter = getter; + } + EventEmitterAccessor.prototype.subscribe = function(view, boundElementIndex, directive) { + var _this = this; + var eventEmitter = this.getter(directive); + return async_1.ObservableWrapper.subscribe(eventEmitter, function(eventObj) { + return view.triggerEventHandlers(_this.eventName, eventObj, boundElementIndex); + }); + }; + return EventEmitterAccessor; + })(); + exports.EventEmitterAccessor = EventEmitterAccessor; + function _createEventEmitterAccessors(bwv) { + var provider = bwv.provider; + if (!(provider instanceof DirectiveProvider)) + return []; + var db = provider; + return db.eventEmitters.map(function(eventConfig) { + var parsedEvent = event_config_1.EventConfig.parse(eventConfig); + return new EventEmitterAccessor(parsedEvent.eventName, reflection_1.reflector.getter(parsedEvent.fieldName)); + }); + } + function _createProtoQueryRefs(providers) { + var res = []; + collection_1.ListWrapper.forEachWithIndex(providers, function(b, i) { + if (b.provider instanceof DirectiveProvider) { + var directiveProvider = b.provider; + var queries = directiveProvider.queries; + queries.forEach(function(q) { + return res.push(new ProtoQueryRef(i, q.setter, q.metadata)); + }); + var deps = directiveProvider.resolvedFactory.dependencies; + deps.forEach(function(d) { + if (lang_1.isPresent(d.queryDecorator)) + res.push(new ProtoQueryRef(i, null, d.queryDecorator)); + }); + } + }); + return res; + } + var ProtoElementInjector = (function() { + function ProtoElementInjector(parent, index, bwv, distanceToParent, _firstProviderIsComponent, directiveVariableBindings) { + this.parent = parent; + this.index = index; + this.distanceToParent = distanceToParent; + this.directiveVariableBindings = directiveVariableBindings; + this._firstProviderIsComponent = _firstProviderIsComponent; + var length = bwv.length; + this.protoInjector = new injector_1.ProtoInjector(bwv); + this.eventEmitterAccessors = collection_1.ListWrapper.createFixedSize(length); + for (var i = 0; i < length; ++i) { + this.eventEmitterAccessors[i] = _createEventEmitterAccessors(bwv[i]); + } + this.protoQueryRefs = _createProtoQueryRefs(bwv); + } + ProtoElementInjector.create = function(parent, index, providers, firstProviderIsComponent, distanceToParent, directiveVariableBindings) { + var bd = []; + ProtoElementInjector._createDirectiveProviderWithVisibility(providers, bd, firstProviderIsComponent); + if (firstProviderIsComponent) { + ProtoElementInjector._createViewProvidersWithVisibility(providers, bd); + } + ProtoElementInjector._createProvidersWithVisibility(providers, bd); + return new ProtoElementInjector(parent, index, bd, distanceToParent, firstProviderIsComponent, directiveVariableBindings); + }; + ProtoElementInjector._createDirectiveProviderWithVisibility = function(dirProviders, bd, firstProviderIsComponent) { + dirProviders.forEach(function(dirProvider) { + bd.push(ProtoElementInjector._createProviderWithVisibility(firstProviderIsComponent, dirProvider, dirProviders, dirProvider)); + }); + }; + ProtoElementInjector._createProvidersWithVisibility = function(dirProviders, bd) { + var providersFromAllDirectives = []; + dirProviders.forEach(function(dirProvider) { + providersFromAllDirectives = collection_1.ListWrapper.concat(providersFromAllDirectives, dirProvider.providers); + }); + var resolved = di_1.Injector.resolve(providersFromAllDirectives); + resolved.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Public)); + }); + }; + ProtoElementInjector._createProviderWithVisibility = function(firstProviderIsComponent, dirProvider, dirProviders, provider) { + var isComponent = firstProviderIsComponent && dirProviders[0] === dirProvider; + return new injector_1.ProviderWithVisibility(provider, isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); + }; + ProtoElementInjector._createViewProvidersWithVisibility = function(dirProviders, bd) { + var resolvedViewProviders = di_1.Injector.resolve(dirProviders[0].viewProviders); + resolvedViewProviders.forEach(function(b) { + return bd.push(new injector_1.ProviderWithVisibility(b, injector_1.Visibility.Private)); + }); + }; + ProtoElementInjector.prototype.instantiate = function(parent) { + return new ElementInjector(this, parent); + }; + ProtoElementInjector.prototype.directParent = function() { + return this.distanceToParent < 2 ? this.parent : null; + }; + Object.defineProperty(ProtoElementInjector.prototype, "hasBindings", { + get: function() { + return this.eventEmitterAccessors.length > 0; + }, + enumerable: true, + configurable: true + }); + ProtoElementInjector.prototype.getProviderAtIndex = function(index) { + return this.protoInjector.getProviderAtIndex(index); + }; + return ProtoElementInjector; + })(); + exports.ProtoElementInjector = ProtoElementInjector; + var _Context = (function() { + function _Context(element, componentElement, injector) { + this.element = element; + this.componentElement = componentElement; + this.injector = injector; + } + return _Context; + })(); + var ElementInjector = (function(_super) { + __extends(ElementInjector, _super); + function ElementInjector(_proto, parent) { + var _this = this; + _super.call(this, parent); + this._preBuiltObjects = null; + this._proto = _proto; + this._injector = new di_1.Injector(this._proto.protoInjector, null, this, function() { + return _this._debugContext(); + }); + var injectorStrategy = this._injector.internalStrategy; + this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementInjectorInlineStrategy(injectorStrategy, this) : new ElementInjectorDynamicStrategy(injectorStrategy, this); + this.hydrated = false; + this._queryStrategy = this._buildQueryStrategy(); + } + ElementInjector.prototype.dehydrate = function() { + this.hydrated = false; + this._host = null; + this._preBuiltObjects = null; + this._strategy.callOnDestroy(); + this._strategy.dehydrate(); + this._queryStrategy.dehydrate(); + }; + ElementInjector.prototype.hydrate = function(imperativelyCreatedInjector, host, preBuiltObjects) { + this._host = host; + this._preBuiltObjects = preBuiltObjects; + this._reattachInjectors(imperativelyCreatedInjector); + this._queryStrategy.hydrate(); + this._strategy.hydrate(); + this.hydrated = true; + }; + ElementInjector.prototype._debugContext = function() { + var p = this._preBuiltObjects; + var index = p.elementRef.boundElementIndex - p.view.elementOffset; + var c = this._preBuiltObjects.view.getDebugContext(index, null); + return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; + }; + ElementInjector.prototype._reattachInjectors = function(imperativelyCreatedInjector) { + if (lang_1.isPresent(this._parent)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._parent._injector, false); + } else { + this._reattachInjector(this._injector, this._parent._injector, false); + } + } else if (lang_1.isPresent(this._host)) { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, false); + this._reattachInjector(imperativelyCreatedInjector, this._host._injector, true); + } else { + this._reattachInjector(this._injector, this._host._injector, true); + } + } else { + if (lang_1.isPresent(imperativelyCreatedInjector)) { + this._reattachInjector(this._injector, imperativelyCreatedInjector, true); + } + } + }; + ElementInjector.prototype._reattachInjector = function(injector, parentInjector, isBoundary) { + injector.internalStrategy.attach(parentInjector, isBoundary); + }; + ElementInjector.prototype.hasVariableBinding = function(name) { + var vb = this._proto.directiveVariableBindings; + return lang_1.isPresent(vb) && vb.has(name); + }; + ElementInjector.prototype.getVariableBinding = function(name) { + var index = this._proto.directiveVariableBindings.get(name); + return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); + }; + ElementInjector.prototype.get = function(token) { + return this._injector.get(token); + }; + ElementInjector.prototype.hasDirective = function(type) { + return lang_1.isPresent(this._injector.getOptional(type)); + }; + ElementInjector.prototype.getEventEmitterAccessors = function() { + return this._proto.eventEmitterAccessors; + }; + ElementInjector.prototype.getDirectiveVariableBindings = function() { + return this._proto.directiveVariableBindings; + }; + ElementInjector.prototype.getComponent = function() { + return this._strategy.getComponent(); + }; + ElementInjector.prototype.getInjector = function() { + return this._injector; + }; + ElementInjector.prototype.getElementRef = function() { + return this._preBuiltObjects.elementRef; + }; + ElementInjector.prototype.getViewContainerRef = function() { + return new view_container_ref_2.ViewContainerRef_(this._preBuiltObjects.viewManager, this.getElementRef()); + }; + ElementInjector.prototype.getNestedView = function() { + return this._preBuiltObjects.nestedView; + }; + ElementInjector.prototype.getView = function() { + return this._preBuiltObjects.view; + }; + ElementInjector.prototype.directParent = function() { + return this._proto.distanceToParent < 2 ? this.parent : null; + }; + ElementInjector.prototype.isComponentKey = function(key) { + return this._strategy.isComponentKey(key); + }; + ElementInjector.prototype.getDependency = function(injector, provider, dep) { + var key = dep.key; + if (provider instanceof DirectiveProvider) { + var dirDep = dep; + var dirProvider = provider; + var staticKeys = StaticKeys.instance(); + if (key.id === staticKeys.viewManagerId) + return this._preBuiltObjects.viewManager; + if (lang_1.isPresent(dirDep.attributeName)) + return this._buildAttribute(dirDep); + if (lang_1.isPresent(dirDep.queryDecorator)) + return this._queryStrategy.findQuery(dirDep.queryDecorator).list; + if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { + if (dirProvider.metadata instanceof directives_1.ComponentMetadata) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } else { + return this._preBuiltObjects.view.changeDetector.ref; + } + } + if (dirDep.key.id === StaticKeys.instance().elementRefId) { + return this.getElementRef(); + } + if (dirDep.key.id === StaticKeys.instance().viewContainerId) { + return this.getViewContainerRef(); + } + if (dirDep.key.id === StaticKeys.instance().templateRefId) { + if (lang_1.isBlank(this._preBuiltObjects.templateRef)) { + if (dirDep.optional) { + return null; + } + throw new di_1.NoProviderError(null, dirDep.key); + } + return this._preBuiltObjects.templateRef; + } + } else if (provider instanceof pipe_provider_1.PipeProvider) { + if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { + var componentView = this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex); + return componentView.changeDetector.ref; + } + } + return injector_1.UNDEFINED; + }; + ElementInjector.prototype._buildAttribute = function(dep) { + var attributes = this._proto.attributes; + if (lang_1.isPresent(attributes) && attributes.has(dep.attributeName)) { + return attributes.get(dep.attributeName); + } else { + return null; + } + }; + ElementInjector.prototype.addDirectivesMatchingQuery = function(query, list) { + var templateRef = lang_1.isBlank(this._preBuiltObjects) ? null : this._preBuiltObjects.templateRef; + if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { + list.push(templateRef); + } + this._strategy.addDirectivesMatchingQuery(query, list); + }; + ElementInjector.prototype._buildQueryStrategy = function() { + if (this._proto.protoQueryRefs.length === 0) { + return _emptyQueryStrategy; + } else if (this._proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { + return new InlineQueryStrategy(this); + } else { + return new DynamicQueryStrategy(this); + } + }; + ElementInjector.prototype.link = function(parent) { + parent.addChild(this); + }; + ElementInjector.prototype.unlink = function() { + this.remove(); + }; + ElementInjector.prototype.getDirectiveAtIndex = function(index) { + return this._injector.getAt(index); + }; + ElementInjector.prototype.hasInstances = function() { + return this._proto.hasBindings && this.hydrated; + }; + ElementInjector.prototype.getHost = function() { + return this._host; + }; + ElementInjector.prototype.getBoundElementIndex = function() { + return this._proto.index; + }; + ElementInjector.prototype.getRootViewInjectors = function() { + if (!this.hydrated) + return []; + var view = this._preBuiltObjects.view; + var nestedView = view.getNestedView(view.elementOffset + this.getBoundElementIndex()); + return lang_1.isPresent(nestedView) ? nestedView.rootElementInjectors : []; + }; + ElementInjector.prototype.afterViewChecked = function() { + this._queryStrategy.updateViewQueries(); + }; + ElementInjector.prototype.afterContentChecked = function() { + this._queryStrategy.updateContentQueries(); + }; + ElementInjector.prototype.traverseAndSetQueriesAsDirty = function() { + var inj = this; + while (lang_1.isPresent(inj)) { + inj._setQueriesAsDirty(); + inj = inj.parent; + } + }; + ElementInjector.prototype._setQueriesAsDirty = function() { + this._queryStrategy.setContentQueriesAsDirty(); + if (lang_1.isPresent(this._host)) + this._host._queryStrategy.setViewQueriesAsDirty(); + }; + return ElementInjector; + })(TreeNode); + exports.ElementInjector = ElementInjector; + var _EmptyQueryStrategy = (function() { + function _EmptyQueryStrategy() {} + _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; + _EmptyQueryStrategy.prototype.hydrate = function() {}; + _EmptyQueryStrategy.prototype.dehydrate = function() {}; + _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; + _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; + _EmptyQueryStrategy.prototype.findQuery = function(query) { + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return _EmptyQueryStrategy; + })(); + var _emptyQueryStrategy = new _EmptyQueryStrategy(); + var InlineQueryStrategy = (function() { + function InlineQueryStrategy(ei) { + var protoRefs = ei._proto.protoQueryRefs; + if (protoRefs.length > 0) + this.query0 = new QueryRef(protoRefs[0], ei); + if (protoRefs.length > 1) + this.query1 = new QueryRef(protoRefs[1], ei); + if (protoRefs.length > 2) + this.query2 = new QueryRef(protoRefs[2], ei); + } + InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) + this.query0.dirty = true; + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) + this.query1.dirty = true; + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) + this.query2.dirty = true; + }; + InlineQueryStrategy.prototype.hydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.hydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.hydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.hydrate(); + }; + InlineQueryStrategy.prototype.dehydrate = function() { + if (lang_1.isPresent(this.query0)) + this.query0.dehydrate(); + if (lang_1.isPresent(this.query1)) + this.query1.dehydrate(); + if (lang_1.isPresent(this.query2)) + this.query2.dehydrate(); + }; + InlineQueryStrategy.prototype.updateContentQueries = function() { + if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.updateViewQueries = function() { + if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { + this.query0.update(); + } + if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { + this.query1.update(); + } + if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { + this.query2.update(); + } + }; + InlineQueryStrategy.prototype.findQuery = function(query) { + if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { + return this.query0; + } + if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { + return this.query1; + } + if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { + return this.query2; + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; + return InlineQueryStrategy; + })(); + var DynamicQueryStrategy = (function() { + function DynamicQueryStrategy(ei) { + this.queries = ei._proto.protoQueryRefs.map(function(p) { + return new QueryRef(p, ei); + }); + } + DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) + q.dirty = true; + } + }; + DynamicQueryStrategy.prototype.hydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.hydrate(); + } + }; + DynamicQueryStrategy.prototype.dehydrate = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + q.dehydrate(); + } + }; + DynamicQueryStrategy.prototype.updateContentQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (!q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.updateViewQueries = function() { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.isViewQuery) { + q.update(); + } + } + }; + DynamicQueryStrategy.prototype.findQuery = function(query) { + for (var i = 0; i < this.queries.length; ++i) { + var q = this.queries[i]; + if (q.protoQueryRef.query === query) { + return q; + } + } + throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); + }; + return DynamicQueryStrategy; + })(); + var ElementInjectorInlineStrategy = (function() { + function ElementInjectorInlineStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorInlineStrategy.prototype.hydrate = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + i.resetConstructionCounter(); + if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + }; + ElementInjectorInlineStrategy.prototype.dehydrate = function() { + var i = this.injectorStrategy; + i.obj0 = injector_1.UNDEFINED; + i.obj1 = injector_1.UNDEFINED; + i.obj2 = injector_1.UNDEFINED; + i.obj3 = injector_1.UNDEFINED; + i.obj4 = injector_1.UNDEFINED; + i.obj5 = injector_1.UNDEFINED; + i.obj6 = injector_1.UNDEFINED; + i.obj7 = injector_1.UNDEFINED; + i.obj8 = injector_1.UNDEFINED; + i.obj9 = injector_1.UNDEFINED; + }; + ElementInjectorInlineStrategy.prototype.callOnDestroy = function() { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (p.provider0 instanceof DirectiveProvider && p.provider0.callOnDestroy) { + i.obj0.onDestroy(); + } + if (p.provider1 instanceof DirectiveProvider && p.provider1.callOnDestroy) { + i.obj1.onDestroy(); + } + if (p.provider2 instanceof DirectiveProvider && p.provider2.callOnDestroy) { + i.obj2.onDestroy(); + } + if (p.provider3 instanceof DirectiveProvider && p.provider3.callOnDestroy) { + i.obj3.onDestroy(); + } + if (p.provider4 instanceof DirectiveProvider && p.provider4.callOnDestroy) { + i.obj4.onDestroy(); + } + if (p.provider5 instanceof DirectiveProvider && p.provider5.callOnDestroy) { + i.obj5.onDestroy(); + } + if (p.provider6 instanceof DirectiveProvider && p.provider6.callOnDestroy) { + i.obj6.onDestroy(); + } + if (p.provider7 instanceof DirectiveProvider && p.provider7.callOnDestroy) { + i.obj7.onDestroy(); + } + if (p.provider8 instanceof DirectiveProvider && p.provider8.callOnDestroy) { + i.obj8.onDestroy(); + } + if (p.provider9 instanceof DirectiveProvider && p.provider9.callOnDestroy) { + i.obj9.onDestroy(); + } + }; + ElementInjectorInlineStrategy.prototype.getComponent = function() { + return this.injectorStrategy.obj0; + }; + ElementInjectorInlineStrategy.prototype.isComponentKey = function(key) { + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; + }; + ElementInjectorInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var i = this.injectorStrategy; + var p = i.protoStrategy; + if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { + if (i.obj0 === injector_1.UNDEFINED) + i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); + list.push(i.obj0); + } + if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { + if (i.obj1 === injector_1.UNDEFINED) + i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); + list.push(i.obj1); + } + if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { + if (i.obj2 === injector_1.UNDEFINED) + i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); + list.push(i.obj2); + } + if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { + if (i.obj3 === injector_1.UNDEFINED) + i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); + list.push(i.obj3); + } + if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { + if (i.obj4 === injector_1.UNDEFINED) + i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); + list.push(i.obj4); + } + if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { + if (i.obj5 === injector_1.UNDEFINED) + i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); + list.push(i.obj5); + } + if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { + if (i.obj6 === injector_1.UNDEFINED) + i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); + list.push(i.obj6); + } + if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { + if (i.obj7 === injector_1.UNDEFINED) + i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); + list.push(i.obj7); + } + if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { + if (i.obj8 === injector_1.UNDEFINED) + i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); + list.push(i.obj8); + } + if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { + if (i.obj9 === injector_1.UNDEFINED) + i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); + list.push(i.obj9); + } + }; + return ElementInjectorInlineStrategy; + })(); + var ElementInjectorDynamicStrategy = (function() { + function ElementInjectorDynamicStrategy(injectorStrategy, _ei) { + this.injectorStrategy = injectorStrategy; + this._ei = _ei; + } + ElementInjectorDynamicStrategy.prototype.hydrate = function() { + var inj = this.injectorStrategy; + var p = inj.protoStrategy; + inj.resetConstructionCounter(); + for (var i = 0; i < p.keyIds.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { + inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); + } + } + }; + ElementInjectorDynamicStrategy.prototype.dehydrate = function() { + var inj = this.injectorStrategy; + collection_1.ListWrapper.fill(inj.objs, injector_1.UNDEFINED); + }; + ElementInjectorDynamicStrategy.prototype.callOnDestroy = function() { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i] instanceof DirectiveProvider && p.providers[i].callOnDestroy) { + ist.objs[i].onDestroy(); + } + } + }; + ElementInjectorDynamicStrategy.prototype.getComponent = function() { + return this.injectorStrategy.objs[0]; + }; + ElementInjectorDynamicStrategy.prototype.isComponentKey = function(key) { + var p = this.injectorStrategy.protoStrategy; + return this._ei._proto._firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; + }; + ElementInjectorDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { + var ist = this.injectorStrategy; + var p = ist.protoStrategy; + for (var i = 0; i < p.providers.length; i++) { + if (p.providers[i].key.token === query.selector) { + if (ist.objs[i] === injector_1.UNDEFINED) { + ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); + } + list.push(ist.objs[i]); + } + } + }; + return ElementInjectorDynamicStrategy; + })(); + var ProtoQueryRef = (function() { + function ProtoQueryRef(dirIndex, setter, query) { + this.dirIndex = dirIndex; + this.setter = setter; + this.query = query; + } + Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { + get: function() { + return lang_1.isPresent(this.setter); + }, + enumerable: true, + configurable: true + }); + return ProtoQueryRef; + })(); + exports.ProtoQueryRef = ProtoQueryRef; + var QueryRef = (function() { + function QueryRef(protoQueryRef, originator) { + this.protoQueryRef = protoQueryRef; + this.originator = originator; + } + Object.defineProperty(QueryRef.prototype, "isViewQuery", { + get: function() { + return this.protoQueryRef.query.isViewQuery; + }, + enumerable: true, + configurable: true + }); + QueryRef.prototype.update = function() { + if (!this.dirty) + return ; + this._update(); + this.dirty = false; + if (this.protoQueryRef.usesPropertySyntax) { + var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); + if (this.protoQueryRef.query.first) { + this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); + } else { + this.protoQueryRef.setter(dir, this.list); + } + } + this.list.notifyOnChanges(); + }; + QueryRef.prototype._update = function() { + var aggregator = []; + if (this.protoQueryRef.query.isViewQuery) { + var view = this.originator.getView(); + var nestedView = view.getNestedView(view.elementOffset + this.originator.getBoundElementIndex()); + if (lang_1.isPresent(nestedView)) + this._visitView(nestedView, aggregator); + } else { + this._visit(this.originator, aggregator); + } + this.list.reset(aggregator); + }; + ; + QueryRef.prototype._visit = function(inj, aggregator) { + var view = inj.getView(); + var startIdx = view.elementOffset + inj._proto.index; + for (var i = startIdx; i < view.elementOffset + view.ownBindersCount; i++) { + var curInj = view.elementInjectors[i]; + if (lang_1.isBlank(curInj)) + continue; + if (i > startIdx && (lang_1.isBlank(curInj) || lang_1.isBlank(curInj.parent) || view.elementOffset + curInj.parent._proto.index < startIdx)) { + break; + } + if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) + continue; + this._visitInjector(curInj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._visitInjector = function(inj, aggregator) { + if (this.protoQueryRef.query.isVarBindingQuery) { + this._aggregateVariableBinding(inj, aggregator); + } else { + this._aggregateDirective(inj, aggregator); + } + }; + QueryRef.prototype._visitViewContainer = function(vc, aggregator) { + for (var j = 0; j < vc.views.length; j++) { + this._visitView(vc.views[j], aggregator); + } + }; + QueryRef.prototype._visitView = function(view, aggregator) { + for (var i = view.elementOffset; i < view.elementOffset + view.ownBindersCount; i++) { + var inj = view.elementInjectors[i]; + if (lang_1.isBlank(inj)) + continue; + this._visitInjector(inj, aggregator); + var vc = view.viewContainers[i]; + if (lang_1.isPresent(vc)) + this._visitViewContainer(vc, aggregator); + } + }; + QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { + var vb = this.protoQueryRef.query.varBindings; + for (var i = 0; i < vb.length; ++i) { + if (inj.hasVariableBinding(vb[i])) { + aggregator.push(inj.getVariableBinding(vb[i])); + } + } + }; + QueryRef.prototype._aggregateDirective = function(inj, aggregator) { + inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); + }; + QueryRef.prototype.dehydrate = function() { + this.list = null; + }; + QueryRef.prototype.hydrate = function() { + this.list = new query_list_1.QueryList(); + this.dirty = true; + }; + return QueryRef; + })(); + exports.QueryRef = QueryRef; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); + var browser_details_1 = require("angular2/src/animate/browser_details"); + var AnimationBuilder = (function() { + function AnimationBuilder(browserDetails) { + this.browserDetails = browserDetails; + } + AnimationBuilder.prototype.css = function() { + return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); + }; + AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); + return AnimationBuilder; + })(); + exports.AnimationBuilder = AnimationBuilder; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var model_1 = require("angular2/src/common/forms/model"); + exports.AbstractControl = model_1.AbstractControl; + exports.Control = model_1.Control; + exports.ControlGroup = model_1.ControlGroup; + exports.ControlArray = model_1.ControlArray; + var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); + exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; + var control_container_1 = require("angular2/src/common/forms/directives/control_container"); + exports.ControlContainer = control_container_1.ControlContainer; + var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); + exports.NgControlName = ng_control_name_1.NgControlName; + var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); + exports.NgFormControl = ng_form_control_1.NgFormControl; + var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); + exports.NgModel = ng_model_1.NgModel; + var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); + exports.NgControl = ng_control_1.NgControl; + var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); + exports.NgControlGroup = ng_control_group_1.NgControlGroup; + var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); + exports.NgFormModel = ng_form_model_1.NgFormModel; + var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); + exports.NgForm = ng_form_1.NgForm; + var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); + exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; + var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); + exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; + var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); + exports.NgControlStatus = ng_control_status_1.NgControlStatus; + var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); + exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; + var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); + exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; + exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; + var directives_1 = require("angular2/src/common/forms/directives"); + exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; + var validators_1 = require("angular2/src/common/forms/validators"); + exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; + exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; + exports.Validators = validators_1.Validators; + var validators_2 = require("angular2/src/common/forms/directives/validators"); + exports.RequiredValidator = validators_2.RequiredValidator; + exports.MinLengthValidator = validators_2.MinLengthValidator; + exports.MaxLengthValidator = validators_2.MaxLengthValidator; + var form_builder_1 = require("angular2/src/common/forms/form_builder"); + exports.FormBuilder = form_builder_1.FormBuilder; + exports.FORM_PROVIDERS = form_builder_1.FORM_PROVIDERS; + exports.FORM_BINDINGS = form_builder_1.FORM_BINDINGS; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/xhr_impl", ["angular2/src/core/di", "angular2/src/compiler/xhr", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/web_workers/shared/messaging_api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var WebWorkerXHRImpl = (function(_super) { + __extends(WebWorkerXHRImpl, _super); + function WebWorkerXHRImpl(messageBrokerFactory) { + _super.call(this); + this._messageBroker = messageBrokerFactory.createMessageBroker(messaging_api_1.XHR_CHANNEL); + } + WebWorkerXHRImpl.prototype.get = function(url) { + var fnArgs = [new client_message_broker_1.FnArg(url, null)]; + var args = new client_message_broker_1.UiArguments("get", fnArgs); + return this._messageBroker.runOnService(args, String); + }; + WebWorkerXHRImpl = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [client_message_broker_1.ClientMessageBrokerFactory])], WebWorkerXHRImpl); + return WebWorkerXHRImpl; + })(xhr_1.XHR); + exports.WebWorkerXHRImpl = WebWorkerXHRImpl; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/core/linker/template_commands", "angular2/src/compiler/directive_metadata", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/command_compiler", "angular2/src/compiler/util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var async_1 = require("angular2/src/facade/async"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + var di_1 = require("angular2/src/core/di"); + var source_module_1 = require("angular2/src/compiler/source_module"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var command_compiler_2 = require("angular2/src/compiler/command_compiler"); + var util_1 = require("angular2/src/compiler/util"); + var TemplateCompiler = (function() { + function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _commandCompiler, _cdCompiler) { + this._runtimeMetadataResolver = _runtimeMetadataResolver; + this._templateNormalizer = _templateNormalizer; + this._templateParser = _templateParser; + this._styleCompiler = _styleCompiler; + this._commandCompiler = _commandCompiler; + this._cdCompiler = _cdCompiler; + this._hostCacheKeys = new Map(); + this._compiledTemplateCache = new Map(); + this._compiledTemplateDone = new Map(); + this._nextTemplateId = 0; + } + TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { + if (!directive.isComponent) { + return async_1.PromiseWrapper.resolve(directive); + } + return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { + return new directive_metadata_1.CompileDirectiveMetadata({ + type: directive.type, + isComponent: directive.isComponent, + dynamicLoadable: directive.dynamicLoadable, + selector: directive.selector, + exportAs: directive.exportAs, + changeDetection: directive.changeDetection, + inputs: directive.inputs, + outputs: directive.outputs, + hostListeners: directive.hostListeners, + hostProperties: directive.hostProperties, + hostAttributes: directive.hostAttributes, + lifecycleHooks: directive.lifecycleHooks, + template: normalizedTemplate + }); + }); + }; + TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { + var hostCacheKey = this._hostCacheKeys.get(type); + if (lang_1.isBlank(hostCacheKey)) { + hostCacheKey = new Object(); + this._hostCacheKeys.set(type, hostCacheKey); + var compMeta = this._runtimeMetadataResolver.getMetadata(type); + assertComponent(compMeta); + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], new Set()); + } + return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { + return new template_commands_1.CompiledHostTemplate(compiledTemplate); + }); + }; + TemplateCompiler.prototype.clearCache = function() { + this._hostCacheKeys.clear(); + this._styleCompiler.clearCache(); + this._compiledTemplateCache.clear(); + this._compiledTemplateDone.clear(); + }; + TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, compilingComponentCacheKeys) { + var _this = this; + var compiledTemplate = this._compiledTemplateCache.get(cacheKey); + var done = this._compiledTemplateDone.get(cacheKey); + if (lang_1.isBlank(compiledTemplate)) { + var styles = []; + var changeDetectorFactory; + var commands = []; + var templateId = lang_1.stringify(compMeta.type.runtime) + "Template" + this._nextTemplateId++; + compiledTemplate = new template_commands_1.CompiledComponentTemplate(templateId, function(dispatcher) { + return changeDetectorFactory(dispatcher); + }, commands, styles); + this._compiledTemplateCache.set(cacheKey, compiledTemplate); + compilingComponentCacheKeys.add(cacheKey); + done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(viewDirectives.map(function(dirMeta) { + return _this.normalizeDirectiveMetadata(dirMeta); + }))).then(function(stylesAndNormalizedViewDirMetas) { + var childPromises = []; + var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); + var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, compMeta.type.name); + var changeDetectorFactories = _this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); + changeDetectorFactory = changeDetectorFactories[0]; + var tmpStyles = stylesAndNormalizedViewDirMetas[0]; + tmpStyles.forEach(function(style) { + return styles.push(style); + }); + var tmpCommands = _this._compileCommandsRuntime(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises); + tmpCommands.forEach(function(cmd) { + return commands.push(cmd); + }); + return async_1.PromiseWrapper.all(childPromises); + }).then(function(_) { + collection_1.SetWrapper.delete(compilingComponentCacheKeys, cacheKey); + return compiledTemplate; + }); + this._compiledTemplateDone.set(cacheKey, done); + } + return compiledTemplate; + }; + TemplateCompiler.prototype._compileCommandsRuntime = function(compMeta, parsedTemplate, changeDetectorFactories, compilingComponentCacheKeys, childPromises) { + var _this = this; + var cmds = this._commandCompiler.compileComponentRuntime(compMeta, parsedTemplate, changeDetectorFactories, function(childComponentDir) { + var childCacheKey = childComponentDir.type.runtime; + var childViewDirectives = _this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); + var childIsRecursive = collection_1.SetWrapper.has(compilingComponentCacheKeys, childCacheKey); + var childTemplate = _this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, compilingComponentCacheKeys); + if (!childIsRecursive) { + childPromises.push(_this._compiledTemplateDone.get(childCacheKey)); + } + return function() { + return childTemplate; + }; + }); + cmds.forEach(function(cmd) { + if (cmd instanceof template_commands_1.BeginComponentCmd) { + cmd.templateGetter(); + } + }); + return cmds; + }; + TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { + var _this = this; + if (components.length === 0) { + throw new exceptions_1.BaseException('No components given'); + } + var declarations = []; + var templateArguments = []; + var componentMetas = []; + components.forEach(function(componentWithDirs) { + var compMeta = componentWithDirs.component; + assertComponent(compMeta); + componentMetas.push(compMeta); + _this._processTemplateCodeGen(compMeta, componentWithDirs.directives, declarations, templateArguments); + if (compMeta.dynamicLoadable) { + var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); + componentMetas.push(hostMeta); + _this._processTemplateCodeGen(hostMeta, [compMeta], declarations, templateArguments); + } + }); + collection_1.ListWrapper.forEachWithIndex(componentMetas, function(compMeta, index) { + var templateId = compMeta.type.moduleUrl + "|" + compMeta.type.name; + var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; + var compiledTemplateExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledComponentTemplate('" + templateId + "'," + templateArguments[index].join(',') + ")"; + var variableValueExpr; + if (compMeta.type.isHost) { + variableValueExpr = constructionKeyword + " " + command_compiler_2.TEMPLATE_COMMANDS_MODULE_REF + "CompiledHostTemplate(" + compiledTemplateExpr + ")"; + } else { + variableValueExpr = compiledTemplateExpr; + } + var varName = templateVariableName(compMeta.type); + declarations.push("" + util_1.codeGenExportVariable(varName) + variableValueExpr + ";"); + declarations.push(util_1.codeGenValueFn([], varName, templateGetterName(compMeta.type)) + ";"); + }); + var moduleUrl = components[0].component.type.moduleUrl; + return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); + }; + TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { + return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); + }; + TemplateCompiler.prototype._processTemplateCodeGen = function(compMeta, directives, targetDeclarations, targetTemplateArguments) { + var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); + var parsedTemplate = this._templateParser.parse(compMeta.template.template, directives, compMeta.type.name); + var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); + var commandsExpr = this._commandCompiler.compileComponentCodeGen(compMeta, parsedTemplate, changeDetectorsExprs.expressions, codeGenComponentTemplateFactory); + addAll(styleExpr.declarations, targetDeclarations); + addAll(changeDetectorsExprs.declarations, targetDeclarations); + addAll(commandsExpr.declarations, targetDeclarations); + targetTemplateArguments.push([changeDetectorsExprs.expressions[0], commandsExpr.expression, styleExpr.expression]); + }; + TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler])], TemplateCompiler); + return TemplateCompiler; + })(); + exports.TemplateCompiler = TemplateCompiler; + var NormalizedComponentWithViewDirectives = (function() { + function NormalizedComponentWithViewDirectives(component, directives) { + this.component = component; + this.directives = directives; + } + return NormalizedComponentWithViewDirectives; + })(); + exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; + function assertComponent(meta) { + if (!meta.isComponent) { + throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); + } + } + function templateVariableName(type) { + return type.name + "Template"; + } + function templateGetterName(type) { + return templateVariableName(type) + "Getter"; + } + function templateModuleUrl(moduleUrl) { + var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); + return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; + } + function addAll(source, target) { + for (var i = 0; i < source.length; i++) { + target.push(source[i]); + } + } + function codeGenComponentTemplateFactory(nestedCompType) { + return "" + source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + templateGetterName(nestedCompType.type); + } + global.define = __define; + return module.exports; +}); + +System.register("parse5/lib/tree_construction/parser", ["parse5/lib/tokenization/tokenizer", "parse5/lib/tree_construction/open_element_stack", "parse5/lib/tree_construction/formatting_element_list", "parse5/lib/tree_construction/doctype", "parse5/lib/tree_adapters/default", "parse5/lib/common/foreign_content", "parse5/lib/common/unicode", "parse5/lib/common/html"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + var Tokenizer = require("parse5/lib/tokenization/tokenizer"), + OpenElementStack = require("parse5/lib/tree_construction/open_element_stack"), + FormattingElementList = require("parse5/lib/tree_construction/formatting_element_list"), + Doctype = require("parse5/lib/tree_construction/doctype"), + DefaultTreeAdapter = require("parse5/lib/tree_adapters/default"), + ForeignContent = require("parse5/lib/common/foreign_content"), + UNICODE = require("parse5/lib/common/unicode"), + HTML = require("parse5/lib/common/html"); + var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES, + ATTRS = HTML.ATTRS; + var SEARCHABLE_INDEX_DEFAULT_PROMPT = 'This is a searchable index. Enter search keywords: ', + SEARCHABLE_INDEX_INPUT_NAME = 'isindex', + HIDDEN_INPUT_TYPE = 'hidden'; + var AA_OUTER_LOOP_ITER = 8, + AA_INNER_LOOP_ITER = 3; + var INITIAL_MODE = 'INITIAL_MODE', + BEFORE_HTML_MODE = 'BEFORE_HTML_MODE', + BEFORE_HEAD_MODE = 'BEFORE_HEAD_MODE', + IN_HEAD_MODE = 'IN_HEAD_MODE', + AFTER_HEAD_MODE = 'AFTER_HEAD_MODE', + IN_BODY_MODE = 'IN_BODY_MODE', + TEXT_MODE = 'TEXT_MODE', + IN_TABLE_MODE = 'IN_TABLE_MODE', + IN_TABLE_TEXT_MODE = 'IN_TABLE_TEXT_MODE', + IN_CAPTION_MODE = 'IN_CAPTION_MODE', + IN_COLUMN_GROUP_MODE = 'IN_COLUMN_GROUP_MODE', + IN_TABLE_BODY_MODE = 'IN_TABLE_BODY_MODE', + IN_ROW_MODE = 'IN_ROW_MODE', + IN_CELL_MODE = 'IN_CELL_MODE', + IN_SELECT_MODE = 'IN_SELECT_MODE', + IN_SELECT_IN_TABLE_MODE = 'IN_SELECT_IN_TABLE_MODE', + IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE', + AFTER_BODY_MODE = 'AFTER_BODY_MODE', + IN_FRAMESET_MODE = 'IN_FRAMESET_MODE', + AFTER_FRAMESET_MODE = 'AFTER_FRAMESET_MODE', + AFTER_AFTER_BODY_MODE = 'AFTER_AFTER_BODY_MODE', + AFTER_AFTER_FRAMESET_MODE = 'AFTER_AFTER_FRAMESET_MODE'; + var INSERTION_MODE_RESET_MAP = {}; + INSERTION_MODE_RESET_MAP[$.TR] = IN_ROW_MODE; + INSERTION_MODE_RESET_MAP[$.TBODY] = INSERTION_MODE_RESET_MAP[$.THEAD] = INSERTION_MODE_RESET_MAP[$.TFOOT] = IN_TABLE_BODY_MODE; + INSERTION_MODE_RESET_MAP[$.CAPTION] = IN_CAPTION_MODE; + INSERTION_MODE_RESET_MAP[$.COLGROUP] = IN_COLUMN_GROUP_MODE; + INSERTION_MODE_RESET_MAP[$.TABLE] = IN_TABLE_MODE; + INSERTION_MODE_RESET_MAP[$.BODY] = IN_BODY_MODE; + INSERTION_MODE_RESET_MAP[$.FRAMESET] = IN_FRAMESET_MODE; + var TEMPLATE_INSERTION_MODE_SWITCH_MAP = {}; + TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD] = IN_TABLE_MODE; + TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL] = IN_COLUMN_GROUP_MODE; + TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR] = IN_TABLE_BODY_MODE; + TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH] = IN_ROW_MODE; + var _ = {}; + _[INITIAL_MODE] = {}; + _[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN] = _[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInInitialMode; + _[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; + _[INITIAL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN] = doctypeInInitialMode; + _[INITIAL_MODE][Tokenizer.START_TAG_TOKEN] = _[INITIAL_MODE][Tokenizer.END_TAG_TOKEN] = _[INITIAL_MODE][Tokenizer.EOF_TOKEN] = tokenInInitialMode; + _[BEFORE_HTML_MODE] = {}; + _[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN] = _[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHtml; + _[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; + _[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHtml; + _[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHtml; + _[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHtml; + _[BEFORE_HEAD_MODE] = {}; + _[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHead; + _[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; + _[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHead; + _[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHead; + _[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHead; + _[IN_HEAD_MODE] = {}; + _[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInHead; + _[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagInHead; + _[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagInHead; + _[IN_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenInHead; + _[AFTER_HEAD_MODE] = {}; + _[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterHead; + _[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterHead; + _[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterHead; + _[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenAfterHead; + _[IN_BODY_MODE] = {}; + _[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; + _[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInBody; + _[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInBody; + _[IN_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[TEXT_MODE] = {}; + _[TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = _[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[TEXT_MODE][Tokenizer.COMMENT_TOKEN] = _[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = _[TEXT_MODE][Tokenizer.START_TAG_TOKEN] = ignoreToken; + _[TEXT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInText; + _[TEXT_MODE][Tokenizer.EOF_TOKEN] = eofInText; + _[IN_TABLE_MODE] = {}; + _[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; + _[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTable; + _[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTable; + _[IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_TABLE_TEXT_MODE] = {}; + _[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = characterInTableText; + _[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInTableText; + _[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN] = tokenInTableText; + _[IN_CAPTION_MODE] = {}; + _[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; + _[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCaption; + _[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCaption; + _[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_COLUMN_GROUP_MODE] = {}; + _[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInColumnGroup; + _[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN] = startTagInColumnGroup; + _[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN] = endTagInColumnGroup; + _[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_TABLE_BODY_MODE] = {}; + _[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; + _[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTableBody; + _[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTableBody; + _[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_ROW_MODE] = {}; + _[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; + _[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN] = startTagInRow; + _[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN] = endTagInRow; + _[IN_ROW_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_CELL_MODE] = {}; + _[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; + _[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCell; + _[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCell; + _[IN_CELL_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_SELECT_MODE] = {}; + _[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; + _[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelect; + _[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelect; + _[IN_SELECT_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_SELECT_IN_TABLE_MODE] = {}; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelectInTable; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelectInTable; + _[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + _[IN_TEMPLATE_MODE] = {}; + _[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; + _[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTemplate; + _[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTemplate; + _[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN] = eofInTemplate; + _[AFTER_BODY_MODE] = {}; + _[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterBody; + _[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToRootHtmlElement; + _[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterBody; + _[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterBody; + _[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + _[IN_FRAMESET_MODE] = {}; + _[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagInFrameset; + _[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagInFrameset; + _[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + _[AFTER_FRAMESET_MODE] = {}; + _[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; + _[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; + _[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterFrameset; + _[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterFrameset; + _[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + _[AFTER_AFTER_BODY_MODE] = {}; + _[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = tokenAfterAfterBody; + _[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterAfterBody; + _[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; + _[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterBody; + _[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = tokenAfterAfterBody; + _[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + _[AFTER_AFTER_FRAMESET_MODE] = {}; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterFrameset; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = ignoreToken; + _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + function getSearchableIndexFormAttrs(isindexStartTagToken) { + var indexAction = Tokenizer.getTokenAttr(isindexStartTagToken, ATTRS.ACTION), + attrs = []; + if (indexAction !== null) { + attrs.push({ + name: ATTRS.ACTION, + value: indexAction + }); + } + return attrs; + } + function getSearchableIndexLabelText(isindexStartTagToken) { + var indexPrompt = Tokenizer.getTokenAttr(isindexStartTagToken, ATTRS.PROMPT); + return indexPrompt === null ? SEARCHABLE_INDEX_DEFAULT_PROMPT : indexPrompt; + } + function getSearchableIndexInputAttrs(isindexStartTagToken) { + var isindexAttrs = isindexStartTagToken.attrs, + inputAttrs = []; + for (var i = 0; i < isindexAttrs.length; i++) { + var name = isindexAttrs[i].name; + if (name !== ATTRS.NAME && name !== ATTRS.ACTION && name !== ATTRS.PROMPT) + inputAttrs.push(isindexAttrs[i]); + } + inputAttrs.push({ + name: ATTRS.NAME, + value: SEARCHABLE_INDEX_INPUT_NAME + }); + return inputAttrs; + } + var Parser = module.exports = function(treeAdapter) { + this.treeAdapter = treeAdapter || DefaultTreeAdapter; + this.scriptHandler = null; + }; + Parser.prototype.parse = function(html) { + var document = this.treeAdapter.createDocument(); + this._reset(html, document, null); + this._runParsingLoop(); + return document; + }; + Parser.prototype.parseFragment = function(html, fragmentContext) { + if (!fragmentContext) + fragmentContext = this.treeAdapter.createElement($.TEMPLATE, NS.HTML, []); + var documentMock = this.treeAdapter.createElement('documentmock', NS.HTML, []); + this._reset(html, documentMock, fragmentContext); + if (this.treeAdapter.getTagName(fragmentContext) === $.TEMPLATE) + this._pushTmplInsertionMode(IN_TEMPLATE_MODE); + this._initTokenizerForFragmentParsing(); + this._insertFakeRootElement(); + this._resetInsertionMode(); + this._findFormInFragmentContext(); + this._runParsingLoop(); + var rootElement = this.treeAdapter.getFirstChild(documentMock), + fragment = this.treeAdapter.createDocumentFragment(); + this._adoptNodes(rootElement, fragment); + return fragment; + }; + Parser.prototype._reset = function(html, document, fragmentContext) { + this.tokenizer = new Tokenizer(html); + this.stopped = false; + this.insertionMode = INITIAL_MODE; + this.originalInsertionMode = ''; + this.document = document; + this.fragmentContext = fragmentContext; + this.headElement = null; + this.formElement = null; + this.openElements = new OpenElementStack(this.document, this.treeAdapter); + this.activeFormattingElements = new FormattingElementList(this.treeAdapter); + this.tmplInsertionModeStack = []; + this.tmplInsertionModeStackTop = -1; + this.currentTmplInsertionMode = null; + this.pendingCharacterTokens = []; + this.hasNonWhitespacePendingCharacterToken = false; + this.framesetOk = true; + this.skipNextNewLine = false; + this.fosterParentingEnabled = false; + }; + Parser.prototype._iterateParsingLoop = function() { + this._setupTokenizerCDATAMode(); + var token = this.tokenizer.getNextToken(); + if (this.skipNextNewLine) { + this.skipNextNewLine = false; + if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') { + if (token.chars.length === 1) + return ; + token.chars = token.chars.substr(1); + } + } + if (this._shouldProcessTokenInForeignContent(token)) + this._processTokenInForeignContent(token); + else + this._processToken(token); + }; + Parser.prototype._runParsingLoop = function() { + while (!this.stopped) + this._iterateParsingLoop(); + }; + Parser.prototype._setupTokenizerCDATAMode = function() { + var current = this._getAdjustedCurrentElement(); + this.tokenizer.allowCDATA = current && current !== this.document && this.treeAdapter.getNamespaceURI(current) !== NS.HTML && (!this._isHtmlIntegrationPoint(current)) && (!this._isMathMLTextIntegrationPoint(current)); + }; + Parser.prototype._switchToTextParsing = function(currentToken, nextTokenizerState) { + this._insertElement(currentToken, NS.HTML); + this.tokenizer.state = nextTokenizerState; + this.originalInsertionMode = this.insertionMode; + this.insertionMode = TEXT_MODE; + }; + Parser.prototype._getAdjustedCurrentElement = function() { + return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current; + }; + Parser.prototype._findFormInFragmentContext = function() { + var node = this.fragmentContext; + do { + if (this.treeAdapter.getTagName(node) === $.FORM) { + this.formElement = node; + break; + } + node = this.treeAdapter.getParentNode(node); + } while (node); + }; + Parser.prototype._initTokenizerForFragmentParsing = function() { + var tn = this.treeAdapter.getTagName(this.fragmentContext); + if (tn === $.TITLE || tn === $.TEXTAREA) + this.tokenizer.state = Tokenizer.RCDATA_STATE; + else if (tn === $.STYLE || tn === $.XMP || tn === $.IFRAME || tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) { + this.tokenizer.state = Tokenizer.RAWTEXT_STATE; + } else if (tn === $.SCRIPT) + this.tokenizer.state = Tokenizer.SCRIPT_DATA_STATE; + else if (tn === $.PLAINTEXT) + this.tokenizer.state = Tokenizer.PLAINTEXT_STATE; + }; + Parser.prototype._setDocumentType = function(token) { + this.treeAdapter.setDocumentType(this.document, token.name, token.publicId, token.systemId); + }; + Parser.prototype._attachElementToTree = function(element) { + if (this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current)) + this._fosterParentElement(element); + else { + var parent = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.appendChild(parent, element); + } + }; + Parser.prototype._appendElement = function(token, namespaceURI) { + var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element); + }; + Parser.prototype._insertElement = function(token, namespaceURI) { + var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element); + this.openElements.push(element); + }; + Parser.prototype._insertTemplate = function(token) { + var tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs), + content = this.treeAdapter.createDocumentFragment(); + this.treeAdapter.appendChild(tmpl, content); + this._attachElementToTree(tmpl); + this.openElements.push(tmpl); + }; + Parser.prototype._insertFakeRootElement = function() { + var element = this.treeAdapter.createElement($.HTML, NS.HTML, []); + this.treeAdapter.appendChild(this.openElements.current, element); + this.openElements.push(element); + }; + Parser.prototype._appendCommentNode = function(token, parent) { + var commentNode = this.treeAdapter.createCommentNode(token.data); + this.treeAdapter.appendChild(parent, commentNode); + }; + Parser.prototype._insertCharacters = function(token) { + if (this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current)) + this._fosterParentText(token.chars); + else { + var parent = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.insertText(parent, token.chars); + } + }; + Parser.prototype._adoptNodes = function(donor, recipient) { + while (true) { + var child = this.treeAdapter.getFirstChild(donor); + if (!child) + break; + this.treeAdapter.detachNode(child); + this.treeAdapter.appendChild(recipient, child); + } + }; + Parser.prototype._shouldProcessTokenInForeignContent = function(token) { + var current = this._getAdjustedCurrentElement(); + if (!current || current === this.document) + return false; + var ns = this.treeAdapter.getNamespaceURI(current); + if (ns === NS.HTML) + return false; + if (this.treeAdapter.getTagName(current) === $.ANNOTATION_XML && ns === NS.MATHML && token.type === Tokenizer.START_TAG_TOKEN && token.tagName === $.SVG) { + return false; + } + var isCharacterToken = token.type === Tokenizer.CHARACTER_TOKEN || token.type === Tokenizer.NULL_CHARACTER_TOKEN || token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN, + isMathMLTextStartTag = token.type === Tokenizer.START_TAG_TOKEN && token.tagName !== $.MGLYPH && token.tagName !== $.MALIGNMARK; + if ((isMathMLTextStartTag || isCharacterToken) && this._isMathMLTextIntegrationPoint(current)) + return false; + if ((token.type === Tokenizer.START_TAG_TOKEN || isCharacterToken) && this._isHtmlIntegrationPoint(current)) + return false; + return token.type !== Tokenizer.EOF_TOKEN; + }; + Parser.prototype._processToken = function(token) { + _[this.insertionMode][token.type](this, token); + }; + Parser.prototype._processTokenInBodyMode = function(token) { + _[IN_BODY_MODE][token.type](this, token); + }; + Parser.prototype._processTokenInForeignContent = function(token) { + if (token.type === Tokenizer.CHARACTER_TOKEN) + characterInForeignContent(this, token); + else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN) + nullCharacterInForeignContent(this, token); + else if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN) + insertCharacters(this, token); + else if (token.type === Tokenizer.COMMENT_TOKEN) + appendComment(this, token); + else if (token.type === Tokenizer.START_TAG_TOKEN) + startTagInForeignContent(this, token); + else if (token.type === Tokenizer.END_TAG_TOKEN) + endTagInForeignContent(this, token); + }; + Parser.prototype._processFakeStartTagWithAttrs = function(tagName, attrs) { + var fakeToken = this.tokenizer.buildStartTagToken(tagName); + fakeToken.attrs = attrs; + this._processToken(fakeToken); + }; + Parser.prototype._processFakeStartTag = function(tagName) { + var fakeToken = this.tokenizer.buildStartTagToken(tagName); + this._processToken(fakeToken); + return fakeToken; + }; + Parser.prototype._processFakeEndTag = function(tagName) { + var fakeToken = this.tokenizer.buildEndTagToken(tagName); + this._processToken(fakeToken); + return fakeToken; + }; + Parser.prototype._isMathMLTextIntegrationPoint = function(element) { + var tn = this.treeAdapter.getTagName(element), + ns = this.treeAdapter.getNamespaceURI(element); + return ForeignContent.isMathMLTextIntegrationPoint(tn, ns); + }; + Parser.prototype._isHtmlIntegrationPoint = function(element) { + var tn = this.treeAdapter.getTagName(element), + ns = this.treeAdapter.getNamespaceURI(element), + attrs = this.treeAdapter.getAttrList(element); + return ForeignContent.isHtmlIntegrationPoint(tn, ns, attrs); + }; + Parser.prototype._reconstructActiveFormattingElements = function() { + var listLength = this.activeFormattingElements.length; + if (listLength) { + var unopenIdx = listLength, + entry = null; + do { + unopenIdx--; + entry = this.activeFormattingElements.entries[unopenIdx]; + if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) { + unopenIdx++; + break; + } + } while (unopenIdx > 0); + for (var i = unopenIdx; i < listLength; i++) { + entry = this.activeFormattingElements.entries[i]; + this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); + entry.element = this.openElements.current; + } + } + }; + Parser.prototype._closeTableCell = function() { + if (this.openElements.hasInTableScope($.TD)) + this._processFakeEndTag($.TD); + else + this._processFakeEndTag($.TH); + }; + Parser.prototype._closePElement = function() { + this.openElements.generateImpliedEndTagsWithExclusion($.P); + this.openElements.popUntilTagNamePopped($.P); + }; + Parser.prototype._resetInsertionMode = function() { + for (var i = this.openElements.stackTop, + last = false; i >= 0; i--) { + var element = this.openElements.items[i]; + if (i === 0) { + last = true; + if (this.fragmentContext) + element = this.fragmentContext; + } + var tn = this.treeAdapter.getTagName(element), + newInsertionMode = INSERTION_MODE_RESET_MAP[tn]; + if (newInsertionMode) { + this.insertionMode = newInsertionMode; + break; + } else if (!last && (tn === $.TD || tn === $.TH)) { + this.insertionMode = IN_CELL_MODE; + break; + } else if (!last && tn === $.HEAD) { + this.insertionMode = IN_HEAD_MODE; + break; + } else if (tn === $.SELECT) { + this._resetInsertionModeForSelect(i); + break; + } else if (tn === $.TEMPLATE) { + this.insertionMode = this.currentTmplInsertionMode; + break; + } else if (tn === $.HTML) { + this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE; + break; + } else if (last) { + this.insertionMode = IN_BODY_MODE; + break; + } + } + }; + Parser.prototype._resetInsertionModeForSelect = function(selectIdx) { + if (selectIdx > 0) { + for (var i = selectIdx - 1; i > 0; i--) { + var ancestor = this.openElements.items[i], + tn = this.treeAdapter.getTagName(ancestor); + if (tn === $.TEMPLATE) + break; + else if (tn === $.TABLE) { + this.insertionMode = IN_SELECT_IN_TABLE_MODE; + return ; + } + } + } + this.insertionMode = IN_SELECT_MODE; + }; + Parser.prototype._pushTmplInsertionMode = function(mode) { + this.tmplInsertionModeStack.push(mode); + this.tmplInsertionModeStackTop++; + this.currentTmplInsertionMode = mode; + }; + Parser.prototype._popTmplInsertionMode = function() { + this.tmplInsertionModeStack.pop(); + this.tmplInsertionModeStackTop--; + this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]; + }; + Parser.prototype._isElementCausesFosterParenting = function(element) { + var tn = this.treeAdapter.getTagName(element); + return tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn == $.THEAD || tn === $.TR; + }; + Parser.prototype._findFosterParentingLocation = function() { + var location = { + parent: null, + beforeElement: null + }; + for (var i = this.openElements.stackTop; i >= 0; i--) { + var openElement = this.openElements.items[i], + tn = this.treeAdapter.getTagName(openElement), + ns = this.treeAdapter.getNamespaceURI(openElement); + if (tn === $.TEMPLATE && ns === NS.HTML) { + location.parent = this.treeAdapter.getChildNodes(openElement)[0]; + break; + } else if (tn === $.TABLE) { + location.parent = this.treeAdapter.getParentNode(openElement); + if (location.parent) + location.beforeElement = openElement; + else + location.parent = this.openElements.items[i - 1]; + break; + } + } + if (!location.parent) + location.parent = this.openElements.items[0]; + return location; + }; + Parser.prototype._fosterParentElement = function(element) { + var location = this._findFosterParentingLocation(); + if (location.beforeElement) + this.treeAdapter.insertBefore(location.parent, element, location.beforeElement); + else + this.treeAdapter.appendChild(location.parent, element); + }; + Parser.prototype._fosterParentText = function(chars) { + var location = this._findFosterParentingLocation(); + if (location.beforeElement) + this.treeAdapter.insertTextBefore(location.parent, chars, location.beforeElement); + else + this.treeAdapter.insertText(location.parent, chars); + }; + Parser.prototype._isSpecialElement = function(element) { + var tn = this.treeAdapter.getTagName(element), + ns = this.treeAdapter.getNamespaceURI(element); + return HTML.SPECIAL_ELEMENTS[ns][tn]; + }; + function aaObtainFormattingElementEntry(p, token) { + var formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName); + if (formattingElementEntry) { + if (!p.openElements.contains(formattingElementEntry.element)) { + p.activeFormattingElements.removeEntry(formattingElementEntry); + formattingElementEntry = null; + } else if (!p.openElements.hasInScope(token.tagName)) + formattingElementEntry = null; + } else + genericEndTagInBody(p, token); + return formattingElementEntry; + } + function aaObtainFurthestBlock(p, formattingElementEntry) { + var furthestBlock = null; + for (var i = p.openElements.stackTop; i >= 0; i--) { + var element = p.openElements.items[i]; + if (element === formattingElementEntry.element) + break; + if (p._isSpecialElement(element)) + furthestBlock = element; + } + if (!furthestBlock) { + p.openElements.popUntilElementPopped(formattingElementEntry.element); + p.activeFormattingElements.removeEntry(formattingElementEntry); + } + return furthestBlock; + } + function aaInnerLoop(p, furthestBlock, formattingElement) { + var element = null, + lastElement = furthestBlock, + nextElement = p.openElements.getCommonAncestor(furthestBlock); + for (var i = 0; i < AA_INNER_LOOP_ITER; i++) { + element = nextElement; + nextElement = p.openElements.getCommonAncestor(element); + var elementEntry = p.activeFormattingElements.getElementEntry(element); + if (!elementEntry) { + p.openElements.remove(element); + continue; + } + if (element === formattingElement) + break; + element = aaRecreateElementFromEntry(p, elementEntry); + if (lastElement === furthestBlock) + p.activeFormattingElements.bookmark = elementEntry; + p.treeAdapter.detachNode(lastElement); + p.treeAdapter.appendChild(element, lastElement); + lastElement = element; + } + return lastElement; + } + function aaRecreateElementFromEntry(p, elementEntry) { + var ns = p.treeAdapter.getNamespaceURI(elementEntry.element), + newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs); + p.openElements.replace(elementEntry.element, newElement); + elementEntry.element = newElement; + return newElement; + } + function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) { + if (p._isElementCausesFosterParenting(commonAncestor)) + p._fosterParentElement(lastElement); + else { + var tn = p.treeAdapter.getTagName(commonAncestor), + ns = p.treeAdapter.getNamespaceURI(commonAncestor); + if (tn === $.TEMPLATE && ns === NS.HTML) + commonAncestor = p.treeAdapter.getChildNodes(commonAncestor)[0]; + p.treeAdapter.appendChild(commonAncestor, lastElement); + } + } + function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) { + var ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element), + token = formattingElementEntry.token, + newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs); + p._adoptNodes(furthestBlock, newElement); + p.treeAdapter.appendChild(furthestBlock, newElement); + p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token); + p.activeFormattingElements.removeEntry(formattingElementEntry); + p.openElements.remove(formattingElementEntry.element); + p.openElements.insertAfter(furthestBlock, newElement); + } + function callAdoptionAgency(p, token) { + for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) { + var formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry); + if (!formattingElementEntry) + break; + var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry); + if (!furthestBlock) + break; + p.activeFormattingElements.bookmark = formattingElementEntry; + var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element), + commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element); + p.treeAdapter.detachNode(lastElement); + aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement); + aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry); + } + } + function ignoreToken(p, token) {} + function appendComment(p, token) { + p._appendCommentNode(token, p.openElements.currentTmplContent || p.openElements.current); + } + function appendCommentToRootHtmlElement(p, token) { + p._appendCommentNode(token, p.openElements.items[0]); + } + function appendCommentToDocument(p, token) { + p._appendCommentNode(token, p.document); + } + function insertCharacters(p, token) { + p._insertCharacters(token); + } + function stopParsing(p, token) { + p.stopped = true; + } + function doctypeInInitialMode(p, token) { + p._setDocumentType(token); + if (token.forceQuirks || Doctype.isQuirks(token.name, token.publicId, token.systemId)) + p.treeAdapter.setQuirksMode(p.document); + p.insertionMode = BEFORE_HTML_MODE; + } + function tokenInInitialMode(p, token) { + p.treeAdapter.setQuirksMode(p.document); + p.insertionMode = BEFORE_HTML_MODE; + p._processToken(token); + } + function startTagBeforeHtml(p, token) { + if (token.tagName === $.HTML) { + p._insertElement(token, NS.HTML); + p.insertionMode = BEFORE_HEAD_MODE; + } else + tokenBeforeHtml(p, token); + } + function endTagBeforeHtml(p, token) { + var tn = token.tagName; + if (tn === $.HTML || tn === $.HEAD || tn === $.BODY || tn === $.BR) + tokenBeforeHtml(p, token); + } + function tokenBeforeHtml(p, token) { + p._insertFakeRootElement(); + p.insertionMode = BEFORE_HEAD_MODE; + p._processToken(token); + } + function startTagBeforeHead(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.HEAD) { + p._insertElement(token, NS.HTML); + p.headElement = p.openElements.current; + p.insertionMode = IN_HEAD_MODE; + } else + tokenBeforeHead(p, token); + } + function endTagBeforeHead(p, token) { + var tn = token.tagName; + if (tn === $.HEAD || tn === $.BODY || tn === $.HTML || tn === $.BR) + tokenBeforeHead(p, token); + } + function tokenBeforeHead(p, token) { + p._processFakeStartTag($.HEAD); + p._processToken(token); + } + function startTagInHead(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.COMMAND || tn === $.LINK || tn === $.META) { + p._appendElement(token, NS.HTML); + } else if (tn === $.TITLE) + p._switchToTextParsing(token, Tokenizer.RCDATA_STATE); + else if (tn === $.NOSCRIPT || tn === $.NOFRAMES || tn === $.STYLE) + p._switchToTextParsing(token, Tokenizer.RAWTEXT_STATE); + else if (tn === $.SCRIPT) { + p._insertElement(token, NS.HTML); + p.tokenizer.state = Tokenizer.SCRIPT_DATA_STATE; + p.originalInsertionMode = p.insertionMode; + p.insertionMode = TEXT_MODE; + } else if (tn === $.TEMPLATE) { + p._insertTemplate(token, NS.HTML); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; + p.insertionMode = IN_TEMPLATE_MODE; + p._pushTmplInsertionMode(IN_TEMPLATE_MODE); + } else if (tn !== $.HEAD) + tokenInHead(p, token); + } + function endTagInHead(p, token) { + var tn = token.tagName; + if (tn === $.HEAD) { + p.openElements.pop(); + p.insertionMode = AFTER_HEAD_MODE; + } else if (tn === $.BODY || tn === $.BR || tn === $.HTML) + tokenInHead(p, token); + else if (tn === $.TEMPLATE && p.openElements.tmplCount > 0) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTemplatePopped(); + p.activeFormattingElements.clearToLastMarker(); + p._popTmplInsertionMode(); + p._resetInsertionMode(); + } + } + function tokenInHead(p, token) { + p._processFakeEndTag($.HEAD); + p._processToken(token); + } + function startTagAfterHead(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.BODY) { + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = IN_BODY_MODE; + } else if (tn === $.FRAMESET) { + p._insertElement(token, NS.HTML); + p.insertionMode = IN_FRAMESET_MODE; + } else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { + p.openElements.push(p.headElement); + startTagInHead(p, token); + p.openElements.remove(p.headElement); + } else if (tn !== $.HEAD) + tokenAfterHead(p, token); + } + function endTagAfterHead(p, token) { + var tn = token.tagName; + if (tn === $.BODY || tn === $.HTML || tn === $.BR) + tokenAfterHead(p, token); + else if (tn === $.TEMPLATE) + endTagInHead(p, token); + } + function tokenAfterHead(p, token) { + p._processFakeStartTag($.BODY); + p.framesetOk = true; + p._processToken(token); + } + function whitespaceCharacterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); + } + function characterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); + p.framesetOk = false; + } + function htmlStartTagInBody(p, token) { + if (p.openElements.tmplCount === 0) + p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs); + } + function bodyStartTagInBody(p, token) { + var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (bodyElement && p.openElements.tmplCount === 0) { + p.framesetOk = false; + p.treeAdapter.adoptAttributes(bodyElement, token.attrs); + } + } + function framesetStartTagInBody(p, token) { + var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (p.framesetOk && bodyElement) { + p.treeAdapter.detachNode(bodyElement); + p.openElements.popAllUpToHtmlElement(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_FRAMESET_MODE; + } + } + function addressStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + } + function numberedHeaderStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + var tn = p.openElements.currentTagName; + if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) + p.openElements.pop(); + p._insertElement(token, NS.HTML); + } + function preStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + p.skipNextNewLine = true; + p.framesetOk = false; + } + function formStartTagInBody(p, token) { + var inTemplate = p.openElements.tmplCount > 0; + if (!p.formElement || inTemplate) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + if (!inTemplate) + p.formElement = p.openElements.current; + } + } + function listItemStartTagInBody(p, token) { + p.framesetOk = false; + for (var i = p.openElements.stackTop; i >= 0; i--) { + var element = p.openElements.items[i], + tn = p.treeAdapter.getTagName(element); + if ((token.tagName === $.LI && tn === $.LI) || ((token.tagName === $.DD || token.tagName === $.DT) && (tn === $.DD || tn == $.DT))) { + p._processFakeEndTag(tn); + break; + } + if (tn !== $.ADDRESS && tn !== $.DIV && tn !== $.P && p._isSpecialElement(element)) + break; + } + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + } + function plaintextStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + p.tokenizer.state = Tokenizer.PLAINTEXT_STATE; + } + function buttonStartTagInBody(p, token) { + if (p.openElements.hasInScope($.BUTTON)) { + p._processFakeEndTag($.BUTTON); + buttonStartTagInBody(p, token); + } else { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + } + } + function aStartTagInBody(p, token) { + var activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($.A); + if (activeElementEntry) { + p._processFakeEndTag($.A); + p.openElements.remove(activeElementEntry.element); + p.activeFormattingElements.removeEntry(activeElementEntry); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function bStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function nobrStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + if (p.openElements.hasInScope($.NOBR)) { + p._processFakeEndTag($.NOBR); + p._reconstructActiveFormattingElements(); + } + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function appletStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; + } + function tableStartTagInBody(p, token) { + if (!p.treeAdapter.isQuirksMode(p.document) && p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = IN_TABLE_MODE; + } + function areaStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + p.framesetOk = false; + } + function inputStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); + if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE) + p.framesetOk = false; + } + function paramStartTagInBody(p, token) { + p._appendElement(token, NS.HTML); + } + function hrStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._appendElement(token, NS.HTML); + p.framesetOk = false; + } + function imageStartTagInBody(p, token) { + token.tagName = $.IMG; + areaStartTagInBody(p, token); + } + function isindexStartTagInBody(p, token) { + if (!p.formElement || p.openElements.tmplCount > 0) { + p._processFakeStartTagWithAttrs($.FORM, getSearchableIndexFormAttrs(token)); + p._processFakeStartTag($.HR); + p._processFakeStartTag($.LABEL); + p.treeAdapter.insertText(p.openElements.current, getSearchableIndexLabelText(token)); + p._processFakeStartTagWithAttrs($.INPUT, getSearchableIndexInputAttrs(token)); + p._processFakeEndTag($.LABEL); + p._processFakeStartTag($.HR); + p._processFakeEndTag($.FORM); + } + } + function textareaStartTagInBody(p, token) { + p._insertElement(token, NS.HTML); + p.skipNextNewLine = true; + p.tokenizer.state = Tokenizer.RCDATA_STATE; + p.originalInsertionMode = p.insertionMode; + p.framesetOk = false; + p.insertionMode = TEXT_MODE; + } + function xmpStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) + p._closePElement(); + p._reconstructActiveFormattingElements(); + p.framesetOk = false; + p._switchToTextParsing(token, Tokenizer.RAWTEXT_STATE); + } + function iframeStartTagInBody(p, token) { + p.framesetOk = false; + p._switchToTextParsing(token, Tokenizer.RAWTEXT_STATE); + } + function noembedStartTagInBody(p, token) { + p._switchToTextParsing(token, Tokenizer.RAWTEXT_STATE); + } + function selectStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + if (p.insertionMode === IN_TABLE_MODE || p.insertionMode === IN_CAPTION_MODE || p.insertionMode === IN_TABLE_BODY_MODE || p.insertionMode === IN_ROW_MODE || p.insertionMode === IN_CELL_MODE) { + p.insertionMode = IN_SELECT_IN_TABLE_MODE; + } else + p.insertionMode = IN_SELECT_MODE; + } + function optgroupStartTagInBody(p, token) { + if (p.openElements.currentTagName === $.OPTION) + p._processFakeEndTag($.OPTION); + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + } + function rpStartTagInBody(p, token) { + if (p.openElements.hasInScope($.RUBY)) + p.openElements.generateImpliedEndTags(); + p._insertElement(token, NS.HTML); + } + function menuitemStartTagInBody(p, token) { + p._appendElement(token, NS.HTML); + } + function mathStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + ForeignContent.adjustTokenMathMLAttrs(token); + ForeignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) + p._appendElement(token, NS.MATHML); + else + p._insertElement(token, NS.MATHML); + } + function svgStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + ForeignContent.adjustTokenSVGAttrs(token); + ForeignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) + p._appendElement(token, NS.SVG); + else + p._insertElement(token, NS.SVG); + } + function genericStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + } + function startTagInBody(p, token) { + var tn = token.tagName; + switch (tn.length) { + case 1: + if (tn === $.I || tn === $.S || tn === $.B || tn === $.U) + bStartTagInBody(p, token); + else if (tn === $.P) + addressStartTagInBody(p, token); + else if (tn === $.A) + aStartTagInBody(p, token); + else + genericStartTagInBody(p, token); + break; + case 2: + if (tn === $.DL || tn === $.OL || tn === $.UL) + addressStartTagInBody(p, token); + else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) + numberedHeaderStartTagInBody(p, token); + else if (tn === $.LI || tn === $.DD || tn === $.DT) + listItemStartTagInBody(p, token); + else if (tn === $.EM || tn === $.TT) + bStartTagInBody(p, token); + else if (tn === $.BR) + areaStartTagInBody(p, token); + else if (tn === $.HR) + hrStartTagInBody(p, token); + else if (tn === $.RP || tn === $.RT) + rpStartTagInBody(p, token); + else if (tn !== $.TH && tn !== $.TD && tn !== $.TR) + genericStartTagInBody(p, token); + break; + case 3: + if (tn === $.DIV || tn === $.DIR || tn === $.NAV) + addressStartTagInBody(p, token); + else if (tn === $.PRE) + preStartTagInBody(p, token); + else if (tn === $.BIG) + bStartTagInBody(p, token); + else if (tn === $.IMG || tn === $.WBR) + areaStartTagInBody(p, token); + else if (tn === $.XMP) + xmpStartTagInBody(p, token); + else if (tn === $.SVG) + svgStartTagInBody(p, token); + else if (tn !== $.COL) + genericStartTagInBody(p, token); + break; + case 4: + if (tn === $.HTML) + htmlStartTagInBody(p, token); + else if (tn === $.BASE || tn === $.LINK || tn === $.META) + startTagInHead(p, token); + else if (tn === $.BODY) + bodyStartTagInBody(p, token); + else if (tn === $.MAIN || tn === $.MENU) + addressStartTagInBody(p, token); + else if (tn === $.FORM) + formStartTagInBody(p, token); + else if (tn === $.CODE || tn === $.FONT) + bStartTagInBody(p, token); + else if (tn === $.NOBR) + nobrStartTagInBody(p, token); + else if (tn === $.AREA) + areaStartTagInBody(p, token); + else if (tn === $.MATH) + mathStartTagInBody(p, token); + else if (tn !== $.HEAD) + genericStartTagInBody(p, token); + break; + case 5: + if (tn === $.STYLE || tn === $.TITLE) + startTagInHead(p, token); + else if (tn === $.ASIDE) + addressStartTagInBody(p, token); + else if (tn === $.SMALL) + bStartTagInBody(p, token); + else if (tn === $.TABLE) + tableStartTagInBody(p, token); + else if (tn === $.EMBED) + areaStartTagInBody(p, token); + else if (tn === $.INPUT) + inputStartTagInBody(p, token); + else if (tn === $.PARAM || tn === $.TRACK) + paramStartTagInBody(p, token); + else if (tn === $.IMAGE) + imageStartTagInBody(p, token); + else if (tn !== $.FRAME && tn !== $.TBODY && tn !== $.TFOOT && tn !== $.THEAD) + genericStartTagInBody(p, token); + break; + case 6: + if (tn === $.SCRIPT) + startTagInHead(p, token); + else if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) + addressStartTagInBody(p, token); + else if (tn === $.BUTTON) + buttonStartTagInBody(p, token); + else if (tn === $.STRIKE || tn === $.STRONG) + bStartTagInBody(p, token); + else if (tn === $.APPLET || tn === $.OBJECT) + appletStartTagInBody(p, token); + else if (tn === $.KEYGEN) + areaStartTagInBody(p, token); + else if (tn === $.SOURCE) + paramStartTagInBody(p, token); + else if (tn === $.IFRAME) + iframeStartTagInBody(p, token); + else if (tn === $.SELECT) + selectStartTagInBody(p, token); + else if (tn === $.OPTION) + optgroupStartTagInBody(p, token); + else + genericStartTagInBody(p, token); + break; + case 7: + if (tn === $.BGSOUND || tn === $.COMMAND) + startTagInHead(p, token); + else if (tn === $.DETAILS || tn === $.ADDRESS || tn === $.ARTICLE || tn === $.SECTION || tn === $.SUMMARY) + addressStartTagInBody(p, token); + else if (tn === $.LISTING) + preStartTagInBody(p, token); + else if (tn === $.MARQUEE) + appletStartTagInBody(p, token); + else if (tn === $.ISINDEX) + isindexStartTagInBody(p, token); + else if (tn === $.NOEMBED) + noembedStartTagInBody(p, token); + else if (tn !== $.CAPTION) + genericStartTagInBody(p, token); + break; + case 8: + if (tn === $.BASEFONT || tn === $.MENUITEM) + menuitemStartTagInBody(p, token); + else if (tn === $.FRAMESET) + framesetStartTagInBody(p, token); + else if (tn === $.FIELDSET) + addressStartTagInBody(p, token); + else if (tn === $.TEXTAREA) + textareaStartTagInBody(p, token); + else if (tn === $.TEMPLATE) + startTagInHead(p, token); + else if (tn === $.NOSCRIPT) + noembedStartTagInBody(p, token); + else if (tn === $.OPTGROUP) + optgroupStartTagInBody(p, token); + else if (tn !== $.COLGROUP) + genericStartTagInBody(p, token); + break; + case 9: + if (tn === $.PLAINTEXT) + plaintextStartTagInBody(p, token); + else + genericStartTagInBody(p, token); + break; + case 10: + if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) + addressStartTagInBody(p, token); + else + genericStartTagInBody(p, token); + break; + default: + genericStartTagInBody(p, token); + } + } + function bodyEndTagInBody(p, token) { + if (p.openElements.hasInScope($.BODY)) + p.insertionMode = AFTER_BODY_MODE; + else + token.ignored = true; + } + function htmlEndTagInBody(p, token) { + var fakeToken = p._processFakeEndTag($.BODY); + if (!fakeToken.ignored) + p._processToken(token); + } + function addressEndTagInBody(p, token) { + var tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + } + } + function formEndTagInBody(p, token) { + var inTemplate = p.openElements.tmplCount > 0, + formElement = p.formElement; + if (!inTemplate) + p.formElement = null; + if ((formElement || inTemplate) && p.openElements.hasInScope($.FORM)) { + p.openElements.generateImpliedEndTags(); + if (inTemplate) + p.openElements.popUntilTagNamePopped($.FORM); + else + p.openElements.remove(formElement); + } + } + function pEndTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p.openElements.generateImpliedEndTagsWithExclusion($.P); + p.openElements.popUntilTagNamePopped($.P); + } else { + p._processFakeStartTag($.P); + p._processToken(token); + } + } + function liEndTagInBody(p, token) { + if (p.openElements.hasInListItemScope($.LI)) { + p.openElements.generateImpliedEndTagsWithExclusion($.LI); + p.openElements.popUntilTagNamePopped($.LI); + } + } + function ddEndTagInBody(p, token) { + var tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTagsWithExclusion(tn); + p.openElements.popUntilTagNamePopped(tn); + } + } + function numberedHeaderEndTagInBody(p, token) { + if (p.openElements.hasNumberedHeaderInScope()) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilNumberedHeaderPopped(); + } + } + function appletEndTagInBody(p, token) { + var tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); + } + } + function brEndTagInBody(p, token) { + p._processFakeStartTag($.BR); + } + function genericEndTagInBody(p, token) { + var tn = token.tagName; + for (var i = p.openElements.stackTop; i > 0; i--) { + var element = p.openElements.items[i]; + if (p.treeAdapter.getTagName(element) === tn) { + p.openElements.generateImpliedEndTagsWithExclusion(tn); + p.openElements.popUntilElementPopped(element); + break; + } + if (p._isSpecialElement(element)) + break; + } + } + function endTagInBody(p, token) { + var tn = token.tagName; + switch (tn.length) { + case 1: + if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn == $.U) + callAdoptionAgency(p, token); + else if (tn === $.P) + pEndTagInBody(p, token); + else + genericEndTagInBody(p, token); + break; + case 2: + if (tn == $.DL || tn === $.UL || tn === $.OL) + addressEndTagInBody(p, token); + else if (tn === $.LI) + liEndTagInBody(p, token); + else if (tn === $.DD || tn === $.DT) + ddEndTagInBody(p, token); + else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) + numberedHeaderEndTagInBody(p, token); + else if (tn === $.BR) + brEndTagInBody(p, token); + else if (tn === $.EM || tn === $.TT) + callAdoptionAgency(p, token); + else + genericEndTagInBody(p, token); + break; + case 3: + if (tn === $.BIG) + callAdoptionAgency(p, token); + else if (tn === $.DIR || tn === $.DIV || tn === $.NAV) + addressEndTagInBody(p, token); + else + genericEndTagInBody(p, token); + break; + case 4: + if (tn === $.BODY) + bodyEndTagInBody(p, token); + else if (tn === $.HTML) + htmlEndTagInBody(p, token); + else if (tn === $.FORM) + formEndTagInBody(p, token); + else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) + callAdoptionAgency(p, token); + else if (tn === $.MAIN || tn === $.MENU) + addressEndTagInBody(p, token); + else + genericEndTagInBody(p, token); + break; + case 5: + if (tn === $.ASIDE) + addressEndTagInBody(p, token); + else if (tn === $.SMALL) + callAdoptionAgency(p, token); + else + genericEndTagInBody(p, token); + break; + case 6: + if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) + addressEndTagInBody(p, token); + else if (tn === $.APPLET || tn === $.OBJECT) + appletEndTagInBody(p, token); + else if (tn == $.STRIKE || tn === $.STRONG) + callAdoptionAgency(p, token); + else + genericEndTagInBody(p, token); + break; + case 7: + if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY) + addressEndTagInBody(p, token); + else if (tn === $.MARQUEE) + appletEndTagInBody(p, token); + else + genericEndTagInBody(p, token); + break; + case 8: + if (tn === $.FIELDSET) + addressEndTagInBody(p, token); + else if (tn === $.TEMPLATE) + endTagInHead(p, token); + else + genericEndTagInBody(p, token); + break; + case 10: + if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) + addressEndTagInBody(p, token); + else + genericEndTagInBody(p, token); + break; + default: + genericEndTagInBody(p, token); + } + } + function eofInBody(p, token) { + if (p.tmplInsertionModeStackTop > -1) + eofInTemplate(p, token); + else + p.stopped = true; + } + function endTagInText(p, token) { + if (!p.fragmentContext && p.scriptHandler && token.tagName === $.SCRIPT) + p.scriptHandler(p.document, p.openElements.current); + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; + } + function eofInText(p, token) { + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; + p._processToken(token); + } + function characterInTable(p, token) { + var curTn = p.openElements.currentTagName; + if (curTn === $.TABLE || curTn === $.TBODY || curTn === $.TFOOT || curTn === $.THEAD || curTn === $.TR) { + p.pendingCharacterTokens = []; + p.hasNonWhitespacePendingCharacterToken = false; + p.originalInsertionMode = p.insertionMode; + p.insertionMode = IN_TABLE_TEXT_MODE; + p._processToken(token); + } else + tokenInTable(p, token); + } + function captionStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p.activeFormattingElements.insertMarker(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_CAPTION_MODE; + } + function colgroupStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_COLUMN_GROUP_MODE; + } + function colStartTagInTable(p, token) { + p._processFakeStartTag($.COLGROUP); + p._processToken(token); + } + function tbodyStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_TABLE_BODY_MODE; + } + function tdStartTagInTable(p, token) { + p._processFakeStartTag($.TBODY); + p._processToken(token); + } + function tableStartTagInTable(p, token) { + var fakeToken = p._processFakeEndTag($.TABLE); + if (!fakeToken.ignored) + p._processToken(token); + } + function inputStartTagInTable(p, token) { + var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); + if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE) + p._appendElement(token, NS.HTML); + else + tokenInTable(p, token); + } + function formStartTagInTable(p, token) { + if (!p.formElement && p.openElements.tmplCount === 0) { + p._insertElement(token, NS.HTML); + p.formElement = p.openElements.current; + p.openElements.pop(); + } + } + function startTagInTable(p, token) { + var tn = token.tagName; + switch (tn.length) { + case 2: + if (tn === $.TD || tn === $.TH || tn === $.TR) + tdStartTagInTable(p, token); + else + tokenInTable(p, token); + break; + case 3: + if (tn === $.COL) + colStartTagInTable(p, token); + else + tokenInTable(p, token); + break; + case 4: + if (tn === $.FORM) + formStartTagInTable(p, token); + else + tokenInTable(p, token); + break; + case 5: + if (tn === $.TABLE) + tableStartTagInTable(p, token); + else if (tn === $.STYLE) + startTagInHead(p, token); + else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) + tbodyStartTagInTable(p, token); + else if (tn === $.INPUT) + inputStartTagInTable(p, token); + else + tokenInTable(p, token); + break; + case 6: + if (tn === $.SCRIPT) + startTagInHead(p, token); + else + tokenInTable(p, token); + break; + case 7: + if (tn === $.CAPTION) + captionStartTagInTable(p, token); + else + tokenInTable(p, token); + break; + case 8: + if (tn === $.COLGROUP) + colgroupStartTagInTable(p, token); + else if (tn === $.TEMPLATE) + startTagInHead(p, token); + else + tokenInTable(p, token); + break; + default: + tokenInTable(p, token); + } + } + function endTagInTable(p, token) { + var tn = token.tagName; + if (tn === $.TABLE) { + if (p.openElements.hasInTableScope($.TABLE)) { + p.openElements.popUntilTagNamePopped($.TABLE); + p._resetInsertionMode(); + } else + token.ignored = true; + } else if (tn === $.TEMPLATE) + endTagInHead(p, token); + else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) { + tokenInTable(p, token); + } + } + function tokenInTable(p, token) { + var savedFosterParentingState = p.fosterParentingEnabled; + p.fosterParentingEnabled = true; + p._processTokenInBodyMode(token); + p.fosterParentingEnabled = savedFosterParentingState; + } + function whitespaceCharacterInTableText(p, token) { + p.pendingCharacterTokens.push(token); + } + function characterInTableText(p, token) { + p.pendingCharacterTokens.push(token); + p.hasNonWhitespacePendingCharacterToken = true; + } + function tokenInTableText(p, token) { + if (p.hasNonWhitespacePendingCharacterToken) { + for (var i = 0; i < p.pendingCharacterTokens.length; i++) + tokenInTable(p, p.pendingCharacterTokens[i]); + } else { + for (var i = 0; i < p.pendingCharacterTokens.length; i++) + p._insertCharacters(p.pendingCharacterTokens[i]); + } + p.insertionMode = p.originalInsertionMode; + p._processToken(token); + } + function startTagInCaption(p, token) { + var tn = token.tagName; + if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { + var fakeToken = p._processFakeEndTag($.CAPTION); + if (!fakeToken.ignored) + p._processToken(token); + } else + startTagInBody(p, token); + } + function endTagInCaption(p, token) { + var tn = token.tagName; + if (tn === $.CAPTION) { + if (p.openElements.hasInTableScope($.CAPTION)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped($.CAPTION); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = IN_TABLE_MODE; + } else + token.ignored = true; + } else if (tn === $.TABLE) { + var fakeToken = p._processFakeEndTag($.CAPTION); + if (!fakeToken.ignored) + p._processToken(token); + } else if (tn !== $.BODY && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) { + endTagInBody(p, token); + } + } + function startTagInColumnGroup(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.COL) + p._appendElement(token, NS.HTML); + else if (tn === $.TEMPLATE) + startTagInHead(p, token); + else + tokenInColumnGroup(p, token); + } + function endTagInColumnGroup(p, token) { + var tn = token.tagName; + if (tn === $.COLGROUP) { + if (p.openElements.currentTagName !== $.COLGROUP) + token.ignored = true; + else { + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + } + } else if (tn === $.TEMPLATE) + endTagInHead(p, token); + else if (tn !== $.COL) + tokenInColumnGroup(p, token); + } + function tokenInColumnGroup(p, token) { + var fakeToken = p._processFakeEndTag($.COLGROUP); + if (!fakeToken.ignored) + p._processToken(token); + } + function startTagInTableBody(p, token) { + var tn = token.tagName; + if (tn === $.TR) { + p.openElements.clearBackToTableBodyContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_ROW_MODE; + } else if (tn === $.TH || tn === $.TD) { + p._processFakeStartTag($.TR); + p._processToken(token); + } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p._processFakeEndTag(p.openElements.currentTagName); + p._processToken(token); + } + } else + startTagInTable(p, token); + } + function endTagInTableBody(p, token) { + var tn = token.tagName; + if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + } + } else if (tn === $.TABLE) { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p._processFakeEndTag(p.openElements.currentTagName); + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH && tn !== $.TR) { + endTagInTable(p, token); + } + } + function startTagInRow(p, token) { + var tn = token.tagName; + if (tn === $.TH || tn === $.TD) { + p.openElements.clearBackToTableRowContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_CELL_MODE; + p.activeFormattingElements.insertMarker(); + } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { + var fakeToken = p._processFakeEndTag($.TR); + if (!fakeToken.ignored) + p._processToken(token); + } else + startTagInTable(p, token); + } + function endTagInRow(p, token) { + var tn = token.tagName; + if (tn === $.TR) { + if (p.openElements.hasInTableScope($.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_BODY_MODE; + } else + token.ignored = true; + } else if (tn === $.TABLE) { + var fakeToken = p._processFakeEndTag($.TR); + if (!fakeToken.ignored) + p._processToken(token); + } else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasInTableScope(tn)) { + p._processFakeEndTag($.TR); + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH) { + endTagInTable(p, token); + } + } + function startTagInCell(p, token) { + var tn = token.tagName; + if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope($.TD) || p.openElements.hasInTableScope($.TH)) { + p._closeTableCell(); + p._processToken(token); + } + } else + startTagInBody(p, token); + } + function endTagInCell(p, token) { + var tn = token.tagName; + if (tn === $.TD || tn === $.TH) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = IN_ROW_MODE; + } + } else if (tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope(tn)) { + p._closeTableCell(); + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML) + endTagInBody(p, token); + } + function startTagInSelect(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.OPTION) { + if (p.openElements.currentTagName === $.OPTION) + p._processFakeEndTag($.OPTION); + p._insertElement(token, NS.HTML); + } else if (tn === $.OPTGROUP) { + if (p.openElements.currentTagName === $.OPTION) + p._processFakeEndTag($.OPTION); + if (p.openElements.currentTagName === $.OPTGROUP) + p._processFakeEndTag($.OPTGROUP); + p._insertElement(token, NS.HTML); + } else if (tn === $.SELECT) + p._processFakeEndTag($.SELECT); + else if (tn === $.INPUT || tn === $.KEYGEN || tn === $.TEXTAREA) { + if (p.openElements.hasInSelectScope($.SELECT)) { + p._processFakeEndTag($.SELECT); + p._processToken(token); + } + } else if (tn === $.SCRIPT || tn === $.TEMPLATE) + startTagInHead(p, token); + } + function endTagInSelect(p, token) { + var tn = token.tagName; + if (tn === $.OPTGROUP) { + var prevOpenElement = p.openElements.items[p.openElements.stackTop - 1], + prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement); + if (p.openElements.currentTagName === $.OPTION && prevOpenElementTn === $.OPTGROUP) + p._processFakeEndTag($.OPTION); + if (p.openElements.currentTagName === $.OPTGROUP) + p.openElements.pop(); + } else if (tn === $.OPTION) { + if (p.openElements.currentTagName === $.OPTION) + p.openElements.pop(); + } else if (tn === $.SELECT && p.openElements.hasInSelectScope($.SELECT)) { + p.openElements.popUntilTagNamePopped($.SELECT); + p._resetInsertionMode(); + } else if (tn === $.TEMPLATE) + endTagInHead(p, token); + } + function startTagInSelectInTable(p, token) { + var tn = token.tagName; + if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { + p._processFakeEndTag($.SELECT); + p._processToken(token); + } else + startTagInSelect(p, token); + } + function endTagInSelectInTable(p, token) { + var tn = token.tagName; + if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { + if (p.openElements.hasInTableScope(tn)) { + p._processFakeEndTag($.SELECT); + p._processToken(token); + } + } else + endTagInSelect(p, token); + } + function startTagInTemplate(p, token) { + var tn = token.tagName; + if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { + startTagInHead(p, token); + } else { + var newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE; + p._popTmplInsertionMode(); + p._pushTmplInsertionMode(newInsertionMode); + p.insertionMode = newInsertionMode; + p._processToken(token); + } + } + function endTagInTemplate(p, token) { + if (token.tagName === $.TEMPLATE) + endTagInHead(p, token); + } + function eofInTemplate(p, token) { + if (p.openElements.tmplCount > 0) { + p.openElements.popUntilTemplatePopped(); + p.activeFormattingElements.clearToLastMarker(); + p._popTmplInsertionMode(); + p._resetInsertionMode(); + p._processToken(token); + } else + p.stopped = true; + } + function startTagAfterBody(p, token) { + if (token.tagName === $.HTML) + startTagInBody(p, token); + else + tokenAfterBody(p, token); + } + function endTagAfterBody(p, token) { + if (token.tagName === $.HTML) { + if (!p.fragmentContext) + p.insertionMode = AFTER_AFTER_BODY_MODE; + } else + tokenAfterBody(p, token); + } + function tokenAfterBody(p, token) { + p.insertionMode = IN_BODY_MODE; + p._processToken(token); + } + function startTagInFrameset(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.FRAMESET) + p._insertElement(token, NS.HTML); + else if (tn === $.FRAME) + p._appendElement(token, NS.HTML); + else if (tn === $.NOFRAMES) + startTagInHead(p, token); + } + function endTagInFrameset(p, token) { + if (token.tagName === $.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) { + p.openElements.pop(); + if (!p.fragmentContext && p.openElements.currentTagName !== $.FRAMESET) + p.insertionMode = AFTER_FRAMESET_MODE; + } + } + function startTagAfterFrameset(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.NOFRAMES) + startTagInHead(p, token); + } + function endTagAfterFrameset(p, token) { + if (token.tagName === $.HTML) + p.insertionMode = AFTER_AFTER_FRAMESET_MODE; + } + function startTagAfterAfterBody(p, token) { + if (token.tagName === $.HTML) + startTagInBody(p, token); + else + tokenAfterAfterBody(p, token); + } + function tokenAfterAfterBody(p, token) { + p.insertionMode = IN_BODY_MODE; + p._processToken(token); + } + function startTagAfterAfterFrameset(p, token) { + var tn = token.tagName; + if (tn === $.HTML) + startTagInBody(p, token); + else if (tn === $.NOFRAMES) + startTagInHead(p, token); + } + function nullCharacterInForeignContent(p, token) { + token.chars = UNICODE.REPLACEMENT_CHARACTER; + p._insertCharacters(token); + } + function characterInForeignContent(p, token) { + p._insertCharacters(token); + p.framesetOk = false; + } + function startTagInForeignContent(p, token) { + if (ForeignContent.causesExit(token) && !p.fragmentContext) { + while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && (!p._isMathMLTextIntegrationPoint(p.openElements.current)) && (!p._isHtmlIntegrationPoint(p.openElements.current))) { + p.openElements.pop(); + } + p._processToken(token); + } else { + var current = p._getAdjustedCurrentElement(), + currentNs = p.treeAdapter.getNamespaceURI(current); + if (currentNs === NS.MATHML) + ForeignContent.adjustTokenMathMLAttrs(token); + else if (currentNs === NS.SVG) { + ForeignContent.adjustTokenSVGTagName(token); + ForeignContent.adjustTokenSVGAttrs(token); + } + ForeignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) + p._appendElement(token, currentNs); + else + p._insertElement(token, currentNs); + } + } + function endTagInForeignContent(p, token) { + for (var i = p.openElements.stackTop; i > 0; i--) { + var element = p.openElements.items[i]; + if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { + p._processToken(token); + break; + } + if (p.treeAdapter.getTagName(element).toLowerCase() === token.tagName) { + p.openElements.popUntilElementPopped(element); + break; + } + } + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var metadata_1 = require("angular2/src/core/di/metadata"); + exports.InjectMetadata = metadata_1.InjectMetadata; + exports.OptionalMetadata = metadata_1.OptionalMetadata; + exports.InjectableMetadata = metadata_1.InjectableMetadata; + exports.SelfMetadata = metadata_1.SelfMetadata; + exports.HostMetadata = metadata_1.HostMetadata; + exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; + exports.DependencyMetadata = metadata_1.DependencyMetadata; + __export(require("angular2/src/core/di/decorators")); + var forward_ref_1 = require("angular2/src/core/di/forward_ref"); + exports.forwardRef = forward_ref_1.forwardRef; + exports.resolveForwardRef = forward_ref_1.resolveForwardRef; + var injector_1 = require("angular2/src/core/di/injector"); + exports.Injector = injector_1.Injector; + var provider_1 = require("angular2/src/core/di/provider"); + exports.Binding = provider_1.Binding; + exports.ProviderBuilder = provider_1.ProviderBuilder; + exports.ResolvedFactory = provider_1.ResolvedFactory; + exports.Dependency = provider_1.Dependency; + exports.bind = provider_1.bind; + exports.Provider = provider_1.Provider; + exports.provide = provider_1.provide; + var key_1 = require("angular2/src/core/di/key"); + exports.Key = key_1.Key; + exports.TypeLiteral = key_1.TypeLiteral; + var exceptions_1 = require("angular2/src/core/di/exceptions"); + exports.NoProviderError = exceptions_1.NoProviderError; + exports.AbstractProviderError = exceptions_1.AbstractProviderError; + exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; + exports.InstantiationError = exceptions_1.InstantiationError; + exports.InvalidProviderError = exceptions_1.InvalidProviderError; + exports.NoAnnotationError = exceptions_1.NoAnnotationError; + exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; + var opaque_token_1 = require("angular2/src/core/di/opaque_token"); + exports.OpaqueToken = opaque_token_1.OpaqueToken; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var collection_1 = require("angular2/src/facade/collection"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); + var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); + var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); + var DynamicProtoChangeDetector = (function() { + function DynamicProtoChangeDetector(_definition) { + this._definition = _definition; + this._propertyBindingRecords = createPropertyRecords(_definition); + this._eventBindingRecords = createEventRecords(_definition); + this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { + return b.target; + }); + this._directiveIndices = this._definition.directiveRecords.map(function(d) { + return d.directiveIndex; + }); + } + DynamicProtoChangeDetector.prototype.instantiate = function(dispatcher) { + return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, dispatcher, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); + }; + return DynamicProtoChangeDetector; + })(); + exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; + function createPropertyRecords(definition) { + var recordBuilder = new ProtoRecordBuilder(); + collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { + return recordBuilder.add(b, definition.variableNames, index); + }); + return coalesce_1.coalesce(recordBuilder.records); + } + exports.createPropertyRecords = createPropertyRecords; + function createEventRecords(definition) { + var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); + return definition.eventRecords.map(function(er) { + var records = _ConvertAstIntoProtoRecords.create(er, varNames); + var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; + return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); + }); + } + exports.createEventRecords = createEventRecords; + var ProtoRecordBuilder = (function() { + function ProtoRecordBuilder() { + this.records = []; + } + ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { + var oldLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { + oldLast.lastInDirective = false; + } + var numberOfRecordsBefore = this.records.length; + this._appendRecords(b, variableNames, bindingIndex); + var newLast = collection_1.ListWrapper.last(this.records); + if (lang_1.isPresent(newLast) && newLast !== oldLast) { + newLast.lastInBinding = true; + newLast.lastInDirective = true; + this._setArgumentToPureFunction(numberOfRecordsBefore); + } + }; + ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { + var _this = this; + for (var i = startIndex; i < this.records.length; ++i) { + var rec = this.records[i]; + if (rec.isPureFunction()) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + } + if (rec.mode === proto_record_1.RecordType.Pipe) { + rec.args.forEach(function(recordIndex) { + return _this.records[recordIndex - 1].argumentToPureFunction = true; + }); + this.records[rec.contextIndex - 1].argumentToPureFunction = true; + } + } + }; + ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { + if (b.isDirectiveLifecycle()) { + this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); + } else { + _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); + } + }; + return ProtoRecordBuilder; + })(); + exports.ProtoRecordBuilder = ProtoRecordBuilder; + var _ConvertAstIntoProtoRecords = (function() { + function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { + this._records = _records; + this._bindingRecord = _bindingRecord; + this._variableNames = _variableNames; + this._bindingIndex = _bindingIndex; + } + _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { + var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); + b.ast.visit(c); + }; + _ConvertAstIntoProtoRecords.create = function(b, variableNames) { + var rec = []; + _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); + rec[rec.length - 1].lastInBinding = true; + return rec; + }; + _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { + return this._bindingRecord.implicitReceiver; + }; + _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { + var args = this._visitAll(ast.expressions); + return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { + return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + } else { + return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { + throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); + } else { + var receiver = ast.receiver.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + var value = ast.value.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { + var receiver = ast.receiver.visit(this); + return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { + var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + } else { + return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { + var receiver = ast.receiver.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); + }; + _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { + var target = ast.target.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { + var primitiveName = "arrayFn" + ast.expressions.length; + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { + return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { + var left = ast.left.visit(this); + switch (ast.operation) { + case '&&': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); + case '||': + var branchEnd = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); + var right = ast.right.visit(this); + branchEnd[0] = right; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); + default: + var right = ast.right.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); + } + }; + _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { + var exp = ast.expression.visit(this); + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { + var condition = ast.condition.visit(this); + var startOfFalseBranch = [null]; + var endOfFalseBranch = [null]; + this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); + var whenTrue = ast.trueExp.visit(this); + var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); + var whenFalse = ast.falseExp.visit(this); + startOfFalseBranch[0] = skip; + endOfFalseBranch[0] = whenFalse; + return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); + }; + _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { + var value = ast.exp.visit(this); + var args = this._visitAll(ast.args); + return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); + }; + _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { + var obj = ast.obj.visit(this); + var key = ast.key.visit(this); + return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); + }; + _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { + var _this = this; + var args = ast.expressions.map(function(e) { + return e.visit(_this); + }); + return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); + }; + _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { + var res = collection_1.ListWrapper.createFixedSize(asts.length); + for (var i = 0; i < asts.length; ++i) { + res[i] = asts[i].visit(this); + } + return res; + }; + _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { + var selfIndex = this._records.length + 1; + if (context instanceof directive_record_1.DirectiveIndex) { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } else { + this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); + } + return selfIndex; + }; + return _ConvertAstIntoProtoRecords; + })(); + function _arrayFn(length) { + switch (length) { + case 0: + return change_detection_util_1.ChangeDetectionUtil.arrayFn0; + case 1: + return change_detection_util_1.ChangeDetectionUtil.arrayFn1; + case 2: + return change_detection_util_1.ChangeDetectionUtil.arrayFn2; + case 3: + return change_detection_util_1.ChangeDetectionUtil.arrayFn3; + case 4: + return change_detection_util_1.ChangeDetectionUtil.arrayFn4; + case 5: + return change_detection_util_1.ChangeDetectionUtil.arrayFn5; + case 6: + return change_detection_util_1.ChangeDetectionUtil.arrayFn6; + case 7: + return change_detection_util_1.ChangeDetectionUtil.arrayFn7; + case 8: + return change_detection_util_1.ChangeDetectionUtil.arrayFn8; + case 9: + return change_detection_util_1.ChangeDetectionUtil.arrayFn9; + default: + throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); + } + } + function _mapPrimitiveName(keys) { + var stringifiedKeys = keys.map(function(k) { + return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; + }).join(', '); + return "mapFn([" + stringifiedKeys + "])"; + } + function _operationToPrimitiveName(operation) { + switch (operation) { + case '+': + return "operation_add"; + case '-': + return "operation_subtract"; + case '*': + return "operation_multiply"; + case '/': + return "operation_divide"; + case '%': + return "operation_remainder"; + case '==': + return "operation_equals"; + case '!=': + return "operation_not_equals"; + case '===': + return "operation_identical"; + case '!==': + return "operation_not_identical"; + case '<': + return "operation_less_then"; + case '>': + return "operation_greater_then"; + case '<=': + return "operation_less_or_equals_then"; + case '>=': + return "operation_greater_or_equals_then"; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function _operationToFunction(operation) { + switch (operation) { + case '+': + return change_detection_util_1.ChangeDetectionUtil.operation_add; + case '-': + return change_detection_util_1.ChangeDetectionUtil.operation_subtract; + case '*': + return change_detection_util_1.ChangeDetectionUtil.operation_multiply; + case '/': + return change_detection_util_1.ChangeDetectionUtil.operation_divide; + case '%': + return change_detection_util_1.ChangeDetectionUtil.operation_remainder; + case '==': + return change_detection_util_1.ChangeDetectionUtil.operation_equals; + case '!=': + return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; + case '===': + return change_detection_util_1.ChangeDetectionUtil.operation_identical; + case '!==': + return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; + case '<': + return change_detection_util_1.ChangeDetectionUtil.operation_less_then; + case '>': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; + case '<=': + return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; + case '>=': + return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; + default: + throw new exceptions_1.BaseException("Unsupported operation " + operation); + } + } + function s(v) { + return lang_1.isPresent(v) ? "" + v : ''; + } + function _interpolationFn(strings) { + var length = strings.length; + var c0 = length > 0 ? strings[0] : null; + var c1 = length > 1 ? strings[1] : null; + var c2 = length > 2 ? strings[2] : null; + var c3 = length > 3 ? strings[3] : null; + var c4 = length > 4 ? strings[4] : null; + var c5 = length > 5 ? strings[5] : null; + var c6 = length > 6 ? strings[6] : null; + var c7 = length > 7 ? strings[7] : null; + var c8 = length > 8 ? strings[8] : null; + var c9 = length > 9 ? strings[9] : null; + switch (length - 1) { + case 1: + return function(a1) { + return c0 + s(a1) + c1; + }; + case 2: + return function(a1, a2) { + return c0 + s(a1) + c1 + s(a2) + c2; + }; + case 3: + return function(a1, a2, a3) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; + }; + case 4: + return function(a1, a2, a3, a4) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; + }; + case 5: + return function(a1, a2, a3, a4, a5) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; + }; + case 6: + return function(a1, a2, a3, a4, a5, a6) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; + }; + case 7: + return function(a1, a2, a3, a4, a5, a6, a7) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; + }; + case 8: + return function(a1, a2, a3, a4, a5, a6, a7, a8) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; + }; + case 9: + return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; + }; + default: + throw new exceptions_1.BaseException("Does not support more than 9 expressions"); + } + } + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static", ["@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + exports['default'] = combineLatest; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _combineLatestSupport = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-support"); + function combineLatest() { + var project = undefined, + scheduler = undefined; + for (var _len = arguments.length, + observables = Array(_len), + _key = 0; _key < _len; _key++) { + observables[_key] = arguments[_key]; + } + if (typeof observables[observables.length - 1].schedule === 'function') { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _combineLatestSupport.CombineLatestOperator(project)); + } + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable", ["@reactivex/rxjs/dist/cjs/util/isNumeric", "@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/schedulers/nextTick"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, {constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + }}); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var _utilIsNumeric = require("@reactivex/rxjs/dist/cjs/util/isNumeric"); + var _utilIsNumeric2 = _interopRequireDefault(_utilIsNumeric); + var _Observable2 = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable3 = _interopRequireDefault(_Observable2); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var IntervalObservable = (function(_Observable) { + _inherits(IntervalObservable, _Observable); + function IntervalObservable() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + _classCallCheck(this, IntervalObservable); + _Observable.call(this); + this.period = period; + this.scheduler = scheduler; + if (!_utilIsNumeric2['default'](period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = _schedulersNextTick2['default']; + } + } + IntervalObservable.create = function create() { + var period = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; + var scheduler = arguments.length <= 1 || arguments[1] === undefined ? _schedulersNextTick2['default'] : arguments[1]; + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function dispatch(state) { + var index = state.index; + var subscriber = state.subscriber; + var period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function _subscribe(subscriber) { + var index = 0; + var period = this.period; + var scheduler = this.scheduler; + subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { + index: index, + subscriber: subscriber, + period: period + })); + }; + return IntervalObservable; + })(_Observable3['default']); + exports['default'] = IntervalObservable; + module.exports = exports['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/render/dom/events/event_manager", "angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/profile/profile", "angular2/src/core/render/api", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/view_factory", "angular2/src/core/render/view", "angular2/src/core/render/dom/util", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var di_1 = require("angular2/src/core/di"); + var animation_builder_1 = require("angular2/src/animate/animation_builder"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var event_manager_1 = require("angular2/src/core/render/dom/events/event_manager"); + var shared_styles_host_1 = require("angular2/src/core/render/dom/shared_styles_host"); + var profile_1 = require("angular2/src/core/profile/profile"); + var api_1 = require("angular2/src/core/render/api"); + var dom_tokens_1 = require("angular2/src/core/render/dom/dom_tokens"); + var view_factory_1 = require("angular2/src/core/render/view_factory"); + var view_1 = require("angular2/src/core/render/view"); + var util_1 = require("angular2/src/core/render/dom/util"); + var metadata_1 = require("angular2/src/core/metadata"); + var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var SVG_ELEMENT_NAMES = lang_1.CONST_EXPR({ + 'altGlyph': true, + 'altGlyphDef': true, + 'altGlyphItem': true, + 'animate': true, + 'animateColor': true, + 'animateMotion': true, + 'animateTransform': true, + 'circle': true, + 'clipPath': true, + 'color-profile': true, + 'cursor': true, + 'defs': true, + 'desc': true, + 'ellipse': true, + 'feBlend': true, + 'feColorMatrix': true, + 'feComponentTransfer': true, + 'feComposite': true, + 'feConvolveMatrix': true, + 'feDiffuseLighting': true, + 'feDisplacementMap': true, + 'feDistantLight': true, + 'feFlood': true, + 'feFuncA': true, + 'feFuncB': true, + 'feFuncG': true, + 'feFuncR': true, + 'feGaussianBlur': true, + 'feImage': true, + 'feMerge': true, + 'feMergeNode': true, + 'feMorphology': true, + 'feOffset': true, + 'fePointLight': true, + 'feSpecularLighting': true, + 'feSpotLight': true, + 'feTile': true, + 'feTurbulence': true, + 'filter': true, + 'font': true, + 'font-face': true, + 'font-face-format': true, + 'font-face-name': true, + 'font-face-src': true, + 'font-face-uri': true, + 'foreignObject': true, + 'g': true, + 'glyphRef': true, + 'hkern': true, + 'image': true, + 'line': true, + 'linearGradient': true, + 'marker': true, + 'mask': true, + 'metadata': true, + 'missing-glyph': true, + 'mpath': true, + 'path': true, + 'pattern': true, + 'polygon': true, + 'polyline': true, + 'radialGradient': true, + 'rect': true, + 'set': true, + 'stop': true, + 'style': true, + 'svg': true, + 'switch': true, + 'symbol': true, + 'text': true, + 'textPath': true, + 'title': true, + 'tref': true, + 'tspan': true, + 'use': true, + 'view': true, + 'vkern': true + }); + var SVG_ATTR_NAMESPACES = lang_1.CONST_EXPR({ + 'href': XLINK_NAMESPACE, + 'xlink:href': XLINK_NAMESPACE + }); + var DomRenderer = (function(_super) { + __extends(DomRenderer, _super); + function DomRenderer() { + _super.apply(this, arguments); + } + DomRenderer.prototype.getNativeElementSync = function(location) { + return resolveInternalDomView(location.renderView).boundElements[location.boundElementIndex]; + }; + DomRenderer.prototype.getRootNodes = function(fragment) { + return resolveInternalDomFragment(fragment); + }; + DomRenderer.prototype.attachFragmentAfterFragment = function(previousFragmentRef, fragmentRef) { + var previousFragmentNodes = resolveInternalDomFragment(previousFragmentRef); + if (previousFragmentNodes.length > 0) { + var sibling = previousFragmentNodes[previousFragmentNodes.length - 1]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(sibling, nodes); + this.animateNodesEnter(nodes); + } + }; + DomRenderer.prototype.animateNodesEnter = function(nodes) { + for (var i = 0; i < nodes.length; i++) + this.animateNodeEnter(nodes[i]); + }; + DomRenderer.prototype.attachFragmentAfterElement = function(elementRef, fragmentRef) { + var parentView = resolveInternalDomView(elementRef.renderView); + var element = parentView.boundElements[elementRef.boundElementIndex]; + var nodes = resolveInternalDomFragment(fragmentRef); + moveNodesAfterSibling(element, nodes); + this.animateNodesEnter(nodes); + }; + DomRenderer.prototype.hydrateView = function(viewRef) { + resolveInternalDomView(viewRef).hydrate(); + }; + DomRenderer.prototype.dehydrateView = function(viewRef) { + resolveInternalDomView(viewRef).dehydrate(); + }; + DomRenderer.prototype.createTemplateAnchor = function(attrNameAndValues) { + return this.createElement('script', attrNameAndValues); + }; + DomRenderer.prototype.createText = function(value) { + return dom_adapter_1.DOM.createTextNode(lang_1.isPresent(value) ? value : ''); + }; + DomRenderer.prototype.appendChild = function(parent, child) { + dom_adapter_1.DOM.appendChild(parent, child); + }; + DomRenderer.prototype.setElementProperty = function(location, propertyName, propertyValue) { + var view = resolveInternalDomView(location.renderView); + dom_adapter_1.DOM.setProperty(view.boundElements[location.boundElementIndex], propertyName, propertyValue); + }; + DomRenderer.prototype.setElementAttribute = function(location, attributeName, attributeValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedAttributeName = util_1.camelCaseToDashCase(attributeName); + if (lang_1.isPresent(attributeValue)) { + dom_adapter_1.DOM.setAttribute(element, dashCasedAttributeName, lang_1.stringify(attributeValue)); + } else { + dom_adapter_1.DOM.removeAttribute(element, dashCasedAttributeName); + } + }; + DomRenderer.prototype.setElementClass = function(location, className, isAdd) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + if (isAdd) { + dom_adapter_1.DOM.addClass(element, className); + } else { + dom_adapter_1.DOM.removeClass(element, className); + } + }; + DomRenderer.prototype.setElementStyle = function(location, styleName, styleValue) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + var dashCasedStyleName = util_1.camelCaseToDashCase(styleName); + if (lang_1.isPresent(styleValue)) { + dom_adapter_1.DOM.setStyle(element, dashCasedStyleName, lang_1.stringify(styleValue)); + } else { + dom_adapter_1.DOM.removeStyle(element, dashCasedStyleName); + } + }; + DomRenderer.prototype.invokeElementMethod = function(location, methodName, args) { + var view = resolveInternalDomView(location.renderView); + var element = view.boundElements[location.boundElementIndex]; + dom_adapter_1.DOM.invoke(element, methodName, args); + }; + DomRenderer.prototype.setText = function(viewRef, textNodeIndex, text) { + var view = resolveInternalDomView(viewRef); + dom_adapter_1.DOM.setText(view.boundTextNodes[textNodeIndex], text); + }; + DomRenderer.prototype.setEventDispatcher = function(viewRef, dispatcher) { + resolveInternalDomView(viewRef).setEventDispatcher(dispatcher); + }; + return DomRenderer; + })(api_1.Renderer); + exports.DomRenderer = DomRenderer; + var DomRenderer_ = (function(_super) { + __extends(DomRenderer_, _super); + function DomRenderer_(_eventManager, _domSharedStylesHost, _animate, document) { + _super.call(this); + this._eventManager = _eventManager; + this._domSharedStylesHost = _domSharedStylesHost; + this._animate = _animate; + this._componentTpls = new Map(); + this._createRootHostViewScope = profile_1.wtfCreateScope('DomRenderer#createRootHostView()'); + this._createViewScope = profile_1.wtfCreateScope('DomRenderer#createView()'); + this._detachFragmentScope = profile_1.wtfCreateScope('DomRenderer#detachFragment()'); + this._document = document; + } + DomRenderer_.prototype.registerComponentTemplate = function(template) { + this._componentTpls.set(template.id, template); + if (template.encapsulation !== metadata_1.ViewEncapsulation.Native) { + var encapsulatedStyles = view_factory_1.encapsulateStyles(template); + this._domSharedStylesHost.addStyles(encapsulatedStyles); + } + }; + DomRenderer_.prototype.createProtoView = function(componentTemplateId, cmds) { + return new view_1.DefaultProtoViewRef(this._componentTpls.get(componentTemplateId), cmds); + }; + DomRenderer_.prototype.resolveComponentTemplate = function(templateId) { + return this._componentTpls.get(templateId); + }; + DomRenderer_.prototype.createRootHostView = function(hostProtoViewRef, fragmentCount, hostElementSelector) { + var s = this._createRootHostViewScope(); + var element = dom_adapter_1.DOM.querySelector(this._document, hostElementSelector); + if (lang_1.isBlank(element)) { + profile_1.wtfLeave(s); + throw new exceptions_1.BaseException("The selector \"" + hostElementSelector + "\" did not match any elements"); + } + return profile_1.wtfLeave(s, this._createView(hostProtoViewRef, element)); + }; + DomRenderer_.prototype.createView = function(protoViewRef, fragmentCount) { + var s = this._createViewScope(); + return profile_1.wtfLeave(s, this._createView(protoViewRef, null)); + }; + DomRenderer_.prototype._createView = function(protoViewRef, inplaceElement) { + var dpvr = protoViewRef; + var view = view_factory_1.createRenderView(dpvr.template, dpvr.cmds, inplaceElement, this); + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.addHost(sdRoots[i]); + } + return new api_1.RenderViewWithFragments(view, view.fragments); + }; + DomRenderer_.prototype.destroyView = function(viewRef) { + var view = viewRef; + var sdRoots = view.nativeShadowRoots; + for (var i = 0; i < sdRoots.length; i++) { + this._domSharedStylesHost.removeHost(sdRoots[i]); + } + }; + DomRenderer_.prototype.animateNodeEnter = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-enter'); + this._animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-enter'); + }); + } + }; + DomRenderer_.prototype.animateNodeLeave = function(node) { + if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { + dom_adapter_1.DOM.addClass(node, 'ng-leave'); + this._animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { + dom_adapter_1.DOM.removeClass(node, 'ng-leave'); + dom_adapter_1.DOM.remove(node); + }); + } else { + dom_adapter_1.DOM.remove(node); + } + }; + DomRenderer_.prototype.detachFragment = function(fragmentRef) { + var s = this._detachFragmentScope(); + var fragmentNodes = resolveInternalDomFragment(fragmentRef); + for (var i = 0; i < fragmentNodes.length; i++) { + this.animateNodeLeave(fragmentNodes[i]); + } + profile_1.wtfLeave(s); + }; + DomRenderer_.prototype.createElement = function(name, attrNameAndValues) { + var isSvg = SVG_ELEMENT_NAMES[name] == true; + var el = isSvg ? dom_adapter_1.DOM.createElementNS(SVG_NAMESPACE, name) : dom_adapter_1.DOM.createElement(name); + this._setAttributes(el, attrNameAndValues, isSvg); + return el; + }; + DomRenderer_.prototype.mergeElement = function(existing, attrNameAndValues) { + dom_adapter_1.DOM.clearNodes(existing); + this._setAttributes(existing, attrNameAndValues, false); + }; + DomRenderer_.prototype._setAttributes = function(node, attrNameAndValues, isSvg) { + for (var attrIdx = 0; attrIdx < attrNameAndValues.length; attrIdx += 2) { + var attrName = attrNameAndValues[attrIdx]; + var attrValue = attrNameAndValues[attrIdx + 1]; + var attrNs = isSvg ? SVG_ATTR_NAMESPACES[attrName] : null; + if (lang_1.isPresent(attrNs)) { + dom_adapter_1.DOM.setAttributeNS(node, XLINK_NAMESPACE, attrName, attrValue); + } else { + dom_adapter_1.DOM.setAttribute(node, attrName, attrValue); + } + } + }; + DomRenderer_.prototype.createRootContentInsertionPoint = function() { + return dom_adapter_1.DOM.createComment('root-content-insertion-point'); + }; + DomRenderer_.prototype.createShadowRoot = function(host, templateId) { + var sr = dom_adapter_1.DOM.createShadowRoot(host); + var tpl = this._componentTpls.get(templateId); + for (var i = 0; i < tpl.styles.length; i++) { + dom_adapter_1.DOM.appendChild(sr, dom_adapter_1.DOM.createStyleElement(tpl.styles[i])); + } + return sr; + }; + DomRenderer_.prototype.on = function(element, eventName, callback) { + this._eventManager.addEventListener(element, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_.prototype.globalOn = function(target, eventName, callback) { + return this._eventManager.addGlobalEventListener(target, eventName, decoratePreventDefault(callback)); + }; + DomRenderer_ = __decorate([di_1.Injectable(), __param(3, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder, Object])], DomRenderer_); + return DomRenderer_; + })(DomRenderer); + exports.DomRenderer_ = DomRenderer_; + function resolveInternalDomView(viewRef) { + return viewRef; + } + function resolveInternalDomFragment(fragmentRef) { + return fragmentRef.nodes; + } + function moveNodesAfterSibling(sibling, nodes) { + if (nodes.length > 0 && lang_1.isPresent(dom_adapter_1.DOM.parentElement(sibling))) { + for (var i = 0; i < nodes.length; i++) { + dom_adapter_1.DOM.insertBefore(sibling, nodes[i]); + } + dom_adapter_1.DOM.insertBefore(nodes[0], sibling); + } + } + function decoratePreventDefault(eventHandler) { + return function(event) { + var allowDefaultBehavior = eventHandler(event); + if (!allowDefaultBehavior) { + dom_adapter_1.DOM.preventDefault(event); + } + }; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/common/common_directives")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/proto_view_factory", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var compiler_1 = require("angular2/src/core/linker/compiler"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + var di_1 = require("angular2/src/core/di"); + var RuntimeCompiler = (function(_super) { + __extends(RuntimeCompiler, _super); + function RuntimeCompiler() { + _super.apply(this, arguments); + } + return RuntimeCompiler; + })(compiler_1.Compiler); + exports.RuntimeCompiler = RuntimeCompiler; + var RuntimeCompiler_ = (function(_super) { + __extends(RuntimeCompiler_, _super); + function RuntimeCompiler_(_protoViewFactory, _templateCompiler) { + _super.call(this, _protoViewFactory); + this._templateCompiler = _templateCompiler; + } + RuntimeCompiler_.prototype.compileInHost = function(componentType) { + var _this = this; + return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(compiledHostTemplate) { + return compiler_1.internalCreateProtoView(_this, compiledHostTemplate); + }); + }; + RuntimeCompiler_.prototype.clearCache = function() { + _super.prototype.clearCache.call(this); + this._templateCompiler.clearCache(); + }; + RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory, template_compiler_1.TemplateCompiler])], RuntimeCompiler_); + return RuntimeCompiler_; + })(compiler_1.Compiler_); + exports.RuntimeCompiler_ = RuntimeCompiler_; + global.define = __define; + return module.exports; +}); + +System.register("parse5/index", ["parse5/lib/tree_construction/parser", "parse5/lib/simple_api/simple_api_parser", "parse5/lib/serialization/serializer", "parse5/lib/jsdom/jsdom_parser", "parse5/lib/tree_adapters/default", "parse5/lib/tree_adapters/htmlparser2"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.Parser = require("parse5/lib/tree_construction/parser"); + exports.SimpleApiParser = require("parse5/lib/simple_api/simple_api_parser"); + exports.TreeSerializer = exports.Serializer = require("parse5/lib/serialization/serializer"); + exports.JsDomParser = require("parse5/lib/jsdom/jsdom_parser"); + exports.TreeAdapters = { + default: require("parse5/lib/tree_adapters/default"), + htmlparser2: require("parse5/lib/tree_adapters/htmlparser2") + }; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var AttributeMetadata = (function(_super) { + __extends(AttributeMetadata, _super); + function AttributeMetadata(attributeName) { + _super.call(this); + this.attributeName = attributeName; + } + Object.defineProperty(AttributeMetadata.prototype, "token", { + get: function() { + return this; + }, + enumerable: true, + configurable: true + }); + AttributeMetadata.prototype.toString = function() { + return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; + }; + AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); + return AttributeMetadata; + })(metadata_1.DependencyMetadata); + exports.AttributeMetadata = AttributeMetadata; + var QueryMetadata = (function(_super) { + __extends(QueryMetadata, _super); + function QueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this); + this._selector = _selector; + this.descendants = descendants; + this.first = first; + } + Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { + get: function() { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "selector", { + get: function() { + return di_1.resolveForwardRef(this._selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { + get: function() { + return lang_1.isString(this.selector); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryMetadata.prototype, "varBindings", { + get: function() { + return this.selector.split(','); + }, + enumerable: true, + configurable: true + }); + QueryMetadata.prototype.toString = function() { + return "@Query(" + lang_1.stringify(this.selector) + ")"; + }; + QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); + return QueryMetadata; + })(metadata_1.DependencyMetadata); + exports.QueryMetadata = QueryMetadata; + var ContentChildrenMetadata = (function(_super) { + __extends(ContentChildrenMetadata, _super); + function ContentChildrenMetadata(_selector, _a) { + var _b = (_a === void 0 ? {} : _a).descendants, + descendants = _b === void 0 ? false : _b; + _super.call(this, _selector, {descendants: descendants}); + } + ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); + return ContentChildrenMetadata; + })(QueryMetadata); + exports.ContentChildrenMetadata = ContentChildrenMetadata; + var ContentChildMetadata = (function(_super) { + __extends(ContentChildMetadata, _super); + function ContentChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); + return ContentChildMetadata; + })(QueryMetadata); + exports.ContentChildMetadata = ContentChildMetadata; + var ViewQueryMetadata = (function(_super) { + __extends(ViewQueryMetadata, _super); + function ViewQueryMetadata(_selector, _a) { + var _b = _a === void 0 ? {} : _a, + _c = _b.descendants, + descendants = _c === void 0 ? false : _c, + _d = _b.first, + first = _d === void 0 ? false : _d; + _super.call(this, _selector, { + descendants: descendants, + first: first + }); + } + Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { + get: function() { + return true; + }, + enumerable: true, + configurable: true + }); + ViewQueryMetadata.prototype.toString = function() { + return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; + }; + ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); + return ViewQueryMetadata; + })(QueryMetadata); + exports.ViewQueryMetadata = ViewQueryMetadata; + var ViewChildrenMetadata = (function(_super) { + __extends(ViewChildrenMetadata, _super); + function ViewChildrenMetadata(_selector) { + _super.call(this, _selector, {descendants: true}); + } + ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); + return ViewChildrenMetadata; + })(ViewQueryMetadata); + exports.ViewChildrenMetadata = ViewChildrenMetadata; + var ViewChildMetadata = (function(_super) { + __extends(ViewChildMetadata, _super); + function ViewChildMetadata(_selector) { + _super.call(this, _selector, { + descendants: true, + first: true + }); + } + ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); + return ViewChildMetadata; + })(ViewQueryMetadata); + exports.ViewChildMetadata = ViewChildMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); + var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); + var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); + var lang_1 = require("angular2/src/facade/lang"); + var ast_1 = require("angular2/src/core/change_detection/parser/ast"); + exports.ASTWithSource = ast_1.ASTWithSource; + exports.AST = ast_1.AST; + exports.AstTransformer = ast_1.AstTransformer; + exports.PropertyRead = ast_1.PropertyRead; + exports.LiteralArray = ast_1.LiteralArray; + exports.ImplicitReceiver = ast_1.ImplicitReceiver; + var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); + exports.Lexer = lexer_1.Lexer; + var parser_1 = require("angular2/src/core/change_detection/parser/parser"); + exports.Parser = parser_1.Parser; + var locals_1 = require("angular2/src/core/change_detection/parser/locals"); + exports.Locals = locals_1.Locals; + var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); + exports.DehydratedException = exceptions_1.DehydratedException; + exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; + var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); + exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; + exports.DebugContext = interfaces_1.DebugContext; + exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; + var constants_1 = require("angular2/src/core/change_detection/constants"); + exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; + exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; + var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); + exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; + var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); + exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; + var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); + exports.BindingRecord = binding_record_1.BindingRecord; + exports.BindingTarget = binding_record_1.BindingTarget; + var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); + exports.DirectiveIndex = directive_record_1.DirectiveIndex; + exports.DirectiveRecord = directive_record_1.DirectiveRecord; + var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); + exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; + var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); + exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; + var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); + exports.IterableDiffers = iterable_differs_2.IterableDiffers; + var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); + exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; + var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); + exports.WrappedValue = change_detection_util_1.WrappedValue; + exports.SimpleChange = change_detection_util_1.SimpleChange; + exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); + exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); + exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); + exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); + global.define = __define; + return module.exports; +}); + +System.register("@reactivex/rxjs/dist/cjs/Rx", ["@reactivex/rxjs/dist/cjs/Observable", "@reactivex/rxjs/dist/cjs/operators/combineLatest-static", "@reactivex/rxjs/dist/cjs/operators/concat-static", "@reactivex/rxjs/dist/cjs/observables/DeferObservable", "@reactivex/rxjs/dist/cjs/observables/EmptyObservable", "@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable", "@reactivex/rxjs/dist/cjs/observables/FromObservable", "@reactivex/rxjs/dist/cjs/observables/ArrayObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventObservable", "@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable", "@reactivex/rxjs/dist/cjs/observables/PromiseObservable", "@reactivex/rxjs/dist/cjs/observables/IntervalObservable", "@reactivex/rxjs/dist/cjs/operators/merge-static", "@reactivex/rxjs/dist/cjs/observables/InfiniteObservable", "@reactivex/rxjs/dist/cjs/observables/RangeObservable", "@reactivex/rxjs/dist/cjs/observables/ErrorObservable", "@reactivex/rxjs/dist/cjs/observables/TimerObservable", "@reactivex/rxjs/dist/cjs/operators/zip-static", "@reactivex/rxjs/dist/cjs/operators/buffer", "@reactivex/rxjs/dist/cjs/operators/bufferCount", "@reactivex/rxjs/dist/cjs/operators/bufferTime", "@reactivex/rxjs/dist/cjs/operators/bufferToggle", "@reactivex/rxjs/dist/cjs/operators/bufferWhen", "@reactivex/rxjs/dist/cjs/operators/catch", "@reactivex/rxjs/dist/cjs/operators/combineAll", "@reactivex/rxjs/dist/cjs/operators/combineLatest", "@reactivex/rxjs/dist/cjs/operators/concat", "@reactivex/rxjs/dist/cjs/operators/concatAll", "@reactivex/rxjs/dist/cjs/operators/concatMap", "@reactivex/rxjs/dist/cjs/operators/concatMapTo", "@reactivex/rxjs/dist/cjs/operators/count", "@reactivex/rxjs/dist/cjs/operators/dematerialize", "@reactivex/rxjs/dist/cjs/operators/debounce", "@reactivex/rxjs/dist/cjs/operators/debounceTime", "@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty", "@reactivex/rxjs/dist/cjs/operators/delay", "@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged", "@reactivex/rxjs/dist/cjs/operators/do", "@reactivex/rxjs/dist/cjs/operators/expand", "@reactivex/rxjs/dist/cjs/operators/filter", "@reactivex/rxjs/dist/cjs/operators/finally", "@reactivex/rxjs/dist/cjs/operators/first", "@reactivex/rxjs/dist/cjs/operators/groupBy", "@reactivex/rxjs/dist/cjs/operators/ignoreElements", "@reactivex/rxjs/dist/cjs/operators/every", "@reactivex/rxjs/dist/cjs/operators/last", "@reactivex/rxjs/dist/cjs/operators/map", "@reactivex/rxjs/dist/cjs/operators/mapTo", "@reactivex/rxjs/dist/cjs/operators/materialize", "@reactivex/rxjs/dist/cjs/operators/merge", "@reactivex/rxjs/dist/cjs/operators/mergeAll", "@reactivex/rxjs/dist/cjs/operators/mergeMap", "@reactivex/rxjs/dist/cjs/operators/mergeMapTo", "@reactivex/rxjs/dist/cjs/operators/multicast", "@reactivex/rxjs/dist/cjs/operators/observeOn", "@reactivex/rxjs/dist/cjs/operators/partition", "@reactivex/rxjs/dist/cjs/operators/publish", "@reactivex/rxjs/dist/cjs/operators/publishBehavior", "@reactivex/rxjs/dist/cjs/operators/publishReplay", "@reactivex/rxjs/dist/cjs/operators/reduce", "@reactivex/rxjs/dist/cjs/operators/repeat", "@reactivex/rxjs/dist/cjs/operators/retry", "@reactivex/rxjs/dist/cjs/operators/retryWhen", "@reactivex/rxjs/dist/cjs/operators/sample", "@reactivex/rxjs/dist/cjs/operators/sampleTime", "@reactivex/rxjs/dist/cjs/operators/scan", "@reactivex/rxjs/dist/cjs/operators/share", "@reactivex/rxjs/dist/cjs/operators/shareBehavior", "@reactivex/rxjs/dist/cjs/operators/shareReplay", "@reactivex/rxjs/dist/cjs/operators/single", "@reactivex/rxjs/dist/cjs/operators/skip", "@reactivex/rxjs/dist/cjs/operators/skipUntil", "@reactivex/rxjs/dist/cjs/operators/startWith", "@reactivex/rxjs/dist/cjs/operators/subscribeOn", "@reactivex/rxjs/dist/cjs/operators/switch", "@reactivex/rxjs/dist/cjs/operators/switchMap", "@reactivex/rxjs/dist/cjs/operators/switchMapTo", "@reactivex/rxjs/dist/cjs/operators/take", "@reactivex/rxjs/dist/cjs/operators/takeUntil", "@reactivex/rxjs/dist/cjs/operators/throttle", "@reactivex/rxjs/dist/cjs/operators/timeout", "@reactivex/rxjs/dist/cjs/operators/timeoutWith", "@reactivex/rxjs/dist/cjs/operators/toArray", "@reactivex/rxjs/dist/cjs/operators/toPromise", "@reactivex/rxjs/dist/cjs/operators/window", "@reactivex/rxjs/dist/cjs/operators/windowCount", "@reactivex/rxjs/dist/cjs/operators/windowTime", "@reactivex/rxjs/dist/cjs/operators/windowToggle", "@reactivex/rxjs/dist/cjs/operators/windowWhen", "@reactivex/rxjs/dist/cjs/operators/withLatestFrom", "@reactivex/rxjs/dist/cjs/operators/zip", "@reactivex/rxjs/dist/cjs/operators/zipAll", "@reactivex/rxjs/dist/cjs/Subject", "@reactivex/rxjs/dist/cjs/Subscription", "@reactivex/rxjs/dist/cjs/Subscriber", "@reactivex/rxjs/dist/cjs/subjects/ReplaySubject", "@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject", "@reactivex/rxjs/dist/cjs/observables/ConnectableObservable", "@reactivex/rxjs/dist/cjs/Notification", "@reactivex/rxjs/dist/cjs/util/EmptyError", "@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError", "@reactivex/rxjs/dist/cjs/schedulers/nextTick", "@reactivex/rxjs/dist/cjs/schedulers/immediate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + 'use strict'; + exports.__esModule = true; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {'default': obj}; + } + var _Observable = require("@reactivex/rxjs/dist/cjs/Observable"); + var _Observable2 = _interopRequireDefault(_Observable); + var _operatorsCombineLatestStatic = require("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"); + var _operatorsCombineLatestStatic2 = _interopRequireDefault(_operatorsCombineLatestStatic); + var _operatorsConcatStatic = require("@reactivex/rxjs/dist/cjs/operators/concat-static"); + var _operatorsConcatStatic2 = _interopRequireDefault(_operatorsConcatStatic); + var _observablesDeferObservable = require("@reactivex/rxjs/dist/cjs/observables/DeferObservable"); + var _observablesDeferObservable2 = _interopRequireDefault(_observablesDeferObservable); + var _observablesEmptyObservable = require("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"); + var _observablesEmptyObservable2 = _interopRequireDefault(_observablesEmptyObservable); + var _observablesForkJoinObservable = require("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"); + var _observablesForkJoinObservable2 = _interopRequireDefault(_observablesForkJoinObservable); + var _observablesFromObservable = require("@reactivex/rxjs/dist/cjs/observables/FromObservable"); + var _observablesFromObservable2 = _interopRequireDefault(_observablesFromObservable); + var _observablesArrayObservable = require("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"); + var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable); + var _observablesFromEventObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"); + var _observablesFromEventObservable2 = _interopRequireDefault(_observablesFromEventObservable); + var _observablesFromEventPatternObservable = require("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"); + var _observablesFromEventPatternObservable2 = _interopRequireDefault(_observablesFromEventPatternObservable); + var _observablesPromiseObservable = require("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"); + var _observablesPromiseObservable2 = _interopRequireDefault(_observablesPromiseObservable); + var _observablesIntervalObservable = require("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"); + var _observablesIntervalObservable2 = _interopRequireDefault(_observablesIntervalObservable); + var _operatorsMergeStatic = require("@reactivex/rxjs/dist/cjs/operators/merge-static"); + var _operatorsMergeStatic2 = _interopRequireDefault(_operatorsMergeStatic); + var _observablesInfiniteObservable = require("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"); + var _observablesInfiniteObservable2 = _interopRequireDefault(_observablesInfiniteObservable); + var _observablesRangeObservable = require("@reactivex/rxjs/dist/cjs/observables/RangeObservable"); + var _observablesRangeObservable2 = _interopRequireDefault(_observablesRangeObservable); + var _observablesErrorObservable = require("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"); + var _observablesErrorObservable2 = _interopRequireDefault(_observablesErrorObservable); + var _observablesTimerObservable = require("@reactivex/rxjs/dist/cjs/observables/TimerObservable"); + var _observablesTimerObservable2 = _interopRequireDefault(_observablesTimerObservable); + var _operatorsZipStatic = require("@reactivex/rxjs/dist/cjs/operators/zip-static"); + var _operatorsZipStatic2 = _interopRequireDefault(_operatorsZipStatic); + var _operatorsBuffer = require("@reactivex/rxjs/dist/cjs/operators/buffer"); + var _operatorsBuffer2 = _interopRequireDefault(_operatorsBuffer); + var _operatorsBufferCount = require("@reactivex/rxjs/dist/cjs/operators/bufferCount"); + var _operatorsBufferCount2 = _interopRequireDefault(_operatorsBufferCount); + var _operatorsBufferTime = require("@reactivex/rxjs/dist/cjs/operators/bufferTime"); + var _operatorsBufferTime2 = _interopRequireDefault(_operatorsBufferTime); + var _operatorsBufferToggle = require("@reactivex/rxjs/dist/cjs/operators/bufferToggle"); + var _operatorsBufferToggle2 = _interopRequireDefault(_operatorsBufferToggle); + var _operatorsBufferWhen = require("@reactivex/rxjs/dist/cjs/operators/bufferWhen"); + var _operatorsBufferWhen2 = _interopRequireDefault(_operatorsBufferWhen); + var _operatorsCatch = require("@reactivex/rxjs/dist/cjs/operators/catch"); + var _operatorsCatch2 = _interopRequireDefault(_operatorsCatch); + var _operatorsCombineAll = require("@reactivex/rxjs/dist/cjs/operators/combineAll"); + var _operatorsCombineAll2 = _interopRequireDefault(_operatorsCombineAll); + var _operatorsCombineLatest = require("@reactivex/rxjs/dist/cjs/operators/combineLatest"); + var _operatorsCombineLatest2 = _interopRequireDefault(_operatorsCombineLatest); + var _operatorsConcat = require("@reactivex/rxjs/dist/cjs/operators/concat"); + var _operatorsConcat2 = _interopRequireDefault(_operatorsConcat); + var _operatorsConcatAll = require("@reactivex/rxjs/dist/cjs/operators/concatAll"); + var _operatorsConcatAll2 = _interopRequireDefault(_operatorsConcatAll); + var _operatorsConcatMap = require("@reactivex/rxjs/dist/cjs/operators/concatMap"); + var _operatorsConcatMap2 = _interopRequireDefault(_operatorsConcatMap); + var _operatorsConcatMapTo = require("@reactivex/rxjs/dist/cjs/operators/concatMapTo"); + var _operatorsConcatMapTo2 = _interopRequireDefault(_operatorsConcatMapTo); + var _operatorsCount = require("@reactivex/rxjs/dist/cjs/operators/count"); + var _operatorsCount2 = _interopRequireDefault(_operatorsCount); + var _operatorsDematerialize = require("@reactivex/rxjs/dist/cjs/operators/dematerialize"); + var _operatorsDematerialize2 = _interopRequireDefault(_operatorsDematerialize); + var _operatorsDebounce = require("@reactivex/rxjs/dist/cjs/operators/debounce"); + var _operatorsDebounce2 = _interopRequireDefault(_operatorsDebounce); + var _operatorsDebounceTime = require("@reactivex/rxjs/dist/cjs/operators/debounceTime"); + var _operatorsDebounceTime2 = _interopRequireDefault(_operatorsDebounceTime); + var _operatorsDefaultIfEmpty = require("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"); + var _operatorsDefaultIfEmpty2 = _interopRequireDefault(_operatorsDefaultIfEmpty); + var _operatorsDelay = require("@reactivex/rxjs/dist/cjs/operators/delay"); + var _operatorsDelay2 = _interopRequireDefault(_operatorsDelay); + var _operatorsDistinctUntilChanged = require("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"); + var _operatorsDistinctUntilChanged2 = _interopRequireDefault(_operatorsDistinctUntilChanged); + var _operatorsDo = require("@reactivex/rxjs/dist/cjs/operators/do"); + var _operatorsDo2 = _interopRequireDefault(_operatorsDo); + var _operatorsExpand = require("@reactivex/rxjs/dist/cjs/operators/expand"); + var _operatorsExpand2 = _interopRequireDefault(_operatorsExpand); + var _operatorsFilter = require("@reactivex/rxjs/dist/cjs/operators/filter"); + var _operatorsFilter2 = _interopRequireDefault(_operatorsFilter); + var _operatorsFinally = require("@reactivex/rxjs/dist/cjs/operators/finally"); + var _operatorsFinally2 = _interopRequireDefault(_operatorsFinally); + var _operatorsFirst = require("@reactivex/rxjs/dist/cjs/operators/first"); + var _operatorsFirst2 = _interopRequireDefault(_operatorsFirst); + var _operatorsGroupBy = require("@reactivex/rxjs/dist/cjs/operators/groupBy"); + var _operatorsIgnoreElements = require("@reactivex/rxjs/dist/cjs/operators/ignoreElements"); + var _operatorsIgnoreElements2 = _interopRequireDefault(_operatorsIgnoreElements); + var _operatorsEvery = require("@reactivex/rxjs/dist/cjs/operators/every"); + var _operatorsEvery2 = _interopRequireDefault(_operatorsEvery); + var _operatorsLast = require("@reactivex/rxjs/dist/cjs/operators/last"); + var _operatorsLast2 = _interopRequireDefault(_operatorsLast); + var _operatorsMap = require("@reactivex/rxjs/dist/cjs/operators/map"); + var _operatorsMap2 = _interopRequireDefault(_operatorsMap); + var _operatorsMapTo = require("@reactivex/rxjs/dist/cjs/operators/mapTo"); + var _operatorsMapTo2 = _interopRequireDefault(_operatorsMapTo); + var _operatorsMaterialize = require("@reactivex/rxjs/dist/cjs/operators/materialize"); + var _operatorsMaterialize2 = _interopRequireDefault(_operatorsMaterialize); + var _operatorsMerge = require("@reactivex/rxjs/dist/cjs/operators/merge"); + var _operatorsMerge2 = _interopRequireDefault(_operatorsMerge); + var _operatorsMergeAll = require("@reactivex/rxjs/dist/cjs/operators/mergeAll"); + var _operatorsMergeAll2 = _interopRequireDefault(_operatorsMergeAll); + var _operatorsMergeMap = require("@reactivex/rxjs/dist/cjs/operators/mergeMap"); + var _operatorsMergeMap2 = _interopRequireDefault(_operatorsMergeMap); + var _operatorsMergeMapTo = require("@reactivex/rxjs/dist/cjs/operators/mergeMapTo"); + var _operatorsMergeMapTo2 = _interopRequireDefault(_operatorsMergeMapTo); + var _operatorsMulticast = require("@reactivex/rxjs/dist/cjs/operators/multicast"); + var _operatorsMulticast2 = _interopRequireDefault(_operatorsMulticast); + var _operatorsObserveOn = require("@reactivex/rxjs/dist/cjs/operators/observeOn"); + var _operatorsObserveOn2 = _interopRequireDefault(_operatorsObserveOn); + var _operatorsPartition = require("@reactivex/rxjs/dist/cjs/operators/partition"); + var _operatorsPartition2 = _interopRequireDefault(_operatorsPartition); + var _operatorsPublish = require("@reactivex/rxjs/dist/cjs/operators/publish"); + var _operatorsPublish2 = _interopRequireDefault(_operatorsPublish); + var _operatorsPublishBehavior = require("@reactivex/rxjs/dist/cjs/operators/publishBehavior"); + var _operatorsPublishBehavior2 = _interopRequireDefault(_operatorsPublishBehavior); + var _operatorsPublishReplay = require("@reactivex/rxjs/dist/cjs/operators/publishReplay"); + var _operatorsPublishReplay2 = _interopRequireDefault(_operatorsPublishReplay); + var _operatorsReduce = require("@reactivex/rxjs/dist/cjs/operators/reduce"); + var _operatorsReduce2 = _interopRequireDefault(_operatorsReduce); + var _operatorsRepeat = require("@reactivex/rxjs/dist/cjs/operators/repeat"); + var _operatorsRepeat2 = _interopRequireDefault(_operatorsRepeat); + var _operatorsRetry = require("@reactivex/rxjs/dist/cjs/operators/retry"); + var _operatorsRetry2 = _interopRequireDefault(_operatorsRetry); + var _operatorsRetryWhen = require("@reactivex/rxjs/dist/cjs/operators/retryWhen"); + var _operatorsRetryWhen2 = _interopRequireDefault(_operatorsRetryWhen); + var _operatorsSample = require("@reactivex/rxjs/dist/cjs/operators/sample"); + var _operatorsSample2 = _interopRequireDefault(_operatorsSample); + var _operatorsSampleTime = require("@reactivex/rxjs/dist/cjs/operators/sampleTime"); + var _operatorsSampleTime2 = _interopRequireDefault(_operatorsSampleTime); + var _operatorsScan = require("@reactivex/rxjs/dist/cjs/operators/scan"); + var _operatorsScan2 = _interopRequireDefault(_operatorsScan); + var _operatorsShare = require("@reactivex/rxjs/dist/cjs/operators/share"); + var _operatorsShare2 = _interopRequireDefault(_operatorsShare); + var _operatorsShareBehavior = require("@reactivex/rxjs/dist/cjs/operators/shareBehavior"); + var _operatorsShareBehavior2 = _interopRequireDefault(_operatorsShareBehavior); + var _operatorsShareReplay = require("@reactivex/rxjs/dist/cjs/operators/shareReplay"); + var _operatorsShareReplay2 = _interopRequireDefault(_operatorsShareReplay); + var _operatorsSingle = require("@reactivex/rxjs/dist/cjs/operators/single"); + var _operatorsSingle2 = _interopRequireDefault(_operatorsSingle); + var _operatorsSkip = require("@reactivex/rxjs/dist/cjs/operators/skip"); + var _operatorsSkip2 = _interopRequireDefault(_operatorsSkip); + var _operatorsSkipUntil = require("@reactivex/rxjs/dist/cjs/operators/skipUntil"); + var _operatorsSkipUntil2 = _interopRequireDefault(_operatorsSkipUntil); + var _operatorsStartWith = require("@reactivex/rxjs/dist/cjs/operators/startWith"); + var _operatorsStartWith2 = _interopRequireDefault(_operatorsStartWith); + var _operatorsSubscribeOn = require("@reactivex/rxjs/dist/cjs/operators/subscribeOn"); + var _operatorsSubscribeOn2 = _interopRequireDefault(_operatorsSubscribeOn); + var _operatorsSwitch = require("@reactivex/rxjs/dist/cjs/operators/switch"); + var _operatorsSwitch2 = _interopRequireDefault(_operatorsSwitch); + var _operatorsSwitchMap = require("@reactivex/rxjs/dist/cjs/operators/switchMap"); + var _operatorsSwitchMap2 = _interopRequireDefault(_operatorsSwitchMap); + var _operatorsSwitchMapTo = require("@reactivex/rxjs/dist/cjs/operators/switchMapTo"); + var _operatorsSwitchMapTo2 = _interopRequireDefault(_operatorsSwitchMapTo); + var _operatorsTake = require("@reactivex/rxjs/dist/cjs/operators/take"); + var _operatorsTake2 = _interopRequireDefault(_operatorsTake); + var _operatorsTakeUntil = require("@reactivex/rxjs/dist/cjs/operators/takeUntil"); + var _operatorsTakeUntil2 = _interopRequireDefault(_operatorsTakeUntil); + var _operatorsThrottle = require("@reactivex/rxjs/dist/cjs/operators/throttle"); + var _operatorsThrottle2 = _interopRequireDefault(_operatorsThrottle); + var _operatorsTimeout = require("@reactivex/rxjs/dist/cjs/operators/timeout"); + var _operatorsTimeout2 = _interopRequireDefault(_operatorsTimeout); + var _operatorsTimeoutWith = require("@reactivex/rxjs/dist/cjs/operators/timeoutWith"); + var _operatorsTimeoutWith2 = _interopRequireDefault(_operatorsTimeoutWith); + var _operatorsToArray = require("@reactivex/rxjs/dist/cjs/operators/toArray"); + var _operatorsToArray2 = _interopRequireDefault(_operatorsToArray); + var _operatorsToPromise = require("@reactivex/rxjs/dist/cjs/operators/toPromise"); + var _operatorsToPromise2 = _interopRequireDefault(_operatorsToPromise); + var _operatorsWindow = require("@reactivex/rxjs/dist/cjs/operators/window"); + var _operatorsWindow2 = _interopRequireDefault(_operatorsWindow); + var _operatorsWindowCount = require("@reactivex/rxjs/dist/cjs/operators/windowCount"); + var _operatorsWindowCount2 = _interopRequireDefault(_operatorsWindowCount); + var _operatorsWindowTime = require("@reactivex/rxjs/dist/cjs/operators/windowTime"); + var _operatorsWindowTime2 = _interopRequireDefault(_operatorsWindowTime); + var _operatorsWindowToggle = require("@reactivex/rxjs/dist/cjs/operators/windowToggle"); + var _operatorsWindowToggle2 = _interopRequireDefault(_operatorsWindowToggle); + var _operatorsWindowWhen = require("@reactivex/rxjs/dist/cjs/operators/windowWhen"); + var _operatorsWindowWhen2 = _interopRequireDefault(_operatorsWindowWhen); + var _operatorsWithLatestFrom = require("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"); + var _operatorsWithLatestFrom2 = _interopRequireDefault(_operatorsWithLatestFrom); + var _operatorsZip = require("@reactivex/rxjs/dist/cjs/operators/zip"); + var _operatorsZip2 = _interopRequireDefault(_operatorsZip); + var _operatorsZipAll = require("@reactivex/rxjs/dist/cjs/operators/zipAll"); + var _operatorsZipAll2 = _interopRequireDefault(_operatorsZipAll); + var _Subject = require("@reactivex/rxjs/dist/cjs/Subject"); + var _Subject2 = _interopRequireDefault(_Subject); + var _Subscription = require("@reactivex/rxjs/dist/cjs/Subscription"); + var _Subscription2 = _interopRequireDefault(_Subscription); + var _Subscriber = require("@reactivex/rxjs/dist/cjs/Subscriber"); + var _Subscriber2 = _interopRequireDefault(_Subscriber); + var _subjectsReplaySubject = require("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"); + var _subjectsReplaySubject2 = _interopRequireDefault(_subjectsReplaySubject); + var _subjectsBehaviorSubject = require("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"); + var _subjectsBehaviorSubject2 = _interopRequireDefault(_subjectsBehaviorSubject); + var _observablesConnectableObservable = require("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"); + var _observablesConnectableObservable2 = _interopRequireDefault(_observablesConnectableObservable); + var _Notification = require("@reactivex/rxjs/dist/cjs/Notification"); + var _Notification2 = _interopRequireDefault(_Notification); + var _utilEmptyError = require("@reactivex/rxjs/dist/cjs/util/EmptyError"); + var _utilEmptyError2 = _interopRequireDefault(_utilEmptyError); + var _utilArgumentOutOfRangeError = require("@reactivex/rxjs/dist/cjs/util/ArgumentOutOfRangeError"); + var _utilArgumentOutOfRangeError2 = _interopRequireDefault(_utilArgumentOutOfRangeError); + var _schedulersNextTick = require("@reactivex/rxjs/dist/cjs/schedulers/nextTick"); + var _schedulersNextTick2 = _interopRequireDefault(_schedulersNextTick); + var _schedulersImmediate = require("@reactivex/rxjs/dist/cjs/schedulers/immediate"); + var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate); + _Observable2['default'].combineLatest = _operatorsCombineLatestStatic2['default']; + _Observable2['default'].concat = _operatorsConcatStatic2['default']; + _Observable2['default'].defer = _observablesDeferObservable2['default'].create; + _Observable2['default'].empty = _observablesEmptyObservable2['default'].create; + _Observable2['default'].forkJoin = _observablesForkJoinObservable2['default'].create; + _Observable2['default'].from = _observablesFromObservable2['default'].create; + _Observable2['default'].fromArray = _observablesArrayObservable2['default'].create; + _Observable2['default'].fromEvent = _observablesFromEventObservable2['default'].create; + _Observable2['default'].fromEventPattern = _observablesFromEventPatternObservable2['default'].create; + _Observable2['default'].fromPromise = _observablesPromiseObservable2['default'].create; + _Observable2['default'].interval = _observablesIntervalObservable2['default'].create; + _Observable2['default'].merge = _operatorsMergeStatic2['default']; + _Observable2['default'].never = _observablesInfiniteObservable2['default'].create; + _Observable2['default'].of = _observablesArrayObservable2['default'].of; + _Observable2['default'].range = _observablesRangeObservable2['default'].create; + _Observable2['default']['throw'] = _observablesErrorObservable2['default'].create; + _Observable2['default'].timer = _observablesTimerObservable2['default'].create; + _Observable2['default'].zip = _operatorsZipStatic2['default']; + var observableProto = _Observable2['default'].prototype; + observableProto.buffer = _operatorsBuffer2['default']; + observableProto.bufferCount = _operatorsBufferCount2['default']; + observableProto.bufferTime = _operatorsBufferTime2['default']; + observableProto.bufferToggle = _operatorsBufferToggle2['default']; + observableProto.bufferWhen = _operatorsBufferWhen2['default']; + observableProto['catch'] = _operatorsCatch2['default']; + observableProto.combineAll = _operatorsCombineAll2['default']; + observableProto.combineLatest = _operatorsCombineLatest2['default']; + observableProto.concat = _operatorsConcat2['default']; + observableProto.concatAll = _operatorsConcatAll2['default']; + observableProto.concatMap = _operatorsConcatMap2['default']; + observableProto.concatMapTo = _operatorsConcatMapTo2['default']; + observableProto.count = _operatorsCount2['default']; + observableProto.dematerialize = _operatorsDematerialize2['default']; + observableProto.debounce = _operatorsDebounce2['default']; + observableProto.debounceTime = _operatorsDebounceTime2['default']; + observableProto.defaultIfEmpty = _operatorsDefaultIfEmpty2['default']; + observableProto.delay = _operatorsDelay2['default']; + observableProto.distinctUntilChanged = _operatorsDistinctUntilChanged2['default']; + observableProto['do'] = _operatorsDo2['default']; + observableProto.expand = _operatorsExpand2['default']; + observableProto.filter = _operatorsFilter2['default']; + observableProto['finally'] = _operatorsFinally2['default']; + observableProto.first = _operatorsFirst2['default']; + observableProto.groupBy = _operatorsGroupBy.groupBy; + observableProto.ignoreElements = _operatorsIgnoreElements2['default']; + observableProto.every = _operatorsEvery2['default']; + observableProto.last = _operatorsLast2['default']; + observableProto.map = _operatorsMap2['default']; + observableProto.mapTo = _operatorsMapTo2['default']; + observableProto.materialize = _operatorsMaterialize2['default']; + observableProto.merge = _operatorsMerge2['default']; + observableProto.mergeAll = _operatorsMergeAll2['default']; + observableProto.mergeMap = _operatorsMergeMap2['default']; + observableProto.flatMap = _operatorsMergeMap2['default']; + observableProto.mergeMapTo = _operatorsMergeMapTo2['default']; + observableProto.flatMapTo = _operatorsMergeMapTo2['default']; + observableProto.multicast = _operatorsMulticast2['default']; + observableProto.observeOn = _operatorsObserveOn2['default']; + observableProto.partition = _operatorsPartition2['default']; + observableProto.publish = _operatorsPublish2['default']; + observableProto.publishBehavior = _operatorsPublishBehavior2['default']; + observableProto.publishReplay = _operatorsPublishReplay2['default']; + observableProto.reduce = _operatorsReduce2['default']; + observableProto.repeat = _operatorsRepeat2['default']; + observableProto.retry = _operatorsRetry2['default']; + observableProto.retryWhen = _operatorsRetryWhen2['default']; + observableProto.sample = _operatorsSample2['default']; + observableProto.sampleTime = _operatorsSampleTime2['default']; + observableProto.scan = _operatorsScan2['default']; + observableProto.share = _operatorsShare2['default']; + observableProto.shareBehavior = _operatorsShareBehavior2['default']; + observableProto.shareReplay = _operatorsShareReplay2['default']; + observableProto.single = _operatorsSingle2['default']; + observableProto.skip = _operatorsSkip2['default']; + observableProto.skipUntil = _operatorsSkipUntil2['default']; + observableProto.startWith = _operatorsStartWith2['default']; + observableProto.subscribeOn = _operatorsSubscribeOn2['default']; + observableProto['switch'] = _operatorsSwitch2['default']; + observableProto.switchMap = _operatorsSwitchMap2['default']; + observableProto.switchMapTo = _operatorsSwitchMapTo2['default']; + observableProto.take = _operatorsTake2['default']; + observableProto.takeUntil = _operatorsTakeUntil2['default']; + observableProto.throttle = _operatorsThrottle2['default']; + observableProto.timeout = _operatorsTimeout2['default']; + observableProto.timeoutWith = _operatorsTimeoutWith2['default']; + observableProto.toArray = _operatorsToArray2['default']; + observableProto.toPromise = _operatorsToPromise2['default']; + observableProto.window = _operatorsWindow2['default']; + observableProto.windowCount = _operatorsWindowCount2['default']; + observableProto.windowTime = _operatorsWindowTime2['default']; + observableProto.windowToggle = _operatorsWindowToggle2['default']; + observableProto.windowWhen = _operatorsWindowWhen2['default']; + observableProto.withLatestFrom = _operatorsWithLatestFrom2['default']; + observableProto.zip = _operatorsZip2['default']; + observableProto.zipAll = _operatorsZipAll2['default']; + var Scheduler = { + nextTick: _schedulersNextTick2['default'], + immediate: _schedulersImmediate2['default'] + }; + exports.Subject = _Subject2['default']; + exports.Scheduler = Scheduler; + exports.Observable = _Observable2['default']; + exports.Subscriber = _Subscriber2['default']; + exports.Subscription = _Subscription2['default']; + exports.ReplaySubject = _subjectsReplaySubject2['default']; + exports.BehaviorSubject = _subjectsBehaviorSubject2['default']; + exports.ConnectableObservable = _observablesConnectableObservable2['default']; + exports.Notification = _Notification2['default']; + exports.EmptyError = _utilEmptyError2['default']; + exports.ArgumentOutOfRangeError = _utilArgumentOutOfRangeError2['default']; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/render/render", ["angular2/src/core/render/dom/shared_styles_host", "angular2/src/core/render/dom/dom_renderer", "angular2/src/core/render/dom/dom_tokens", "angular2/src/core/render/api"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/src/core/render/dom/shared_styles_host")); + __export(require("angular2/src/core/render/dom/dom_renderer")); + __export(require("angular2/src/core/render/dom/dom_tokens")); + __export(require("angular2/src/core/render/api")); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/command_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/compiler/app_root_url", "angular2/src/compiler/anchor_based_app_root_url", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); + var template_compiler_1 = require("angular2/src/compiler/template_compiler"); + exports.TemplateCompiler = template_compiler_1.TemplateCompiler; + var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); + exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; + exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; + exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; + var source_module_1 = require("angular2/src/compiler/source_module"); + exports.SourceModule = source_module_1.SourceModule; + exports.SourceWithImports = source_module_1.SourceWithImports; + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; + exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var template_parser_1 = require("angular2/src/compiler/template_parser"); + var html_parser_1 = require("angular2/src/compiler/html_parser"); + var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); + var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); + var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); + var style_compiler_1 = require("angular2/src/compiler/style_compiler"); + var command_compiler_1 = require("angular2/src/compiler/command_compiler"); + var template_compiler_2 = require("angular2/src/compiler/template_compiler"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); + var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); + var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); + var url_resolver_1 = require("angular2/src/compiler/url_resolver"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var anchor_based_app_root_url_1 = require("angular2/src/compiler/anchor_based_app_root_url"); + var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); + function compilerProviders() { + return [change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_1.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, style_compiler_1.StyleCompiler, command_compiler_1.CommandCompiler, change_detector_compiler_1.ChangeDetectionCompiler, di_1.provide(change_detection_1.ChangeDetectorGenConfig, {useValue: new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true)}), template_compiler_2.TemplateCompiler, di_1.provide(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), di_1.provide(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, di_1.provide(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), anchor_based_app_root_url_1.AnchorBasedAppRootUrl, di_1.provide(app_root_url_1.AppRootUrl, {useExisting: anchor_based_app_root_url_1.AnchorBasedAppRootUrl}), url_resolver_1.UrlResolver]; + } + exports.compilerProviders = compilerProviders; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/dom/parse5_adapter", ["parse5/index", "angular2/src/facade/collection", "angular2/src/core/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/compiler/selector", "angular2/src/compiler/xhr"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var parse5 = require("parse5/index"); + var parser = new parse5.Parser(parse5.TreeAdapters.htmlparser2); + var serializer = new parse5.Serializer(parse5.TreeAdapters.htmlparser2); + var treeAdapter = parser.treeAdapter; + var collection_1 = require("angular2/src/facade/collection"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var selector_1 = require("angular2/src/compiler/selector"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex' + }; + var defDoc = null; + var mapProps = ['attribs', 'x-attribsNamespace', 'x-attribsPrefix']; + function _notImplemented(methodName) { + return new exceptions_1.BaseException('This method is not implemented in Parse5DomAdapter: ' + methodName); + } + var Parse5DomAdapter = (function(_super) { + __extends(Parse5DomAdapter, _super); + function Parse5DomAdapter() { + _super.apply(this, arguments); + } + Parse5DomAdapter.makeCurrent = function() { + dom_adapter_1.setRootDomAdapter(new Parse5DomAdapter()); + }; + Parse5DomAdapter.prototype.hasProperty = function(element, name) { + return _HTMLElementPropertyList.indexOf(name) > -1; + }; + Parse5DomAdapter.prototype.setProperty = function(el, name, value) { + if (name === 'innerHTML') { + this.setInnerHTML(el, value); + } else if (name === 'className') { + el.attribs["class"] = el.className = value; + } else { + el[name] = value; + } + }; + Parse5DomAdapter.prototype.getProperty = function(el, name) { + return el[name]; + }; + Parse5DomAdapter.prototype.logError = function(error) { + console.error(error); + }; + Parse5DomAdapter.prototype.log = function(error) { + console.log(error); + }; + Parse5DomAdapter.prototype.logGroup = function(error) { + console.error(error); + }; + Parse5DomAdapter.prototype.logGroupEnd = function() {}; + Parse5DomAdapter.prototype.getXHR = function() { + return xhr_1.XHR; + }; + Object.defineProperty(Parse5DomAdapter.prototype, "attrToPropMap", { + get: function() { + return _attrToPropMap; + }, + enumerable: true, + configurable: true + }); + Parse5DomAdapter.prototype.query = function(selector) { + throw _notImplemented('query'); + }; + Parse5DomAdapter.prototype.querySelector = function(el, selector) { + return this.querySelectorAll(el, selector)[0]; + }; + Parse5DomAdapter.prototype.querySelectorAll = function(el, selector) { + var _this = this; + var res = []; + var _recursive = function(result, node, selector, matcher) { + var cNodes = node.childNodes; + if (cNodes && cNodes.length > 0) { + for (var i = 0; i < cNodes.length; i++) { + var childNode = cNodes[i]; + if (_this.elementMatches(childNode, selector, matcher)) { + result.push(childNode); + } + _recursive(result, childNode, selector, matcher); + } + } + }; + var matcher = new selector_1.SelectorMatcher(); + matcher.addSelectables(selector_1.CssSelector.parse(selector)); + _recursive(res, el, selector, matcher); + return res; + }; + Parse5DomAdapter.prototype.elementMatches = function(node, selector, matcher) { + if (matcher === void 0) { + matcher = null; + } + if (this.isElementNode(node) && selector === '*') { + return true; + } + var result = false; + if (selector && selector.charAt(0) == "#") { + result = this.getAttribute(node, 'id') == selector.substring(1); + } else if (selector) { + var result = false; + if (matcher == null) { + matcher = new selector_1.SelectorMatcher(); + matcher.addSelectables(selector_1.CssSelector.parse(selector)); + } + var cssSelector = new selector_1.CssSelector(); + cssSelector.setElement(this.tagName(node)); + if (node.attribs) { + for (var attrName in node.attribs) { + cssSelector.addAttribute(attrName, node.attribs[attrName]); + } + } + var classList = this.classList(node); + for (var i = 0; i < classList.length; i++) { + cssSelector.addClassName(classList[i]); + } + matcher.match(cssSelector, function(selector, cb) { + result = true; + }); + } + return result; + }; + Parse5DomAdapter.prototype.on = function(el, evt, listener) { + var listenersMap = el._eventListenersMap; + if (lang_1.isBlank(listenersMap)) { + var listenersMap = collection_1.StringMapWrapper.create(); + el._eventListenersMap = listenersMap; + } + var listeners = collection_1.StringMapWrapper.get(listenersMap, evt); + if (lang_1.isBlank(listeners)) { + listeners = []; + } + listeners.push(listener); + collection_1.StringMapWrapper.set(listenersMap, evt, listeners); + }; + Parse5DomAdapter.prototype.onAndCancel = function(el, evt, listener) { + this.on(el, evt, listener); + return function() { + collection_1.ListWrapper.remove(collection_1.StringMapWrapper.get(el._eventListenersMap, evt), listener); + }; + }; + Parse5DomAdapter.prototype.dispatchEvent = function(el, evt) { + if (lang_1.isBlank(evt.target)) { + evt.target = el; + } + if (lang_1.isPresent(el._eventListenersMap)) { + var listeners = collection_1.StringMapWrapper.get(el._eventListenersMap, evt.type); + if (lang_1.isPresent(listeners)) { + for (var i = 0; i < listeners.length; i++) { + listeners[i](evt); + } + } + } + if (lang_1.isPresent(el.parent)) { + this.dispatchEvent(el.parent, evt); + } + if (lang_1.isPresent(el._window)) { + this.dispatchEvent(el._window, evt); + } + }; + Parse5DomAdapter.prototype.createMouseEvent = function(eventType) { + return this.createEvent(eventType); + }; + Parse5DomAdapter.prototype.createEvent = function(eventType) { + var evt = { + type: eventType, + defaultPrevented: false, + preventDefault: function() { + evt.defaultPrevented = true; + } + }; + return evt; + }; + Parse5DomAdapter.prototype.preventDefault = function(evt) { + evt.returnValue = false; + }; + Parse5DomAdapter.prototype.isPrevented = function(evt) { + return lang_1.isPresent(evt.returnValue) && !evt.returnValue; + }; + Parse5DomAdapter.prototype.getInnerHTML = function(el) { + return serializer.serialize(this.templateAwareRoot(el)); + }; + Parse5DomAdapter.prototype.getOuterHTML = function(el) { + serializer.html = ''; + serializer._serializeElement(el); + return serializer.html; + }; + Parse5DomAdapter.prototype.nodeName = function(node) { + return node.tagName; + }; + Parse5DomAdapter.prototype.nodeValue = function(node) { + return node.nodeValue; + }; + Parse5DomAdapter.prototype.type = function(node) { + throw _notImplemented('type'); + }; + Parse5DomAdapter.prototype.content = function(node) { + return node.childNodes[0]; + }; + Parse5DomAdapter.prototype.firstChild = function(el) { + return el.firstChild; + }; + Parse5DomAdapter.prototype.nextSibling = function(el) { + return el.nextSibling; + }; + Parse5DomAdapter.prototype.parentElement = function(el) { + return el.parent; + }; + Parse5DomAdapter.prototype.childNodes = function(el) { + return el.childNodes; + }; + Parse5DomAdapter.prototype.childNodesAsList = function(el) { + var childNodes = el.childNodes; + var res = collection_1.ListWrapper.createFixedSize(childNodes.length); + for (var i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + Parse5DomAdapter.prototype.clearNodes = function(el) { + while (el.childNodes.length > 0) { + this.remove(el.childNodes[0]); + } + }; + Parse5DomAdapter.prototype.appendChild = function(el, node) { + this.remove(node); + treeAdapter.appendChild(this.templateAwareRoot(el), node); + }; + Parse5DomAdapter.prototype.removeChild = function(el, node) { + if (collection_1.ListWrapper.contains(el.childNodes, node)) { + this.remove(node); + } + }; + Parse5DomAdapter.prototype.remove = function(el) { + var parent = el.parent; + if (parent) { + var index = parent.childNodes.indexOf(el); + parent.childNodes.splice(index, 1); + } + var prev = el.previousSibling; + var next = el.nextSibling; + if (prev) { + prev.next = next; + } + if (next) { + next.prev = prev; + } + el.prev = null; + el.next = null; + el.parent = null; + return el; + }; + Parse5DomAdapter.prototype.insertBefore = function(el, node) { + this.remove(node); + treeAdapter.insertBefore(el.parent, node, el); + }; + Parse5DomAdapter.prototype.insertAllBefore = function(el, nodes) { + var _this = this; + nodes.forEach(function(n) { + return _this.insertBefore(el, n); + }); + }; + Parse5DomAdapter.prototype.insertAfter = function(el, node) { + if (el.nextSibling) { + this.insertBefore(el.nextSibling, node); + } else { + this.appendChild(el.parent, node); + } + }; + Parse5DomAdapter.prototype.setInnerHTML = function(el, value) { + this.clearNodes(el); + var content = parser.parseFragment(value); + for (var i = 0; i < content.childNodes.length; i++) { + treeAdapter.appendChild(el, content.childNodes[i]); + } + }; + Parse5DomAdapter.prototype.getText = function(el) { + if (this.isTextNode(el)) { + return el.data; + } else if (lang_1.isBlank(el.childNodes) || el.childNodes.length == 0) { + return ""; + } else { + var textContent = ""; + for (var i = 0; i < el.childNodes.length; i++) { + textContent += this.getText(el.childNodes[i]); + } + return textContent; + } + }; + Parse5DomAdapter.prototype.setText = function(el, value) { + if (this.isTextNode(el)) { + el.data = value; + } else { + this.clearNodes(el); + if (value !== '') + treeAdapter.insertText(el, value); + } + }; + Parse5DomAdapter.prototype.getValue = function(el) { + return el.value; + }; + Parse5DomAdapter.prototype.setValue = function(el, value) { + el.value = value; + }; + Parse5DomAdapter.prototype.getChecked = function(el) { + return el.checked; + }; + Parse5DomAdapter.prototype.setChecked = function(el, value) { + el.checked = value; + }; + Parse5DomAdapter.prototype.createComment = function(text) { + return treeAdapter.createCommentNode(text); + }; + Parse5DomAdapter.prototype.createTemplate = function(html) { + var template = treeAdapter.createElement("template", 'http://www.w3.org/1999/xhtml', []); + var content = parser.parseFragment(html); + treeAdapter.appendChild(template, content); + return template; + }; + Parse5DomAdapter.prototype.createElement = function(tagName) { + return treeAdapter.createElement(tagName, 'http://www.w3.org/1999/xhtml', []); + }; + Parse5DomAdapter.prototype.createElementNS = function(ns, tagName) { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.createTextNode = function(text) { + var t = this.createComment(text); + t.type = 'text'; + return t; + }; + Parse5DomAdapter.prototype.createScriptTag = function(attrName, attrValue) { + return treeAdapter.createElement("script", 'http://www.w3.org/1999/xhtml', [{ + name: attrName, + value: attrValue + }]); + }; + Parse5DomAdapter.prototype.createStyleElement = function(css) { + var style = this.createElement('style'); + this.setText(style, css); + return style; + }; + Parse5DomAdapter.prototype.createShadowRoot = function(el) { + el.shadowRoot = treeAdapter.createDocumentFragment(); + el.shadowRoot.parent = el; + return el.shadowRoot; + }; + Parse5DomAdapter.prototype.getShadowRoot = function(el) { + return el.shadowRoot; + }; + Parse5DomAdapter.prototype.getHost = function(el) { + return el.host; + }; + Parse5DomAdapter.prototype.getDistributedNodes = function(el) { + throw _notImplemented('getDistributedNodes'); + }; + Parse5DomAdapter.prototype.clone = function(node) { + var _recursive = function(node) { + var nodeClone = Object.create(Object.getPrototypeOf(node)); + for (var prop in node) { + var desc = Object.getOwnPropertyDescriptor(node, prop); + if (desc && 'value' in desc && typeof desc.value !== 'object') { + nodeClone[prop] = node[prop]; + } + } + nodeClone.parent = null; + nodeClone.prev = null; + nodeClone.next = null; + nodeClone.children = null; + mapProps.forEach(function(mapName) { + if (lang_1.isPresent(node[mapName])) { + nodeClone[mapName] = {}; + for (var prop in node[mapName]) { + nodeClone[mapName][prop] = node[mapName][prop]; + } + } + }); + var cNodes = node.children; + if (cNodes) { + var cNodesClone = new Array(cNodes.length); + for (var i = 0; i < cNodes.length; i++) { + var childNode = cNodes[i]; + var childNodeClone = _recursive(childNode); + cNodesClone[i] = childNodeClone; + if (i > 0) { + childNodeClone.prev = cNodesClone[i - 1]; + cNodesClone[i - 1].next = childNodeClone; + } + childNodeClone.parent = nodeClone; + } + nodeClone.children = cNodesClone; + } + return nodeClone; + }; + return _recursive(node); + }; + Parse5DomAdapter.prototype.getElementsByClassName = function(element, name) { + return this.querySelectorAll(element, "." + name); + }; + Parse5DomAdapter.prototype.getElementsByTagName = function(element, name) { + throw _notImplemented('getElementsByTagName'); + }; + Parse5DomAdapter.prototype.classList = function(element) { + var classAttrValue = null; + var attributes = element.attribs; + if (attributes && attributes.hasOwnProperty("class")) { + classAttrValue = attributes["class"]; + } + return classAttrValue ? classAttrValue.trim().split(/\s+/g) : []; + }; + Parse5DomAdapter.prototype.addClass = function(element, classname) { + var classList = this.classList(element); + var index = classList.indexOf(classname); + if (index == -1) { + classList.push(classname); + element.attribs["class"] = element.className = classList.join(" "); + } + }; + Parse5DomAdapter.prototype.removeClass = function(element, classname) { + var classList = this.classList(element); + var index = classList.indexOf(classname); + if (index > -1) { + classList.splice(index, 1); + element.attribs["class"] = element.className = classList.join(" "); + } + }; + Parse5DomAdapter.prototype.hasClass = function(element, classname) { + return collection_1.ListWrapper.contains(this.classList(element), classname); + }; + Parse5DomAdapter.prototype._readStyleAttribute = function(element) { + var styleMap = {}; + var attributes = element.attribs; + if (attributes && attributes.hasOwnProperty("style")) { + var styleAttrValue = attributes["style"]; + var styleList = styleAttrValue.split(/;+/g); + for (var i = 0; i < styleList.length; i++) { + if (styleList[i].length > 0) { + var elems = styleList[i].split(/:+/g); + styleMap[elems[0].trim()] = elems[1].trim(); + } + } + } + return styleMap; + }; + Parse5DomAdapter.prototype._writeStyleAttribute = function(element, styleMap) { + var styleAttrValue = ""; + for (var key in styleMap) { + var newValue = styleMap[key]; + if (newValue && newValue.length > 0) { + styleAttrValue += key + ":" + styleMap[key] + ";"; + } + } + element.attribs["style"] = styleAttrValue; + }; + Parse5DomAdapter.prototype.setStyle = function(element, stylename, stylevalue) { + var styleMap = this._readStyleAttribute(element); + styleMap[stylename] = stylevalue; + this._writeStyleAttribute(element, styleMap); + }; + Parse5DomAdapter.prototype.removeStyle = function(element, stylename) { + this.setStyle(element, stylename, null); + }; + Parse5DomAdapter.prototype.getStyle = function(element, stylename) { + var styleMap = this._readStyleAttribute(element); + return styleMap.hasOwnProperty(stylename) ? styleMap[stylename] : ""; + }; + Parse5DomAdapter.prototype.tagName = function(element) { + return element.tagName == "style" ? "STYLE" : element.tagName; + }; + Parse5DomAdapter.prototype.attributeMap = function(element) { + var res = new Map(); + var elAttrs = treeAdapter.getAttrList(element); + for (var i = 0; i < elAttrs.length; i++) { + var attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + Parse5DomAdapter.prototype.hasAttribute = function(element, attribute) { + return element.attribs && element.attribs.hasOwnProperty(attribute); + }; + Parse5DomAdapter.prototype.getAttribute = function(element, attribute) { + return element.attribs && element.attribs.hasOwnProperty(attribute) ? element.attribs[attribute] : null; + }; + Parse5DomAdapter.prototype.setAttribute = function(element, attribute, value) { + if (attribute) { + element.attribs[attribute] = value; + if (attribute === 'class') { + element.className = value; + } + } + }; + Parse5DomAdapter.prototype.setAttributeNS = function(element, ns, attribute, value) { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.removeAttribute = function(element, attribute) { + if (attribute) { + collection_1.StringMapWrapper.delete(element.attribs, attribute); + } + }; + Parse5DomAdapter.prototype.templateAwareRoot = function(el) { + return this.isTemplateElement(el) ? this.content(el) : el; + }; + Parse5DomAdapter.prototype.createHtmlDocument = function() { + var newDoc = treeAdapter.createDocument(); + newDoc.title = "fake title"; + var head = treeAdapter.createElement("head", null, []); + var body = treeAdapter.createElement("body", 'http://www.w3.org/1999/xhtml', []); + this.appendChild(newDoc, head); + this.appendChild(newDoc, body); + collection_1.StringMapWrapper.set(newDoc, "head", head); + collection_1.StringMapWrapper.set(newDoc, "body", body); + collection_1.StringMapWrapper.set(newDoc, "_window", collection_1.StringMapWrapper.create()); + return newDoc; + }; + Parse5DomAdapter.prototype.defaultDoc = function() { + if (defDoc === null) { + defDoc = this.createHtmlDocument(); + } + return defDoc; + }; + Parse5DomAdapter.prototype.getBoundingClientRect = function(el) { + return { + left: 0, + top: 0, + width: 0, + height: 0 + }; + }; + Parse5DomAdapter.prototype.getTitle = function() { + return this.defaultDoc().title || ""; + }; + Parse5DomAdapter.prototype.setTitle = function(newTitle) { + this.defaultDoc().title = newTitle; + }; + Parse5DomAdapter.prototype.isTemplateElement = function(el) { + return this.isElementNode(el) && this.tagName(el) === "template"; + }; + Parse5DomAdapter.prototype.isTextNode = function(node) { + return treeAdapter.isTextNode(node); + }; + Parse5DomAdapter.prototype.isCommentNode = function(node) { + return treeAdapter.isCommentNode(node); + }; + Parse5DomAdapter.prototype.isElementNode = function(node) { + return node ? treeAdapter.isElementNode(node) : false; + }; + Parse5DomAdapter.prototype.hasShadowRoot = function(node) { + return lang_1.isPresent(node.shadowRoot); + }; + Parse5DomAdapter.prototype.isShadowRoot = function(node) { + return this.getShadowRoot(node) == node; + }; + Parse5DomAdapter.prototype.importIntoDoc = function(node) { + return this.clone(node); + }; + Parse5DomAdapter.prototype.adoptNode = function(node) { + return node; + }; + Parse5DomAdapter.prototype.getHref = function(el) { + return el.href; + }; + Parse5DomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { + if (href == null) { + el.href = baseUrl; + } else { + el.href = baseUrl + '/../' + href; + } + }; + Parse5DomAdapter.prototype._buildRules = function(parsedRules, css) { + var rules = []; + for (var i = 0; i < parsedRules.length; i++) { + var parsedRule = parsedRules[i]; + var rule = collection_1.StringMapWrapper.create(); + collection_1.StringMapWrapper.set(rule, "cssText", css); + collection_1.StringMapWrapper.set(rule, "style", { + content: "", + cssText: "" + }); + if (parsedRule.type == "rule") { + collection_1.StringMapWrapper.set(rule, "type", 1); + collection_1.StringMapWrapper.set(rule, "selectorText", parsedRule.selectors.join(", ").replace(/\s{2,}/g, " ").replace(/\s*~\s*/g, " ~ ").replace(/\s*\+\s*/g, " + ").replace(/\s*>\s*/g, " > ").replace(/\[(\w+)=(\w+)\]/g, '[$1="$2"]')); + if (lang_1.isBlank(parsedRule.declarations)) { + continue; + } + for (var j = 0; j < parsedRule.declarations.length; j++) { + var declaration = parsedRule.declarations[j]; + collection_1.StringMapWrapper.set(collection_1.StringMapWrapper.get(rule, "style"), declaration.property, declaration.value); + collection_1.StringMapWrapper.get(rule, "style").cssText += declaration.property + ": " + declaration.value + ";"; + } + } else if (parsedRule.type == "media") { + collection_1.StringMapWrapper.set(rule, "type", 4); + collection_1.StringMapWrapper.set(rule, "media", {mediaText: parsedRule.media}); + if (parsedRule.rules) { + collection_1.StringMapWrapper.set(rule, "cssRules", this._buildRules(parsedRule.rules)); + } + } + rules.push(rule); + } + return rules; + }; + Parse5DomAdapter.prototype.supportsDOMEvents = function() { + return false; + }; + Parse5DomAdapter.prototype.supportsNativeShadowDOM = function() { + return false; + }; + Parse5DomAdapter.prototype.getGlobalEventTarget = function(target) { + if (target == "window") { + return this.defaultDoc()._window; + } else if (target == "document") { + return this.defaultDoc(); + } else if (target == "body") { + return this.defaultDoc().body; + } + }; + Parse5DomAdapter.prototype.getBaseHref = function() { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.resetBaseElement = function() { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.getHistory = function() { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.getLocation = function() { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.getUserAgent = function() { + return "Fake user agent"; + }; + Parse5DomAdapter.prototype.getData = function(el, name) { + return this.getAttribute(el, 'data-' + name); + }; + Parse5DomAdapter.prototype.getComputedStyle = function(el) { + throw 'not implemented'; + }; + Parse5DomAdapter.prototype.setData = function(el, name, value) { + this.setAttribute(el, 'data-' + name, value); + }; + Parse5DomAdapter.prototype.setGlobalVar = function(path, value) { + lang_1.setValueOnPath(lang_1.global, path, value); + }; + Parse5DomAdapter.prototype.requestAnimationFrame = function(callback) { + return setTimeout(callback, 0); + }; + Parse5DomAdapter.prototype.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; + Parse5DomAdapter.prototype.performanceNow = function() { + return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + }; + Parse5DomAdapter.prototype.getAnimationPrefix = function() { + return ''; + }; + Parse5DomAdapter.prototype.getTransitionEnd = function() { + return 'transitionend'; + }; + Parse5DomAdapter.prototype.supportsAnimation = function() { + return true; + }; + Parse5DomAdapter.prototype.replaceChild = function(el, newNode, oldNode) { + throw new Error('not implemented'); + }; + Parse5DomAdapter.prototype.parse = function(templateHtml) { + throw new Error('not implemented'); + }; + Parse5DomAdapter.prototype.invoke = function(el, methodName, args) { + throw new Error('not implemented'); + }; + Parse5DomAdapter.prototype.getEventKey = function(event) { + throw new Error('not implemented'); + }; + return Parse5DomAdapter; + })(dom_adapter_1.DomAdapter); + exports.Parse5DomAdapter = Parse5DomAdapter; + var _HTMLElementPropertyList = ["webkitEntries", "incremental", "webkitdirectory", "selectionDirection", "selectionEnd", "selectionStart", "labels", "validationMessage", "validity", "willValidate", "width", "valueAsNumber", "valueAsDate", "value", "useMap", "defaultValue", "type", "step", "src", "size", "required", "readOnly", "placeholder", "pattern", "name", "multiple", "min", "minLength", "maxLength", "max", "list", "indeterminate", "height", "formTarget", "formNoValidate", "formMethod", "formEnctype", "formAction", "files", "form", "disabled", "dirName", "checked", "defaultChecked", "autofocus", "autocomplete", "alt", "align", "accept", "onautocompleteerror", "onautocomplete", "onwaiting", "onvolumechange", "ontoggle", "ontimeupdate", "onsuspend", "onsubmit", "onstalled", "onshow", "onselect", "onseeking", "onseeked", "onscroll", "onresize", "onreset", "onratechange", "onprogress", "onplaying", "onplay", "onpause", "onmousewheel", "onmouseup", "onmouseover", "onmouseout", "onmousemove", "onmouseleave", "onmouseenter", "onmousedown", "onloadstart", "onloadedmetadata", "onloadeddata", "onload", "onkeyup", "onkeypress", "onkeydown", "oninvalid", "oninput", "onfocus", "onerror", "onended", "onemptied", "ondurationchange", "ondrop", "ondragstart", "ondragover", "ondragleave", "ondragenter", "ondragend", "ondrag", "ondblclick", "oncuechange", "oncontextmenu", "onclose", "onclick", "onchange", "oncanplaythrough", "oncanplay", "oncancel", "onblur", "onabort", "spellcheck", "isContentEditable", "contentEditable", "outerText", "innerText", "accessKey", "hidden", "webkitdropzone", "draggable", "tabIndex", "dir", "translate", "lang", "title", "childElementCount", "lastElementChild", "firstElementChild", "children", "onwebkitfullscreenerror", "onwebkitfullscreenchange", "nextElementSibling", "previousElementSibling", "onwheel", "onselectstart", "onsearch", "onpaste", "oncut", "oncopy", "onbeforepaste", "onbeforecut", "onbeforecopy", "shadowRoot", "dataset", "classList", "className", "outerHTML", "innerHTML", "scrollHeight", "scrollWidth", "scrollTop", "scrollLeft", "clientHeight", "clientWidth", "clientTop", "clientLeft", "offsetParent", "offsetHeight", "offsetWidth", "offsetTop", "offsetLeft", "localName", "prefix", "namespaceURI", "id", "style", "attributes", "tagName", "parentElement", "textContent", "baseURI", "ownerDocument", "nextSibling", "previousSibling", "lastChild", "firstChild", "childNodes", "parentNode", "nodeType", "nodeValue", "nodeName", "closure_lm_714617", "__jsaction"]; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; + exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; + exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; + exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; + exports.WrappedValue = change_detection_1.WrappedValue; + exports.SimpleChange = change_detection_1.SimpleChange; + exports.IterableDiffers = change_detection_1.IterableDiffers; + exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "@reactivex/rxjs/dist/cjs/Rx", "@reactivex/rxjs/dist/cjs/Rx"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var lang_1 = require("angular2/src/facade/lang"); + var promise_1 = require("angular2/src/facade/promise"); + exports.PromiseWrapper = promise_1.PromiseWrapper; + exports.Promise = promise_1.Promise; + var Rx_1 = require("@reactivex/rxjs/dist/cjs/Rx"); + var Rx_2 = require("@reactivex/rxjs/dist/cjs/Rx"); + exports.Subject = Rx_2.Subject; + var TimerWrapper = (function() { + function TimerWrapper() {} + TimerWrapper.setTimeout = function(fn, millis) { + return lang_1.global.setTimeout(fn, millis); + }; + TimerWrapper.clearTimeout = function(id) { + lang_1.global.clearTimeout(id); + }; + TimerWrapper.setInterval = function(fn, millis) { + return lang_1.global.setInterval(fn, millis); + }; + TimerWrapper.clearInterval = function(id) { + lang_1.global.clearInterval(id); + }; + return TimerWrapper; + })(); + exports.TimerWrapper = TimerWrapper; + var ObservableWrapper = (function() { + function ObservableWrapper() {} + ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { + if (onComplete === void 0) { + onComplete = function() {}; + } + return emitter.subscribe({ + next: onNext, + error: onError, + complete: onComplete + }); + }; + ObservableWrapper.isObservable = function(obs) { + return obs instanceof Rx_1.Observable; + }; + ObservableWrapper.hasSubscribers = function(obs) { + return obs.observers.length > 0; + }; + ObservableWrapper.dispose = function(subscription) { + subscription.unsubscribe(); + }; + ObservableWrapper.callNext = function(emitter, value) { + emitter.next(value); + }; + ObservableWrapper.callError = function(emitter, error) { + emitter.error(error); + }; + ObservableWrapper.callComplete = function(emitter) { + emitter.complete(); + }; + ObservableWrapper.fromPromise = function(promise) { + return Rx_1.Observable.fromPromise(promise); + }; + ObservableWrapper.toPromise = function(obj) { + return obj.toPromise(); + }; + return ObservableWrapper; + })(); + exports.ObservableWrapper = ObservableWrapper; + var EventEmitter = (function(_super) { + __extends(EventEmitter, _super); + function EventEmitter(isAsync) { + if (isAsync === void 0) { + isAsync = true; + } + _super.call(this); + this._isAsync = isAsync; + } + EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { + if (generatorOrNext && typeof generatorOrNext === 'object') { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext.next(value); + }); + } : function(value) { + generatorOrNext.next(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return generatorOrNext.error ? generatorOrNext.error(err) : null; + }, function() { + return generatorOrNext.complete ? generatorOrNext.complete() : null; + }); + } else { + var schedulerFn = this._isAsync ? function(value) { + setTimeout(function() { + return generatorOrNext(value); + }); + } : function(value) { + generatorOrNext(value); + }; + return _super.prototype.subscribe.call(this, schedulerFn, function(err) { + return error ? error(err) : null; + }, function() { + return complete ? complete() : null; + }); + } + }; + return EventEmitter; + })(Rx_1.Subject); + exports.EventEmitter = EventEmitter; + var Observable = (function(_super) { + __extends(Observable, _super); + function Observable() { + _super.apply(this, arguments); + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + return Observable; + })(Rx_1.Observable); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/template_commands", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/render", "angular2/src/core/metadata", "angular2/src/core/metadata"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var render_1 = require("angular2/src/core/render/render"); + var metadata_1 = require("angular2/src/core/metadata"); + var metadata_2 = require("angular2/src/core/metadata"); + exports.ViewEncapsulation = metadata_2.ViewEncapsulation; + var CompiledHostTemplate = (function() { + function CompiledHostTemplate(template) { + this.template = template; + } + CompiledHostTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [CompiledComponentTemplate])], CompiledHostTemplate); + return CompiledHostTemplate; + })(); + exports.CompiledHostTemplate = CompiledHostTemplate; + var CompiledComponentTemplate = (function() { + function CompiledComponentTemplate(id, changeDetectorFactory, commands, styles) { + this.id = id; + this.changeDetectorFactory = changeDetectorFactory; + this.commands = commands; + this.styles = styles; + } + CompiledComponentTemplate = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function, Array, Array])], CompiledComponentTemplate); + return CompiledComponentTemplate; + })(); + exports.CompiledComponentTemplate = CompiledComponentTemplate; + var EMPTY_ARR = lang_1.CONST_EXPR([]); + var TextCmd = (function() { + function TextCmd(value, isBound, ngContentIndex) { + this.value = value; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + TextCmd.prototype.visit = function(visitor, context) { + return visitor.visitText(this, context); + }; + TextCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Boolean, Number])], TextCmd); + return TextCmd; + })(); + exports.TextCmd = TextCmd; + var NgContentCmd = (function() { + function NgContentCmd(index, ngContentIndex) { + this.index = index; + this.ngContentIndex = ngContentIndex; + this.isBound = false; + } + NgContentCmd.prototype.visit = function(visitor, context) { + return visitor.visitNgContent(this, context); + }; + NgContentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Number, Number])], NgContentCmd); + return NgContentCmd; + })(); + exports.NgContentCmd = NgContentCmd; + var IBeginElementCmd = (function(_super) { + __extends(IBeginElementCmd, _super); + function IBeginElementCmd() { + _super.apply(this, arguments); + } + Object.defineProperty(IBeginElementCmd.prototype, "variableNameAndValues", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "eventTargetAndNames", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(IBeginElementCmd.prototype, "directives", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + return IBeginElementCmd; + })(render_1.RenderBeginElementCmd); + exports.IBeginElementCmd = IBeginElementCmd; + var BeginElementCmd = (function() { + function BeginElementCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, isBound, ngContentIndex) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isBound = isBound; + this.ngContentIndex = ngContentIndex; + } + BeginElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginElement(this, context); + }; + BeginElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Boolean, Number])], BeginElementCmd); + return BeginElementCmd; + })(); + exports.BeginElementCmd = BeginElementCmd; + var EndElementCmd = (function() { + function EndElementCmd() {} + EndElementCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndElement(context); + }; + EndElementCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndElementCmd); + return EndElementCmd; + })(); + exports.EndElementCmd = EndElementCmd; + var BeginComponentCmd = (function() { + function BeginComponentCmd(name, attrNameAndValues, eventTargetAndNames, variableNameAndValues, directives, encapsulation, ngContentIndex, templateGetter) { + this.name = name; + this.attrNameAndValues = attrNameAndValues; + this.eventTargetAndNames = eventTargetAndNames; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.encapsulation = encapsulation; + this.ngContentIndex = ngContentIndex; + this.templateGetter = templateGetter; + this.isBound = true; + } + Object.defineProperty(BeginComponentCmd.prototype, "templateId", { + get: function() { + return this.templateGetter().id; + }, + enumerable: true, + configurable: true + }); + BeginComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitBeginComponent(this, context); + }; + BeginComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array, Array, Array, Array, Number, Number, Function])], BeginComponentCmd); + return BeginComponentCmd; + })(); + exports.BeginComponentCmd = BeginComponentCmd; + var EndComponentCmd = (function() { + function EndComponentCmd() {} + EndComponentCmd.prototype.visit = function(visitor, context) { + return visitor.visitEndComponent(context); + }; + EndComponentCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], EndComponentCmd); + return EndComponentCmd; + })(); + exports.EndComponentCmd = EndComponentCmd; + var EmbeddedTemplateCmd = (function() { + function EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged, ngContentIndex, changeDetectorFactory, children) { + this.attrNameAndValues = attrNameAndValues; + this.variableNameAndValues = variableNameAndValues; + this.directives = directives; + this.isMerged = isMerged; + this.ngContentIndex = ngContentIndex; + this.changeDetectorFactory = changeDetectorFactory; + this.children = children; + this.isBound = true; + this.name = null; + this.eventTargetAndNames = EMPTY_ARR; + } + EmbeddedTemplateCmd.prototype.visit = function(visitor, context) { + return visitor.visitEmbeddedTemplate(this, context); + }; + EmbeddedTemplateCmd = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array, Array, Array, Boolean, Number, Function, Array])], EmbeddedTemplateCmd); + return EmbeddedTemplateCmd; + })(); + exports.EmbeddedTemplateCmd = EmbeddedTemplateCmd; + function visitAllCommands(visitor, cmds, context) { + if (context === void 0) { + context = null; + } + for (var i = 0; i < cmds.length; i++) { + cmds[i].visit(visitor, context); + } + } + exports.visitAllCommands = visitAllCommands; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/application_common", ["angular2/src/core/di", "angular2/src/common/forms", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/web_workers/worker/xhr_impl", "angular2/src/compiler/app_root_url", "angular2/src/web_workers/worker/renderer", "angular2/src/core/render/api", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/web_workers/shared/service_message_broker", "angular2/src/web_workers/shared/message_bus", "angular2/src/core/application_ref", "angular2/src/web_workers/shared/serializer", "angular2/src/web_workers/shared/api", "angular2/src/web_workers/shared/render_proto_view_ref_store", "angular2/src/web_workers/shared/render_view_with_fragments_store", "angular2/src/facade/async", "angular2/src/web_workers/shared/messaging_api", "angular2/src/web_workers/worker/event_dispatcher", "angular2/src/compiler/compiler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/di"); + var forms_1 = require("angular2/src/common/forms"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var xhr_1 = require("angular2/src/compiler/xhr"); + var xhr_impl_1 = require("angular2/src/web_workers/worker/xhr_impl"); + var app_root_url_1 = require("angular2/src/compiler/app_root_url"); + var renderer_1 = require("angular2/src/web_workers/worker/renderer"); + var api_1 = require("angular2/src/core/render/api"); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + var message_bus_1 = require("angular2/src/web_workers/shared/message_bus"); + var application_ref_1 = require("angular2/src/core/application_ref"); + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + var api_2 = require("angular2/src/web_workers/shared/api"); + var render_proto_view_ref_store_1 = require("angular2/src/web_workers/shared/render_proto_view_ref_store"); + var render_view_with_fragments_store_1 = require("angular2/src/web_workers/shared/render_view_with_fragments_store"); + var async_2 = require("angular2/src/facade/async"); + var messaging_api_1 = require("angular2/src/web_workers/shared/messaging_api"); + var event_dispatcher_1 = require("angular2/src/web_workers/worker/event_dispatcher"); + var compiler_1 = require("angular2/src/compiler/compiler"); + function platform(bindings) { + return application_ref_1.platformCommon(bindings); + } + exports.platform = platform; + var PrintLogger = (function() { + function PrintLogger() { + this.log = lang_1.print; + this.logError = lang_1.print; + this.logGroup = lang_1.print; + } + PrintLogger.prototype.logGroupEnd = function() {}; + return PrintLogger; + })(); + function webWorkerProviders(appComponentType, bus, initData) { + return [compiler_1.compilerProviders(), serializer_1.Serializer, di_1.provide(message_bus_1.MessageBus, {useValue: bus}), di_1.provide(client_message_broker_1.ClientMessageBrokerFactory, {useClass: client_message_broker_1.ClientMessageBrokerFactory_}), di_1.provide(service_message_broker_1.ServiceMessageBrokerFactory, {useClass: service_message_broker_1.ServiceMessageBrokerFactory_}), renderer_1.WebWorkerRenderer, di_1.provide(api_1.Renderer, {useExisting: renderer_1.WebWorkerRenderer}), di_1.provide(api_2.ON_WEB_WORKER, {useValue: true}), render_view_with_fragments_store_1.RenderViewWithFragmentsStore, render_proto_view_ref_store_1.RenderProtoViewRefStore, di_1.provide(exceptions_1.ExceptionHandler, { + useFactory: function() { + return new exceptions_1.ExceptionHandler(new PrintLogger()); + }, + deps: [] + }), xhr_impl_1.WebWorkerXHRImpl, di_1.provide(xhr_1.XHR, {useExisting: xhr_impl_1.WebWorkerXHRImpl}), di_1.provide(app_root_url_1.AppRootUrl, {useValue: new app_root_url_1.AppRootUrl(initData['rootUrl'])}), event_dispatcher_1.WebWorkerEventDispatcher, forms_1.FORM_PROVIDERS]; + } + function bootstrapWebWorkerCommon(appComponentType, bus, appProviders) { + if (appProviders === void 0) { + appProviders = null; + } + var bootstrapProcess = async_1.PromiseWrapper.completer(); + var appPromise = platform().asyncApplication(function(zone) { + bus.attachToZone(zone); + bus.initChannel(messaging_api_1.SETUP_CHANNEL, false); + var subscription; + var emitter = bus.from(messaging_api_1.SETUP_CHANNEL); + subscription = async_2.ObservableWrapper.subscribe(emitter, function(message) { + var bindings = [application_ref_1.applicationCommonProviders(), webWorkerProviders(appComponentType, bus, message)]; + if (lang_1.isPresent(appProviders)) { + bindings.push(appProviders); + } + bootstrapProcess.resolve(bindings); + async_2.ObservableWrapper.dispose(subscription); + }); + async_2.ObservableWrapper.callNext(bus.to(messaging_api_1.SETUP_CHANNEL), "ready"); + return bootstrapProcess.promise; + }); + return async_1.PromiseWrapper.then(appPromise, function(app) { + return app.bootstrap(appComponentType); + }); + } + exports.bootstrapWebWorkerCommon = bootstrapWebWorkerCommon; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var metadata_1 = require("angular2/src/core/di/metadata"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var DirectiveMetadata = (function(_super) { + __extends(DirectiveMetadata, _super); + function DirectiveMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + bindings = _b.bindings, + providers = _b.providers, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + queries = _b.queries; + _super.call(this); + this.selector = selector; + this._inputs = inputs; + this._properties = properties; + this._outputs = outputs; + this._events = events; + this.host = host; + this.exportAs = exportAs; + this.moduleId = moduleId; + this.queries = queries; + this._providers = providers; + this._bindings = bindings; + } + Object.defineProperty(DirectiveMetadata.prototype, "inputs", { + get: function() { + return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "properties", { + get: function() { + return this.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "outputs", { + get: function() { + return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "events", { + get: function() { + return this.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "providers", { + get: function() { + return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectiveMetadata.prototype, "bindings", { + get: function() { + return this.providers; + }, + enumerable: true, + configurable: true + }); + DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); + return DirectiveMetadata; + })(metadata_1.InjectableMetadata); + exports.DirectiveMetadata = DirectiveMetadata; + var ComponentMetadata = (function(_super) { + __extends(ComponentMetadata, _super); + function ComponentMetadata(_a) { + var _b = _a === void 0 ? {} : _a, + selector = _b.selector, + inputs = _b.inputs, + outputs = _b.outputs, + properties = _b.properties, + events = _b.events, + host = _b.host, + exportAs = _b.exportAs, + moduleId = _b.moduleId, + bindings = _b.bindings, + providers = _b.providers, + viewBindings = _b.viewBindings, + viewProviders = _b.viewProviders, + _c = _b.changeDetection, + changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, + queries = _b.queries, + templateUrl = _b.templateUrl, + template = _b.template, + styleUrls = _b.styleUrls, + styles = _b.styles, + directives = _b.directives, + pipes = _b.pipes, + encapsulation = _b.encapsulation; + _super.call(this, { + selector: selector, + inputs: inputs, + outputs: outputs, + properties: properties, + events: events, + host: host, + exportAs: exportAs, + moduleId: moduleId, + bindings: bindings, + providers: providers, + queries: queries + }); + this.changeDetection = changeDetection; + this._viewProviders = viewProviders; + this._viewBindings = viewBindings; + this.templateUrl = templateUrl; + this.template = template; + this.styleUrls = styleUrls; + this.styles = styles; + this.directives = directives; + this.pipes = pipes; + this.encapsulation = encapsulation; + } + Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { + get: function() { + return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { + get: function() { + return this.viewProviders; + }, + enumerable: true, + configurable: true + }); + ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); + return ComponentMetadata; + })(DirectiveMetadata); + exports.ComponentMetadata = ComponentMetadata; + var PipeMetadata = (function(_super) { + __extends(PipeMetadata, _super); + function PipeMetadata(_a) { + var name = _a.name, + pure = _a.pure; + _super.call(this); + this.name = name; + this._pure = pure; + } + Object.defineProperty(PipeMetadata.prototype, "pure", { + get: function() { + return lang_1.isPresent(this._pure) ? this._pure : true; + }, + enumerable: true, + configurable: true + }); + PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); + return PipeMetadata; + })(metadata_1.InjectableMetadata); + exports.PipeMetadata = PipeMetadata; + var InputMetadata = (function() { + function InputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); + return InputMetadata; + })(); + exports.InputMetadata = InputMetadata; + var OutputMetadata = (function() { + function OutputMetadata(bindingPropertyName) { + this.bindingPropertyName = bindingPropertyName; + } + OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); + return OutputMetadata; + })(); + exports.OutputMetadata = OutputMetadata; + var HostBindingMetadata = (function() { + function HostBindingMetadata(hostPropertyName) { + this.hostPropertyName = hostPropertyName; + } + HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); + return HostBindingMetadata; + })(); + exports.HostBindingMetadata = HostBindingMetadata; + var HostListenerMetadata = (function() { + function HostListenerMetadata(eventName, args) { + this.eventName = eventName; + this.args = args; + } + HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); + return HostListenerMetadata; + })(); + exports.HostListenerMetadata = HostListenerMetadata; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/core/metadata", "angular2/src/core/di", "angular2/src/core/change_detection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var lang_1 = require("angular2/src/facade/lang"); + var async_1 = require("angular2/src/facade/async"); + var metadata_1 = require("angular2/src/core/metadata"); + var di_1 = require("angular2/src/core/di"); + var change_detection_1 = require("angular2/src/core/change_detection"); + var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); + var ObservableStrategy = (function() { + function ObservableStrategy() {} + ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { + throw e; + }); + }; + ObservableStrategy.prototype.dispose = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + ObservableStrategy.prototype.onDestroy = function(subscription) { + async_1.ObservableWrapper.dispose(subscription); + }; + return ObservableStrategy; + })(); + var PromiseStrategy = (function() { + function PromiseStrategy() {} + PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { + return async.then(updateLatestValue); + }; + PromiseStrategy.prototype.dispose = function(subscription) {}; + PromiseStrategy.prototype.onDestroy = function(subscription) {}; + return PromiseStrategy; + })(); + var _promiseStrategy = new PromiseStrategy(); + var _observableStrategy = new ObservableStrategy(); + var AsyncPipe = (function() { + function AsyncPipe(_ref) { + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + this._strategy = null; + this._ref = _ref; + } + AsyncPipe.prototype.onDestroy = function() { + if (lang_1.isPresent(this._subscription)) { + this._dispose(); + } + }; + AsyncPipe.prototype.transform = function(obj, args) { + if (lang_1.isBlank(this._obj)) { + if (lang_1.isPresent(obj)) { + this._subscribe(obj); + } + return null; + } + if (obj !== this._obj) { + this._dispose(); + return this.transform(obj); + } + if (this._latestValue === this._latestReturnedValue) { + return this._latestReturnedValue; + } else { + this._latestReturnedValue = this._latestValue; + return change_detection_1.WrappedValue.wrap(this._latestValue); + } + }; + AsyncPipe.prototype._subscribe = function(obj) { + var _this = this; + this._obj = obj; + this._strategy = this._selectStrategy(obj); + this._subscription = this._strategy.createSubscription(obj, function(value) { + return _this._updateLatestValue(obj, value); + }); + }; + AsyncPipe.prototype._selectStrategy = function(obj) { + if (lang_1.isPromise(obj)) { + return _promiseStrategy; + } else if (async_1.ObservableWrapper.isObservable(obj)) { + return _observableStrategy; + } else { + throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); + } + }; + AsyncPipe.prototype._dispose = function() { + this._strategy.dispose(this._subscription); + this._latestValue = null; + this._latestReturnedValue = null; + this._subscription = null; + this._obj = null; + }; + AsyncPipe.prototype._updateLatestValue = function(async, value) { + if (async === this._obj) { + this._latestValue = value; + this._ref.markForCheck(); + } + }; + AsyncPipe = __decorate([metadata_1.Pipe({ + name: 'async', + pure: false + }), di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorRef])], AsyncPipe); + return AsyncPipe; + })(); + exports.AsyncPipe = AsyncPipe; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/proto_view_factory", ["angular2/src/facade/lang", "angular2/src/core/render/api", "angular2/src/core/di", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view", "angular2/src/core/linker/element_binder", "angular2/src/core/linker/element_injector", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/metadata/view", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/linker/template_commands", "angular2/render", "angular2/src/core/application_tokens"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var __param = (this && this.__param) || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var lang_1 = require("angular2/src/facade/lang"); + var api_1 = require("angular2/src/core/render/api"); + var di_1 = require("angular2/src/core/di"); + var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); + var pipes_1 = require("angular2/src/core/pipes/pipes"); + var view_1 = require("angular2/src/core/linker/view"); + var element_binder_1 = require("angular2/src/core/linker/element_binder"); + var element_injector_1 = require("angular2/src/core/linker/element_injector"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var view_2 = require("angular2/src/core/metadata/view"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var render_1 = require("angular2/render"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var ProtoViewFactory = (function() { + function ProtoViewFactory(_renderer, _platformPipes, _directiveResolver, _viewResolver, _pipeResolver, _appId) { + this._renderer = _renderer; + this._platformPipes = _platformPipes; + this._directiveResolver = _directiveResolver; + this._viewResolver = _viewResolver; + this._pipeResolver = _pipeResolver; + this._appId = _appId; + this._cache = new Map(); + this._nextTemplateId = 0; + } + ProtoViewFactory.prototype.clearCache = function() { + this._cache.clear(); + }; + ProtoViewFactory.prototype.createHost = function(compiledHostTemplate) { + var compiledTemplate = compiledHostTemplate.template; + var result = this._cache.get(compiledTemplate.id); + if (lang_1.isBlank(result)) { + var emptyMap = {}; + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, view_2.ViewEncapsulation.None, compiledTemplate.commands, [])); + result = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.HOST, true, compiledTemplate.changeDetectorFactory, null, new pipes_1.ProtoPipes(emptyMap)); + this._cache.set(compiledTemplate.id, result); + } + return result; + }; + ProtoViewFactory.prototype._createComponent = function(cmd) { + var _this = this; + var nestedProtoView = this._cache.get(cmd.templateId); + if (lang_1.isBlank(nestedProtoView)) { + var component = cmd.directives[0]; + var view = this._viewResolver.resolve(component); + var compiledTemplate = cmd.templateGetter(); + var styles = _flattenStyleArr(compiledTemplate.styles, []); + var shortId = this._appId + "-" + this._nextTemplateId++; + this._renderer.registerComponentTemplate(new api_1.RenderComponentTemplate(compiledTemplate.id, shortId, cmd.encapsulation, compiledTemplate.commands, styles)); + var boundPipes = this._flattenPipes(view).map(function(pipe) { + return _this._bindPipe(pipe); + }); + nestedProtoView = new view_1.AppProtoView(compiledTemplate.id, compiledTemplate.commands, view_1.ViewType.COMPONENT, true, compiledTemplate.changeDetectorFactory, null, pipes_1.ProtoPipes.fromProviders(boundPipes)); + this._cache.set(compiledTemplate.id, nestedProtoView); + this._initializeProtoView(nestedProtoView, null); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype._createEmbeddedTemplate = function(cmd, parent) { + var nestedProtoView = new view_1.AppProtoView(parent.templateId, cmd.children, view_1.ViewType.EMBEDDED, cmd.isMerged, cmd.changeDetectorFactory, arrayToMap(cmd.variableNameAndValues, true), new pipes_1.ProtoPipes(parent.pipes.config)); + if (cmd.isMerged) { + this.initializeProtoViewIfNeeded(nestedProtoView); + } + return nestedProtoView; + }; + ProtoViewFactory.prototype.initializeProtoViewIfNeeded = function(protoView) { + if (!protoView.isInitialized()) { + var render = this._renderer.createProtoView(protoView.templateId, protoView.templateCmds); + this._initializeProtoView(protoView, render); + } + }; + ProtoViewFactory.prototype._initializeProtoView = function(protoView, render) { + var initializer = new _ProtoViewInitializer(protoView, this._directiveResolver, this); + template_commands_1.visitAllCommands(initializer, protoView.templateCmds); + var mergeInfo = new view_1.AppProtoViewMergeInfo(initializer.mergeEmbeddedViewCount, initializer.mergeElementCount, initializer.mergeViewCount); + protoView.init(render, initializer.elementBinders, initializer.boundTextCount, mergeInfo, initializer.variableLocations); + }; + ProtoViewFactory.prototype._bindPipe = function(typeOrProvider) { + var meta = this._pipeResolver.resolve(typeOrProvider); + return pipe_provider_1.PipeProvider.createFromType(typeOrProvider, meta); + }; + ProtoViewFactory.prototype._flattenPipes = function(view) { + var pipes = []; + if (lang_1.isPresent(this._platformPipes)) { + _flattenArray(this._platformPipes, pipes); + } + if (lang_1.isPresent(view.pipes)) { + _flattenArray(view.pipes, pipes); + } + return pipes; + }; + ProtoViewFactory = __decorate([di_1.Injectable(), __param(1, di_1.Optional()), __param(1, di_1.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __param(5, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [render_1.Renderer, Array, directive_resolver_1.DirectiveResolver, view_resolver_1.ViewResolver, pipe_resolver_1.PipeResolver, String])], ProtoViewFactory); + return ProtoViewFactory; + })(); + exports.ProtoViewFactory = ProtoViewFactory; + function createComponent(protoViewFactory, cmd) { + return protoViewFactory._createComponent(cmd); + } + function createEmbeddedTemplate(protoViewFactory, cmd, parent) { + return protoViewFactory._createEmbeddedTemplate(cmd, parent); + } + var _ProtoViewInitializer = (function() { + function _ProtoViewInitializer(_protoView, _directiveResolver, _protoViewFactory) { + this._protoView = _protoView; + this._directiveResolver = _directiveResolver; + this._protoViewFactory = _protoViewFactory; + this.variableLocations = new Map(); + this.boundTextCount = 0; + this.boundElementIndex = 0; + this.elementBinderStack = []; + this.distanceToParentElementBinder = 0; + this.distanceToParentProtoElementInjector = 0; + this.elementBinders = []; + this.mergeEmbeddedViewCount = 0; + this.mergeElementCount = 0; + this.mergeViewCount = 1; + } + _ProtoViewInitializer.prototype.visitText = function(cmd, context) { + if (cmd.isBound) { + this.boundTextCount++; + } + return null; + }; + _ProtoViewInitializer.prototype.visitNgContent = function(cmd, context) { + return null; + }; + _ProtoViewInitializer.prototype.visitBeginElement = function(cmd, context) { + if (cmd.isBound) { + this._visitBeginBoundElement(cmd, null); + } else { + this._visitBeginElement(cmd, null, null); + } + return null; + }; + _ProtoViewInitializer.prototype.visitEndElement = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitBeginComponent = function(cmd, context) { + var nestedProtoView = createComponent(this._protoViewFactory, cmd); + return this._visitBeginBoundElement(cmd, nestedProtoView); + }; + _ProtoViewInitializer.prototype.visitEndComponent = function(context) { + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype.visitEmbeddedTemplate = function(cmd, context) { + var nestedProtoView = createEmbeddedTemplate(this._protoViewFactory, cmd, this._protoView); + if (cmd.isMerged) { + this.mergeEmbeddedViewCount++; + } + this._visitBeginBoundElement(cmd, nestedProtoView); + return this._visitEndElement(); + }; + _ProtoViewInitializer.prototype._visitBeginBoundElement = function(cmd, nestedProtoView) { + if (lang_1.isPresent(nestedProtoView) && nestedProtoView.isMergable) { + this.mergeElementCount += nestedProtoView.mergeInfo.elementCount; + this.mergeViewCount += nestedProtoView.mergeInfo.viewCount; + this.mergeEmbeddedViewCount += nestedProtoView.mergeInfo.embeddedViewCount; + } + var elementBinder = _createElementBinder(this._directiveResolver, nestedProtoView, this.elementBinderStack, this.boundElementIndex, this.distanceToParentElementBinder, this.distanceToParentProtoElementInjector, cmd); + this.elementBinders.push(elementBinder); + var protoElementInjector = elementBinder.protoElementInjector; + for (var i = 0; i < cmd.variableNameAndValues.length; i += 2) { + this.variableLocations.set(cmd.variableNameAndValues[i], this.boundElementIndex); + } + this.boundElementIndex++; + this.mergeElementCount++; + return this._visitBeginElement(cmd, elementBinder, protoElementInjector); + }; + _ProtoViewInitializer.prototype._visitBeginElement = function(cmd, elementBinder, protoElementInjector) { + this.distanceToParentElementBinder = lang_1.isPresent(elementBinder) ? 1 : this.distanceToParentElementBinder + 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(protoElementInjector) ? 1 : this.distanceToParentProtoElementInjector + 1; + this.elementBinderStack.push(elementBinder); + return null; + }; + _ProtoViewInitializer.prototype._visitEndElement = function() { + var parentElementBinder = this.elementBinderStack.pop(); + var parentProtoElementInjector = lang_1.isPresent(parentElementBinder) ? parentElementBinder.protoElementInjector : null; + this.distanceToParentElementBinder = lang_1.isPresent(parentElementBinder) ? parentElementBinder.distanceToParent : this.distanceToParentElementBinder - 1; + this.distanceToParentProtoElementInjector = lang_1.isPresent(parentProtoElementInjector) ? parentProtoElementInjector.distanceToParent : this.distanceToParentProtoElementInjector - 1; + return null; + }; + return _ProtoViewInitializer; + })(); + function _createElementBinder(directiveResolver, nestedProtoView, elementBinderStack, boundElementIndex, distanceToParentBinder, distanceToParentPei, beginElementCmd) { + var parentElementBinder = null; + var parentProtoElementInjector = null; + if (distanceToParentBinder > 0) { + parentElementBinder = elementBinderStack[elementBinderStack.length - distanceToParentBinder]; + } + if (lang_1.isBlank(parentElementBinder)) { + distanceToParentBinder = -1; + } + if (distanceToParentPei > 0) { + var peiBinder = elementBinderStack[elementBinderStack.length - distanceToParentPei]; + if (lang_1.isPresent(peiBinder)) { + parentProtoElementInjector = peiBinder.protoElementInjector; + } + } + if (lang_1.isBlank(parentProtoElementInjector)) { + distanceToParentPei = -1; + } + var componentDirectiveProvider = null; + var isEmbeddedTemplate = false; + var directiveProviders = beginElementCmd.directives.map(function(type) { + return provideDirective(directiveResolver, type); + }); + if (beginElementCmd instanceof template_commands_1.BeginComponentCmd) { + componentDirectiveProvider = directiveProviders[0]; + } else if (beginElementCmd instanceof template_commands_1.EmbeddedTemplateCmd) { + isEmbeddedTemplate = true; + } + var protoElementInjector = null; + var hasVariables = beginElementCmd.variableNameAndValues.length > 0; + if (directiveProviders.length > 0 || hasVariables || isEmbeddedTemplate) { + var directiveVariableBindings = new Map(); + if (!isEmbeddedTemplate) { + directiveVariableBindings = createDirectiveVariableBindings(beginElementCmd.variableNameAndValues, directiveProviders); + } + protoElementInjector = element_injector_1.ProtoElementInjector.create(parentProtoElementInjector, boundElementIndex, directiveProviders, lang_1.isPresent(componentDirectiveProvider), distanceToParentPei, directiveVariableBindings); + protoElementInjector.attributes = arrayToMap(beginElementCmd.attrNameAndValues, false); + } + return new element_binder_1.ElementBinder(boundElementIndex, parentElementBinder, distanceToParentBinder, protoElementInjector, componentDirectiveProvider, nestedProtoView); + } + function provideDirective(directiveResolver, type) { + var annotation = directiveResolver.resolve(type); + return element_injector_1.DirectiveProvider.createFromType(type, annotation); + } + function createDirectiveVariableBindings(variableNameAndValues, directiveProviders) { + var directiveVariableBindings = new Map(); + for (var i = 0; i < variableNameAndValues.length; i += 2) { + var templateName = variableNameAndValues[i]; + var dirIndex = variableNameAndValues[i + 1]; + if (lang_1.isNumber(dirIndex)) { + directiveVariableBindings.set(templateName, dirIndex); + } else { + directiveVariableBindings.set(templateName, null); + } + } + return directiveVariableBindings; + } + exports.createDirectiveVariableBindings = createDirectiveVariableBindings; + function arrayToMap(arr, inverse) { + var result = new Map(); + for (var i = 0; i < arr.length; i += 2) { + if (inverse) { + result.set(arr[i + 1], arr[i]); + } else { + result.set(arr[i], arr[i + 1]); + } + } + return result; + } + function _flattenArray(tree, out) { + for (var i = 0; i < tree.length; i++) { + var item = di_1.resolveForwardRef(tree[i]); + if (lang_1.isArray(item)) { + _flattenArray(item, out); + } else { + out.push(item); + } + } + } + function _flattenStyleArr(arr, out) { + for (var i = 0; i < arr.length; i++) { + var entry = arr[i]; + if (lang_1.isArray(entry)) { + _flattenStyleArr(entry, out); + } else { + out.push(entry); + } + } + return out; + } + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/web_workers/worker/application", ["angular2/src/web_workers/shared/post_message_bus", "angular2/src/web_workers/worker/application_common", "angular2/src/web_workers/shared/message_bus", "angular2/src/core/dom/parse5_adapter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + var post_message_bus_1 = require("angular2/src/web_workers/shared/post_message_bus"); + var application_common_1 = require("angular2/src/web_workers/worker/application_common"); + __export(require("angular2/src/web_workers/shared/message_bus")); + var parse5_adapter_1 = require("angular2/src/core/dom/parse5_adapter"); + var _postMessage = postMessage; + function bootstrapWebWorker(appComponentType, componentInjectableProviders) { + if (componentInjectableProviders === void 0) { + componentInjectableProviders = null; + } + parse5_adapter_1.Parse5DomAdapter.makeCurrent(); + var sink = new post_message_bus_1.PostMessageBusSink({postMessage: function(message, transferrables) { + _postMessage(message, transferrables); + }}); + var source = new post_message_bus_1.PostMessageBusSource(); + var bus = new post_message_bus_1.PostMessageBus(sink, source); + return application_common_1.bootstrapWebWorkerCommon(appComponentType, bus, componentInjectableProviders); + } + exports.bootstrapWebWorker = bootstrapWebWorker; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var di_1 = require("angular2/src/core/metadata/di"); + exports.QueryMetadata = di_1.QueryMetadata; + exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; + exports.ContentChildMetadata = di_1.ContentChildMetadata; + exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; + exports.ViewQueryMetadata = di_1.ViewQueryMetadata; + exports.ViewChildMetadata = di_1.ViewChildMetadata; + exports.AttributeMetadata = di_1.AttributeMetadata; + var directives_1 = require("angular2/src/core/metadata/directives"); + exports.ComponentMetadata = directives_1.ComponentMetadata; + exports.DirectiveMetadata = directives_1.DirectiveMetadata; + exports.PipeMetadata = directives_1.PipeMetadata; + exports.InputMetadata = directives_1.InputMetadata; + exports.OutputMetadata = directives_1.OutputMetadata; + exports.HostBindingMetadata = directives_1.HostBindingMetadata; + exports.HostListenerMetadata = directives_1.HostListenerMetadata; + var view_1 = require("angular2/src/core/metadata/view"); + exports.ViewMetadata = view_1.ViewMetadata; + exports.ViewEncapsulation = view_1.ViewEncapsulation; + var di_2 = require("angular2/src/core/metadata/di"); + var directives_2 = require("angular2/src/core/metadata/directives"); + var view_2 = require("angular2/src/core/metadata/view"); + var decorators_1 = require("angular2/src/core/util/decorators"); + exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); + exports.View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { + return fn.View = exports.View; + }); + exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); + exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); + exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); + exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); + exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); + exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); + exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); + exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); + exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); + exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); + exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); + exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/facade/lang", "angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); + var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); + var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); + var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); + var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); + var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); + var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); + var lang_1 = require("angular2/src/facade/lang"); + var async_pipe_2 = require("angular2/src/common/pipes/async_pipe"); + exports.AsyncPipe = async_pipe_2.AsyncPipe; + var date_pipe_2 = require("angular2/src/common/pipes/date_pipe"); + exports.DatePipe = date_pipe_2.DatePipe; + var json_pipe_2 = require("angular2/src/common/pipes/json_pipe"); + exports.JsonPipe = json_pipe_2.JsonPipe; + var slice_pipe_2 = require("angular2/src/common/pipes/slice_pipe"); + exports.SlicePipe = slice_pipe_2.SlicePipe; + var lowercase_pipe_2 = require("angular2/src/common/pipes/lowercase_pipe"); + exports.LowerCasePipe = lowercase_pipe_2.LowerCasePipe; + var number_pipe_2 = require("angular2/src/common/pipes/number_pipe"); + exports.NumberPipe = number_pipe_2.NumberPipe; + exports.DecimalPipe = number_pipe_2.DecimalPipe; + exports.PercentPipe = number_pipe_2.PercentPipe; + exports.CurrencyPipe = number_pipe_2.CurrencyPipe; + var uppercase_pipe_2 = require("angular2/src/common/pipes/uppercase_pipe"); + exports.UpperCasePipe = uppercase_pipe_2.UpperCasePipe; + exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe]); + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/compiler", ["angular2/src/core/linker/proto_view_factory", "angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/template_commands"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var di_1 = require("angular2/src/core/di"); + var lang_1 = require("angular2/src/facade/lang"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var async_1 = require("angular2/src/facade/async"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var template_commands_1 = require("angular2/src/core/linker/template_commands"); + var Compiler = (function() { + function Compiler() {} + return Compiler; + })(); + exports.Compiler = Compiler; + function _isCompiledHostTemplate(type) { + return type instanceof template_commands_1.CompiledHostTemplate; + } + var Compiler_ = (function(_super) { + __extends(Compiler_, _super); + function Compiler_(_protoViewFactory) { + _super.call(this); + this._protoViewFactory = _protoViewFactory; + } + Compiler_.prototype.compileInHost = function(componentType) { + var metadatas = reflection_1.reflector.annotations(componentType); + var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate); + if (lang_1.isBlank(compiledHostTemplate)) { + throw new exceptions_1.BaseException("No precompiled template for component " + lang_1.stringify(componentType) + " found"); + } + return async_1.PromiseWrapper.resolve(this._createProtoView(compiledHostTemplate)); + }; + Compiler_.prototype._createProtoView = function(compiledHostTemplate) { + return this._protoViewFactory.createHost(compiledHostTemplate).ref; + }; + Compiler_.prototype.clearCache = function() { + this._protoViewFactory.clearCache(); + }; + Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [proto_view_factory_1.ProtoViewFactory])], Compiler_); + return Compiler_; + })(Compiler); + exports.Compiler_ = Compiler_; + function internalCreateProtoView(compiler, compiledHostTemplate) { + return compiler._createProtoView(compiledHostTemplate); + } + exports.internalCreateProtoView = internalCreateProtoView; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: + return decorators.reduceRight(function(o, d) { + return (d && d(o)) || o; + }, target); + case 3: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key)), void 0; + }, void 0); + case 4: + return decorators.reduceRight(function(o, d) { + return (d && d(target, key, o)) || o; + }, desc); + } + }; + var __metadata = (this && this.__metadata) || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(k, v); + }; + var di_1 = require("angular2/src/core/di"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var lang_1 = require("angular2/src/facade/lang"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var ComponentRef = (function() { + function ComponentRef() {} + Object.defineProperty(ComponentRef.prototype, "hostView", { + get: function() { + return this.location.parentView; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComponentRef.prototype, "hostComponent", { + get: function() { + return this.instance; + }, + enumerable: true, + configurable: true + }); + return ComponentRef; + })(); + exports.ComponentRef = ComponentRef; + var ComponentRef_ = (function(_super) { + __extends(ComponentRef_, _super); + function ComponentRef_(location, instance, componentType, injector, _dispose) { + _super.call(this); + this._dispose = _dispose; + this.location = location; + this.instance = instance; + this.componentType = componentType; + this.injector = injector; + } + Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { + get: function() { + return this.componentType; + }, + enumerable: true, + configurable: true + }); + ComponentRef_.prototype.dispose = function() { + this._dispose(); + }; + return ComponentRef_; + })(ComponentRef); + exports.ComponentRef_ = ComponentRef_; + var DynamicComponentLoader = (function() { + function DynamicComponentLoader() {} + return DynamicComponentLoader; + })(); + exports.DynamicComponentLoader = DynamicComponentLoader; + var DynamicComponentLoader_ = (function(_super) { + __extends(DynamicComponentLoader_, _super); + function DynamicComponentLoader_(_compiler, _viewManager) { + _super.call(this); + this._compiler = _compiler; + this._viewManager = _viewManager; + } + DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose) { + var _this = this; + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + _this._viewManager.destroyRootHostView(hostViewRef); + if (lang_1.isPresent(onDispose)) { + onDispose(); + } + }; + return new ComponentRef_(newLocation, component, type, injector, dispose); + }); + }; + DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers) { + if (providers === void 0) { + providers = null; + } + return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers); + }; + DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers) { + var _this = this; + if (providers === void 0) { + providers = null; + } + return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { + var viewContainer = _this._viewManager.getViewContainer(location); + var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers); + var newLocation = _this._viewManager.getHostElement(hostViewRef); + var component = _this._viewManager.getComponent(newLocation); + var dispose = function() { + var index = viewContainer.indexOf(hostViewRef); + if (index !== -1) { + viewContainer.remove(index); + } + }; + return new ComponentRef_(newLocation, component, type, null, dispose); + }); + }; + DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); + return DynamicComponentLoader_; + })(DynamicComponentLoader); + exports.DynamicComponentLoader_ = DynamicComponentLoader_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/dom/dom_adapter", "angular2/src/core/linker/view_ref", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/view_pool", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager_utils", "angular2/src/core/linker/view_listener", "angular2/src/core/linker/proto_view_factory", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/compiler", "angular2/src/core/profile/profile", "angular2/src/core/platform_directives_and_pipes", "angular2/src/facade/lang", "angular2/common"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); + var lang_1 = require("angular2/src/facade/lang"); + var di_1 = require("angular2/src/core/di"); + var application_tokens_1 = require("angular2/src/core/application_tokens"); + var async_1 = require("angular2/src/facade/async"); + var collection_1 = require("angular2/src/facade/collection"); + var reflection_1 = require("angular2/src/core/reflection/reflection"); + var testability_1 = require("angular2/src/core/testability/testability"); + var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); + var exceptions_1 = require("angular2/src/facade/exceptions"); + var dom_adapter_1 = require("angular2/src/core/dom/dom_adapter"); + var view_ref_1 = require("angular2/src/core/linker/view_ref"); + var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); + var view_pool_1 = require("angular2/src/core/linker/view_pool"); + var view_manager_1 = require("angular2/src/core/linker/view_manager"); + var view_manager_utils_1 = require("angular2/src/core/linker/view_manager_utils"); + var view_listener_1 = require("angular2/src/core/linker/view_listener"); + var proto_view_factory_1 = require("angular2/src/core/linker/proto_view_factory"); + var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); + var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); + var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); + var compiler_1 = require("angular2/src/core/linker/compiler"); + var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); + var view_manager_2 = require("angular2/src/core/linker/view_manager"); + var compiler_2 = require("angular2/src/core/linker/compiler"); + var profile_1 = require("angular2/src/core/profile/profile"); + var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); + var lang_2 = require("angular2/src/facade/lang"); + var common_1 = require("angular2/common"); + function platformProviders() { + return [di_1.provide(reflection_1.Reflector, {useValue: reflection_1.reflector}), testability_1.TestabilityRegistry]; + } + exports.platformProviders = platformProviders; + function _componentProviders(appComponentType) { + return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { + useFactory: function(dynamicComponentLoader, appRef, injector) { + var ref; + return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { + appRef._unloadComponent(ref); + }).then(function(componentRef) { + ref = componentRef; + if (lang_1.isPresent(componentRef.location.nativeElement)) { + injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability)); + } + return componentRef; + }); + }, + deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] + }), di_1.provide(appComponentType, { + useFactory: function(p) { + return p.then(function(ref) { + return ref.instance; + }); + }, + deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] + })]; + } + function applicationCommonProviders() { + return [di_1.provide(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, view_pool_1.AppViewPool, di_1.provide(view_pool_1.APP_VIEW_POOL_CAPACITY, {useValue: 10000}), di_1.provide(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_manager_utils_1.AppViewManagerUtils, view_listener_1.AppViewListener, proto_view_factory_1.ProtoViewFactory, view_resolver_1.ViewResolver, di_1.provide(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), di_1.provide(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, di_1.provide(platform_directives_and_pipes_1.PLATFORM_PIPES, { + useValue: common_1.COMMON_PIPES, + multi: true + }), di_1.provide(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES, { + useValue: common_1.COMMON_DIRECTIVES, + multi: true + }), di_1.provide(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]; + } + exports.applicationCommonProviders = applicationCommonProviders; + function createNgZone() { + return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); + } + exports.createNgZone = createNgZone; + var _platform; + function platformCommon(providers, initializer) { + lang_2.lockDevMode(); + if (lang_1.isPresent(_platform)) { + if (lang_1.isBlank(providers)) { + return _platform; + } + throw "platform() can only be called once per page"; + } + if (lang_1.isPresent(initializer)) { + initializer(); + } + if (lang_1.isBlank(providers)) { + providers = platformProviders(); + } + _platform = new PlatformRef_(di_1.Injector.resolveAndCreate(providers), function() { + _platform = null; + }); + return _platform; + } + exports.platformCommon = platformCommon; + var PlatformRef = (function() { + function PlatformRef() {} + Object.defineProperty(PlatformRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return PlatformRef; + })(); + exports.PlatformRef = PlatformRef; + var PlatformRef_ = (function(_super) { + __extends(PlatformRef_, _super); + function PlatformRef_(_injector, _dispose) { + _super.call(this); + this._injector = _injector; + this._dispose = _dispose; + this._applications = []; + this._disposeListeners = []; + } + PlatformRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + Object.defineProperty(PlatformRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + PlatformRef_.prototype.application = function(providers) { + var app = this._initApp(createNgZone(), providers); + return app; + }; + PlatformRef_.prototype.asyncApplication = function(bindingFn) { + var _this = this; + var zone = createNgZone(); + var completer = async_1.PromiseWrapper.completer(); + zone.run(function() { + async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { + completer.resolve(_this._initApp(zone, providers)); + }); + }); + return completer.promise; + }; + PlatformRef_.prototype._initApp = function(zone, providers) { + var _this = this; + var injector; + var app; + zone.run(function() { + providers.push(di_1.provide(ng_zone_1.NgZone, {useValue: zone})); + providers.push(di_1.provide(ApplicationRef, { + useFactory: function() { + return app; + }, + deps: [] + })); + var exceptionHandler; + try { + injector = _this.injector.resolveAndCreateChild(providers); + exceptionHandler = injector.get(exceptions_1.ExceptionHandler); + zone.overrideOnErrorHandler(function(e, s) { + return exceptionHandler.call(e, s); + }); + } catch (e) { + if (lang_1.isPresent(exceptionHandler)) { + exceptionHandler.call(e, e.stack); + } else { + dom_adapter_1.DOM.logError(e); + } + } + }); + app = new ApplicationRef_(this, zone, injector); + this._applications.push(app); + return app; + }; + PlatformRef_.prototype.dispose = function() { + this._applications.forEach(function(app) { + return app.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._dispose(); + }; + PlatformRef_.prototype._applicationDisposed = function(app) { + collection_1.ListWrapper.remove(this._applications, app); + }; + return PlatformRef_; + })(PlatformRef); + exports.PlatformRef_ = PlatformRef_; + var ApplicationRef = (function() { + function ApplicationRef() {} + Object.defineProperty(ApplicationRef.prototype, "injector", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "zone", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + Object.defineProperty(ApplicationRef.prototype, "componentTypes", { + get: function() { + return exceptions_1.unimplemented(); + }, + enumerable: true, + configurable: true + }); + ; + return ApplicationRef; + })(); + exports.ApplicationRef = ApplicationRef; + var ApplicationRef_ = (function(_super) { + __extends(ApplicationRef_, _super); + function ApplicationRef_(_platform, _zone, _injector) { + var _this = this; + _super.call(this); + this._platform = _platform; + this._zone = _zone; + this._injector = _injector; + this._bootstrapListeners = []; + this._disposeListeners = []; + this._rootComponents = []; + this._rootComponentTypes = []; + this._changeDetectorRefs = []; + this._runningTick = false; + this._enforceNoNewChanges = false; + if (lang_1.isPresent(this._zone)) { + async_1.ObservableWrapper.subscribe(this._zone.onTurnDone, function(_) { + _this._zone.run(function() { + _this.tick(); + }); + }); + } + this._enforceNoNewChanges = lang_1.assertionsEnabled(); + } + ApplicationRef_.prototype.registerBootstrapListener = function(listener) { + this._bootstrapListeners.push(listener); + }; + ApplicationRef_.prototype.registerDisposeListener = function(dispose) { + this._disposeListeners.push(dispose); + }; + ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { + this._changeDetectorRefs.push(changeDetector); + }; + ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { + collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); + }; + ApplicationRef_.prototype.bootstrap = function(componentType, providers) { + var _this = this; + var completer = async_1.PromiseWrapper.completer(); + this._zone.run(function() { + var componentProviders = _componentProviders(componentType); + if (lang_1.isPresent(providers)) { + componentProviders.push(providers); + } + var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); + _this._rootComponentTypes.push(componentType); + try { + var injector = _this._injector.resolveAndCreateChild(componentProviders); + var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); + var tick = function(componentRef) { + _this._loadComponent(componentRef); + completer.resolve(componentRef); + }; + var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); + async_1.PromiseWrapper.then(tickResult, function(_) {}); + async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { + return completer.reject(err, stackTrace); + }); + } catch (e) { + exceptionHandler.call(e, e.stack); + completer.reject(e, e.stack); + } + }); + return completer.promise; + }; + ApplicationRef_.prototype._loadComponent = function(ref) { + var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector; + this._changeDetectorRefs.push(appChangeDetector.ref); + this.tick(); + this._rootComponents.push(ref); + this._bootstrapListeners.forEach(function(listener) { + return listener(ref); + }); + }; + ApplicationRef_.prototype._unloadComponent = function(ref) { + if (!collection_1.ListWrapper.contains(this._rootComponents, ref)) { + return ; + } + this.unregisterChangeDetector(view_ref_1.internalView(ref.hostView).changeDetector.ref); + collection_1.ListWrapper.remove(this._rootComponents, ref); + }; + Object.defineProperty(ApplicationRef_.prototype, "injector", { + get: function() { + return this._injector; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ApplicationRef_.prototype, "zone", { + get: function() { + return this._zone; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_.prototype.tick = function() { + if (this._runningTick) { + throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); + } + var s = ApplicationRef_._tickScope(); + try { + this._runningTick = true; + this._changeDetectorRefs.forEach(function(detector) { + return detector.detectChanges(); + }); + if (this._enforceNoNewChanges) { + this._changeDetectorRefs.forEach(function(detector) { + return detector.checkNoChanges(); + }); + } + } finally { + this._runningTick = false; + profile_1.wtfLeave(s); + } + }; + ApplicationRef_.prototype.dispose = function() { + this._rootComponents.forEach(function(ref) { + return ref.dispose(); + }); + this._disposeListeners.forEach(function(dispose) { + return dispose(); + }); + this._platform._applicationDisposed(this); + }; + Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { + get: function() { + return this._rootComponentTypes; + }, + enumerable: true, + configurable: true + }); + ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); + return ApplicationRef_; + })(ApplicationRef); + exports.ApplicationRef_ = ApplicationRef_; + global.define = __define; + return module.exports; +}); + +System.register("angular2/web_worker/worker", ["angular2/lifecycle_hooks", "angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/di", "angular2/src/common/pipes", "angular2/src/facade/facade", "angular2/src/core/application_ref", "angular2/src/core/services", "angular2/src/core/linker", "angular2/src/core/zone", "angular2/src/core/render/render", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/core/debug", "angular2/src/core/change_detection", "angular2/profile", "angular2/src/web_workers/worker/application", "angular2/src/web_workers/shared/client_message_broker", "angular2/src/web_workers/shared/service_message_broker", "angular2/src/web_workers/shared/serializer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function __export(m) { + for (var p in m) + if (!exports.hasOwnProperty(p)) + exports[p] = m[p]; + } + __export(require("angular2/lifecycle_hooks")); + __export(require("angular2/src/core/metadata")); + __export(require("angular2/src/core/util")); + __export(require("angular2/src/core/di")); + __export(require("angular2/src/common/pipes")); + __export(require("angular2/src/facade/facade")); + __export(require("angular2/src/core/application_ref")); + __export(require("angular2/src/core/services")); + __export(require("angular2/src/core/linker")); + __export(require("angular2/src/core/zone")); + var render_1 = require("angular2/src/core/render/render"); + exports.Renderer = render_1.Renderer; + exports.RenderViewRef = render_1.RenderViewRef; + exports.RenderProtoViewRef = render_1.RenderProtoViewRef; + exports.RenderFragmentRef = render_1.RenderFragmentRef; + exports.RenderViewWithFragments = render_1.RenderViewWithFragments; + exports.RenderTemplateCmd = render_1.RenderTemplateCmd; + exports.RenderTextCmd = render_1.RenderTextCmd; + exports.RenderNgContentCmd = render_1.RenderNgContentCmd; + exports.RenderBeginElementCmd = render_1.RenderBeginElementCmd; + exports.RenderBeginComponentCmd = render_1.RenderBeginComponentCmd; + exports.RenderEmbeddedTemplateCmd = render_1.RenderEmbeddedTemplateCmd; + exports.RenderBeginCmd = render_1.RenderBeginCmd; + __export(require("angular2/src/common/directives")); + __export(require("angular2/src/common/forms")); + __export(require("angular2/src/core/debug")); + __export(require("angular2/src/core/change_detection")); + __export(require("angular2/profile")); + __export(require("angular2/src/web_workers/worker/application")); + var client_message_broker_1 = require("angular2/src/web_workers/shared/client_message_broker"); + exports.ClientMessageBroker = client_message_broker_1.ClientMessageBroker; + exports.ClientMessageBrokerFactory = client_message_broker_1.ClientMessageBrokerFactory; + exports.FnArg = client_message_broker_1.FnArg; + exports.UiArguments = client_message_broker_1.UiArguments; + var service_message_broker_1 = require("angular2/src/web_workers/shared/service_message_broker"); + exports.ReceivedMessage = service_message_broker_1.ReceivedMessage; + exports.ServiceMessageBroker = service_message_broker_1.ServiceMessageBroker; + exports.ServiceMessageBrokerFactory = service_message_broker_1.ServiceMessageBrokerFactory; + var serializer_1 = require("angular2/src/web_workers/shared/serializer"); + exports.PRIMITIVE = serializer_1.PRIMITIVE; + global.define = __define; + return module.exports; +}); + +//# sourceMappingURLDisabled=worker.dev.js.map \ No newline at end of file